<?php
$res = run_query("SHOW COLUMNS FROM " . $config['table_prefix'] . "module_asterisk_servers LIKE 'hide_phones_type'");
if (!sql_num_rows($res)) {
    run_query("ALTER TABLE " . $config['table_prefix'] . "module_asterisk_servers ADD hide_phones_type TINYINT(1) NOT NULL AFTER hide_phones_count_chars");
}
run_query("UPDATE " . $config['table_prefix'] . "module_asterisk_servers SET hide_phones_type = 2 WHERE hide_phones_count_chars > 0");