<?php
$res = run_query("SHOW COLUMNS FROM " . $config['table_prefix'] . "module_asterisk_servers LIKE 'capacity'");
if (!sql_num_rows($res)) {
    run_query("ALTER TABLE " . $config['table_prefix'] . "module_asterisk_servers ADD capacity INT NOT NULL");
}
$res = run_query("SHOW COLUMNS FROM " . $config['table_prefix'] . "module_asterisk_users LIKE 'all_dir'");
if (!sql_num_rows($res)) {
    run_query("ALTER TABLE " . $config['table_prefix'] . "module_asterisk_users ADD all_dir INT NOT NULL");
}