|
|
|
@@ -3133,7 +3133,7 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
|
|
|
|
|
switch_odbc_handle_exec(profile->master_odbc, "DROP TABLE sip_registrations", NULL);
|
|
|
|
|
switch_odbc_handle_exec(profile->master_odbc, reg_sql, NULL);
|
|
|
|
|
}
|
|
|
|
|
free(test_sql);
|
|
|
|
|
switch_core_db_free(test_sql);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test_sql = switch_mprintf("delete from sip_subscriptions where hostname='%q'", mod_sofia_globals.hostname);
|
|
|
|
@@ -3143,7 +3143,7 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
|
|
|
|
|
switch_odbc_handle_exec(profile->master_odbc, sub_sql, NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
free(test_sql);
|
|
|
|
|
switch_core_db_free(test_sql);
|
|
|
|
|
test_sql = switch_mprintf("delete from sip_dialogs where hostname='%q'", mod_sofia_globals.hostname);
|
|
|
|
|
|
|
|
|
|
if (switch_odbc_handle_exec(profile->master_odbc, test_sql, NULL) != SWITCH_ODBC_SUCCESS) {
|
|
|
|
@@ -3158,21 +3158,21 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
|
|
|
|
|
switch_odbc_handle_exec(profile->master_odbc, pres_sql, NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
free(test_sql);
|
|
|
|
|
switch_core_db_free(test_sql);
|
|
|
|
|
test_sql = switch_mprintf("delete from sip_authentication where hostname='%q'", mod_sofia_globals.hostname);
|
|
|
|
|
|
|
|
|
|
if (switch_odbc_handle_exec(profile->master_odbc, test_sql, NULL) != SWITCH_ODBC_SUCCESS) {
|
|
|
|
|
switch_odbc_handle_exec(profile->master_odbc, "DROP TABLE sip_authentication", NULL);
|
|
|
|
|
switch_odbc_handle_exec(profile->master_odbc, auth_sql, NULL);
|
|
|
|
|
}
|
|
|
|
|
free(test_sql);
|
|
|
|
|
switch_core_db_free(test_sql);
|
|
|
|
|
|
|
|
|
|
test_sql = switch_mprintf("delete from sip_shared_appearance_subscriptions where contact_str='' or hostname='%q'", mod_sofia_globals.hostname);
|
|
|
|
|
if (switch_odbc_handle_exec(profile->master_odbc, test_sql, NULL) != SWITCH_ODBC_SUCCESS) {
|
|
|
|
|
switch_odbc_handle_exec(profile->master_odbc, "DROP TABLE sip_shared_appearance_subscriptions", NULL);
|
|
|
|
|
switch_odbc_handle_exec(profile->master_odbc, shared_appearance_sql, NULL);
|
|
|
|
|
}
|
|
|
|
|
free(test_sql);
|
|
|
|
|
switch_core_db_free(test_sql);
|
|
|
|
|
|
|
|
|
|
for (x = 0; indexes[x]; x++) {
|
|
|
|
|
switch_odbc_handle_exec(profile->master_odbc, indexes[x], NULL);
|
|
|
|
@@ -3192,28 +3192,28 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
|
|
|
|
|
mod_sofia_globals.hostname);
|
|
|
|
|
|
|
|
|
|
switch_core_db_test_reactive(profile->master_db, test_sql, "DROP TABLE sip_registrations", reg_sql);
|
|
|
|
|
free(test_sql);
|
|
|
|
|
switch_core_db_free(test_sql);
|
|
|
|
|
|
|
|
|
|
test_sql = switch_mprintf("delete from sip_subscriptions where hostname='%q'", mod_sofia_globals.hostname);
|
|
|
|
|
switch_core_db_test_reactive(profile->master_db, test_sql, "DROP TABLE sip_subscriptions", sub_sql);
|
|
|
|
|
free(test_sql);
|
|
|
|
|
switch_core_db_free(test_sql);
|
|
|
|
|
|
|
|
|
|
test_sql = switch_mprintf("delete from sip_dialogs where hostname='%q'", mod_sofia_globals.hostname);
|
|
|
|
|
switch_core_db_test_reactive(profile->master_db, test_sql, "DROP TABLE sip_dialogs", dialog_sql);
|
|
|
|
|
free(test_sql);
|
|
|
|
|
switch_core_db_free(test_sql);
|
|
|
|
|
|
|
|
|
|
test_sql = switch_mprintf("delete from sip_presence where hostname='%q'", mod_sofia_globals.hostname);
|
|
|
|
|
switch_core_db_test_reactive(profile->master_db, test_sql, "DROP TABLE sip_presence", pres_sql);
|
|
|
|
|
free(test_sql);
|
|
|
|
|
switch_core_db_free(test_sql);
|
|
|
|
|
|
|
|
|
|
test_sql = switch_mprintf("delete from sip_authentication where hostname='%q'", mod_sofia_globals.hostname);
|
|
|
|
|
switch_core_db_test_reactive(profile->master_db, test_sql, "DROP TABLE sip_authentication", auth_sql);
|
|
|
|
|
free(test_sql);
|
|
|
|
|
switch_core_db_free(test_sql);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test_sql = switch_mprintf("delete from sip_shared_appearance_subscriptions where contact_str = '' or hostname='%q'", mod_sofia_globals.hostname);
|
|
|
|
|
switch_core_db_test_reactive(profile->master_db, test_sql, "DROP TABLE sip_shared_appearance_subscriptions", shared_appearance_sql);
|
|
|
|
|
free(test_sql);
|
|
|
|
|
switch_core_db_free(test_sql);
|
|
|
|
|
|
|
|
|
|
switch_core_db_exec(profile->master_db, "create index if not exists ssa_hostname on sip_shared_appearance_subscriptions (hostname)",
|
|
|
|
|
NULL, NULL, NULL);
|
|
|
|
|