提交 3ebd173c authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-3307 --resolve thanks, in the future, be sure to not include vanity comments.…

FS-3307 --resolve thanks, in the future, be sure to not include vanity comments.  The intention of the patch will be preserved by the jira ticket.  Also check our code formating guidelines.  Some of the patch was redundant so it was removed, mprintf already asserts when it doesn't work, and execute_sql_now both frees the sql string and locks the mutex for you.
上级 71658eab
......@@ -2186,6 +2186,26 @@ void sofia_presence_handle_sip_i_subscribe(int status,
sip->sip_expires->ex_delta = 31536000;
}
if ((sub_state == nua_substate_active) && (switch_stristr("dialog", (const char *) event))) {
sstr = switch_mprintf("active;expires=%ld", exp_delta);
sql = switch_mprintf("update sip_subscriptions "
"set expires=%ld "
"where call_id='%q' and event='dialog' and hostname='%q' ",
(long) switch_epoch_time_now(NULL) + (exp_delta * 2),
call_id,
mod_sofia_globals.hostname);
if (mod_sofia_globals.debug_presence > 0 || mod_sofia_globals.debug_sla > 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
"re-subscribe with dialog detected, sql: %s\n", sql);
}
sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);
} else {
if (sofia_test_pflag(profile, PFLAG_MULTIREG)) {
sql = switch_mprintf("delete from sip_subscriptions where call_id='%q' "
"or (proto='%q' and sip_user='%q' and sip_host='%q' "
......@@ -2238,6 +2258,7 @@ void sofia_presence_handle_sip_i_subscribe(int status,
}
switch_mutex_unlock(profile->ireg_mutex);
}
if (status < 200) {
char *sticky = NULL;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论