adding test_sql and network_ip to sub callback

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13602 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Brian West committed 2009-06-04 01:18:00 +00:00
1 parent 50174a7412
commit e353aaf3d0
2 files changed
+18 -17

No files matched your search

+10 -6
View File
@@ -3570,7 +3570,8 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
" user_agent VARCHAR(255),\n"
" accept VARCHAR(255),\n"
" profile_name VARCHAR(255),\n"
" hostname VARCHAR(255)\n"
" hostname VARCHAR(255),\n"
" network_ip VARCHAR(255)\n"
");\n";
char auth_sql[] =
@@ -3621,6 +3622,7 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
"create index sr_sip_realm on sip_registrations (sip_realm)",
"create index ss_call_id on sip_subscriptions (call_id)",
"create index ss_hostname on sip_subscriptions (hostname)",
"create index ss_hostname on sip_subscriptions (network_ip)",
"create index ss_sip_user on sip_subscriptions (sip_user)",
"create index ss_sip_host on sip_subscriptions (sip_host)",
"create index ss_presence_hosts on sip_subscriptions (presence_hosts)",
@@ -3634,16 +3636,15 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
"create index sa_nonce on sip_authentication (nonce)",
"create index sa_hostname on sip_authentication (hostname)",
"create index ssa_hostname on sip_shared_appearance_subscriptions (hostname)",
"create index ssa_hostname on sip_shared_appearance_subscriptions (network_ip)",
"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
};
@@ -3700,7 +3701,7 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
}
free(test_sql);
test_sql = switch_mprintf("delete from sip_shared_appearance_subscriptions where contact_str='' or hostname='%q'", mod_sofia_globals.hostname);
test_sql = switch_mprintf("delete from sip_shared_appearance_subscriptions where contact_str='' or network_ip='%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);
@@ -3737,7 +3738,7 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
switch_core_db_test_reactive(profile->master_db, test_sql, "DROP TABLE sip_registrations", reg_sql);
free(test_sql);
test_sql = switch_mprintf("delete from sip_subscriptions where hostname='%q'", mod_sofia_globals.hostname);
test_sql = switch_mprintf("delete from sip_subscriptions where network_ip='%q'", mod_sofia_globals.hostname);
switch_core_db_test_reactive(profile->master_db, test_sql, "DROP TABLE sip_subscriptions", sub_sql);
free(test_sql);
@@ -3754,7 +3755,7 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
free(test_sql);
test_sql = switch_mprintf("delete from sip_shared_appearance_subscriptions where contact_str = '' or hostname='%q'", mod_sofia_globals.hostname);
test_sql = switch_mprintf("delete from sip_shared_appearance_subscriptions where contact_str = '' or network_ip='%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);
@@ -3775,6 +3776,8 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
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_hostname on sip_shared_appearance_dialogs (network_ip)",
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)",
@@ -3801,6 +3804,7 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
switch_core_db_exec(profile->master_db, "create index if not exists ss_call_id on sip_subscriptions (call_id)", NULL, NULL, NULL);
switch_core_db_exec(profile->master_db, "create index if not exists ss_hostname on sip_subscriptions (hostname)", NULL, NULL, NULL);
switch_core_db_exec(profile->master_db, "create index if not exists ss_hostname on sip_subscriptions (network_ip)", NULL, NULL, NULL);
switch_core_db_exec(profile->master_db, "create index if not exists ss_sip_user on sip_subscriptions (sip_user)", NULL, NULL, NULL);
switch_core_db_exec(profile->master_db, "create index if not exists ss_sip_host on sip_subscriptions (sip_host)", NULL, NULL, NULL);
switch_core_db_exec(profile->master_db, "create index if not exists ss_presence_hosts on sip_subscriptions (presence_hosts)", NULL, NULL, NULL);