FS-4406 please test asap and report back

This commit is contained in:
Anthony Minessale 2012-07-10 23:04:16 -05:00
parent 293516be59
commit ba428a1559
2 changed files with 7 additions and 4 deletions

View File

@ -5041,11 +5041,13 @@ static void sofia_handle_sip_r_options(switch_core_session_t *session, int statu
} else if (sofia_test_pflag(profile, PFLAG_UNREG_OPTIONS_FAIL) && (status != 200 && status != 486) && sip && sip->sip_to) {
char *sql;
time_t now = switch_epoch_time_now(NULL);
const char *call_id = sip->sip_call_id->i_id;
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Expire registration '%s@%s' due to options failure\n",
sip->sip_to->a_url->url_user, sip->sip_to->a_url->url_host);
sql = switch_mprintf("update sip_registrations set expires=%ld where sip_user='%s' and sip_host='%s'",
(long) now, sip->sip_to->a_url->url_user, sip->sip_to->a_url->url_host);
sql = switch_mprintf("update sip_registrations set expires=%ld where sip_user='%s' and sip_host='%s' and call_id='%q'",
(long) now, sip->sip_to->a_url->url_user, sip->sip_to->a_url->url_host, call_id);
sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
}
}

View File

@ -551,15 +551,16 @@ int sofia_reg_nat_callback(void *pArg, int argc, char **argv, char **columnNames
{
sofia_profile_t *profile = (sofia_profile_t *) pArg;
nua_handle_t *nh;
char to[128] = "";
char to[512] = "";
sofia_destination_t *dst = NULL;
switch_snprintf(to, sizeof(to), "sip:%s@%s", argv[1], argv[2]);
dst = sofia_glue_get_destination(argv[3]);
switch_assert(dst);
nh = nua_handle(profile->nua, NULL, SIPTAG_FROM_STR(profile->url), SIPTAG_TO_STR(to), NUTAG_URL(dst->contact), SIPTAG_CONTACT_STR(profile->url),
TAG_END());
SIPTAG_CALL_ID_STR(argv[0]), TAG_END());
nua_handle_bind(nh, &mod_sofia_globals.destroy_private);
nua_options(nh,
NTATAG_SIP_T2(5000),