mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-30 07:04:17 +00:00
tweak sla presence code
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16223 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
da20b09be7
commit
e71f66e070
6 files changed
+98
-61
No files matched your search
@@ -3831,8 +3831,9 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
|
||||
" contact VARCHAR(255),\n"
|
||||
" presence_id VARCHAR(255),\n"
|
||||
" presence_data VARCHAR(255),\n"
|
||||
" call_info VARCHAR(255),\n"
|
||||
" call_info_state VARCHAR(255)\n"
|
||||
" call_info VARCHAR(255),\n"
|
||||
" call_info_state VARCHAR(255),\n"
|
||||
" expires INTEGER default 0\n"
|
||||
");\n";
|
||||
|
||||
char sub_sql[] =
|
||||
@@ -3918,7 +3919,8 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
|
||||
"create index sd_hostname on sip_dialogs (hostname)",
|
||||
"create index sd_presence_data on sip_dialogs (presence_data)",
|
||||
"create index sd_call_info on sip_dialogs (call_info)",
|
||||
"create index sd_call_info on sip_dialogs (call_info_state)",
|
||||
"create index sd_call_info_state on sip_dialogs (call_info_state)",
|
||||
"create index sd_expires on sip_dialogs (expires)",
|
||||
"create index sp_hostname on sip_presence (hostname)",
|
||||
"create index sa_nonce on sip_authentication (nonce)",
|
||||
"create index sa_hostname on sip_authentication (hostname)",
|
||||
@@ -3988,7 +3990,7 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
|
||||
}
|
||||
|
||||
free(test_sql);
|
||||
test_sql = switch_mprintf("delete from sip_dialogs where hostname='%q' and call_info_state like '%%'", mod_sofia_globals.hostname);
|
||||
test_sql = switch_mprintf("delete from sip_dialogs where hostname='%q' and expires > 0", mod_sofia_globals.hostname);
|
||||
|
||||
if (switch_odbc_handle_exec(odbc_dbh, test_sql, NULL) != SWITCH_ODBC_SUCCESS) {
|
||||
switch_odbc_handle_exec(odbc_dbh, "DROP TABLE sip_dialogs", NULL);
|
||||
@@ -4055,7 +4057,7 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
|
||||
switch_core_db_test_reactive(db, test_sql, "DROP TABLE sip_subscriptions", sub_sql);
|
||||
free(test_sql);
|
||||
|
||||
test_sql = switch_mprintf("delete from sip_dialogs where hostname='%q' and call_info_state like '%%'", mod_sofia_globals.hostname);
|
||||
test_sql = switch_mprintf("delete from sip_dialogs where hostname='%q' and expires > 0", mod_sofia_globals.hostname);
|
||||
switch_core_db_test_reactive(db, test_sql, "DROP TABLE sip_dialogs", dialog_sql);
|
||||
free(test_sql);
|
||||
|
||||
@@ -4133,7 +4135,8 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
|
||||
switch_core_db_exec(db, "create index if not exists sd_presence_id on sip_dialogs (presence_id)", NULL, NULL, NULL);
|
||||
switch_core_db_exec(db, "create index if not exists sd_presence_data on sip_dialogs (presence_data)", NULL, NULL, NULL);
|
||||
switch_core_db_exec(db, "create index if not exists sd_call_info on sip_dialogs (call_info)", NULL, NULL, NULL);
|
||||
switch_core_db_exec(db, "create index if not exists sd_call_info on sip_dialogs (call_info_state)", NULL, NULL, NULL);
|
||||
switch_core_db_exec(db, "create index if not exists sd_call_info_state on sip_dialogs (call_info_state)", NULL, NULL, NULL);
|
||||
switch_core_db_exec(db, "create index if not exists sd_expires on sip_dialogs (expires)", NULL, NULL, NULL);
|
||||
|
||||
switch_core_db_exec(db, "create index if not exists sp_hostname on sip_presence (hostname)", NULL, NULL, NULL);
|
||||
|
||||
@@ -4189,6 +4192,15 @@ void sofia_glue_execute_sql(sofia_profile_t *profile, char **sqlp, switch_bool_t
|
||||
}
|
||||
}
|
||||
|
||||
void sofia_glue_execute_sql_now(sofia_profile_t *profile, char **sqlp, switch_bool_t sql_already_dynamic)
|
||||
{
|
||||
sofia_glue_actually_execute_sql(profile, *sqlp, profile->ireg_mutex);
|
||||
if (sql_already_dynamic) {
|
||||
switch_safe_free(*sqlp);
|
||||
}
|
||||
*sqlp = NULL;
|
||||
}
|
||||
|
||||
|
||||
switch_cache_db_handle_t *sofia_glue_get_db_handle(sofia_profile_t *profile)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user