clean up dialog stuff on presence for sla and other stuff

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12708 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale committed 2009-03-22 05:15:17 +00:00
1 parent 2db2a8b248
commit 41944b7e6f
7 files changed
+287 -102

No files matched your search

+41
View File
@@ -3265,6 +3265,15 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
" contact_str VARCHAR(255)\n"
");\n";
char shared_appearance_dialogs_sql[] =
"CREATE TABLE sip_shared_appearance_dialogs (\n"
" profile_name VARCHAR(255),\n"
" hostname VARCHAR(255),\n"
" contact_str VARCHAR(255),\n"
" call_id VARCHAR(255),\n"
" expires INTEGER\n"
");\n";
if (profile->odbc_dsn) {
#ifdef SWITCH_HAVE_ODBC
int x;
@@ -3298,6 +3307,13 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
"create index ssa_subscriber on sip_shared_appearance_subscriptions (subscriber)",
"create index ssa_profile_name on sip_shared_appearance_subscriptions (profile_name)",
"create index ssa_aor on sip_shared_appearance_subscriptions (aor)",
"create index ssd_profile_name on sip_shared_appearance_dialogs (profile_name)",
"create index ssd_hostname on sip_shared_appearance_dialogs (hostname)",
"create index ssd_contact_str on sip_shared_appearance_dialogs (contact_str)",
"create index ssd_call_id on sip_shared_appearance_dialogs (call_id)",
"create index ssd_expires on sip_shared_appearance_dialogs (expires)",
NULL
};
@@ -3361,6 +3377,15 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
}
free(test_sql);
test_sql = switch_mprintf("delete from sip_shared_appearance_dialogs 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_dialogs", NULL);
switch_odbc_handle_exec(profile->master_odbc, shared_appearance_dialogs_sql, NULL);
}
free(test_sql);
for (x = 0; indexes[x]; x++) {
switch_odbc_handle_exec(profile->master_odbc, indexes[x], NULL);
}
@@ -3402,6 +3427,10 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
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);
test_sql = switch_mprintf("delete from sip_shared_appearance_dialogs 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_dialogs", shared_appearance_dialogs_sql);
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);
@@ -3412,6 +3441,18 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
switch_core_db_exec(profile->master_db, "create index if not exists ssa_aor on sip_shared_appearance_subscriptions (aor)", NULL, NULL, NULL);
switch_core_db_exec(profile->master_db, "create index if not exists ssd_profile_name on sip_shared_appearance_dialogs (profile_name)",
NULL, NULL, NULL);
switch_core_db_exec(profile->master_db, "create index if not exists ssd_hostname on sip_shared_appearance_dialogs (hostname)",
NULL, NULL, NULL);
switch_core_db_exec(profile->master_db, "create index if not exists ssd_contact_str on sip_shared_appearance_dialogs (contact_str)",
NULL, NULL, NULL);
switch_core_db_exec(profile->master_db, "create index if not exists ssd_call_id on sip_shared_appearance_dialogs (call_id)",
NULL, NULL, NULL);
switch_core_db_exec(profile->master_db, "create index if not exists ssd_expires on sip_shared_appearance_dialogs (expires)",
NULL, NULL, NULL);
switch_core_db_exec(profile->master_db, "create index if not exists sr_call_id on sip_registrations (call_id)", NULL, NULL, NULL);
switch_core_db_exec(profile->master_db, "create index if not exists sr_sip_user on sip_registrations (sip_user)", NULL, NULL, NULL);