This commit is contained in:
Anthony Minessale 2010-10-15 17:59:00 -05:00
parent afaf1fac05
commit 6772c795e0
2 changed files with 5 additions and 3 deletions

View File

@ -3406,7 +3406,7 @@ switch_status_t config_sofia(int reload, char *profile_name)
} else {
sofia_clear_pflag(profile, PFLAG_NAT_OPTIONS_PING);
}
} else if (!strcasecmp(var, "all-options-ping")) {
} else if (!strcasecmp(var, "all-reg-options-ping")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_ALL_REG_OPTIONS_PING);
} else {

View File

@ -676,14 +676,16 @@ void sofia_reg_check_expire(sofia_profile_t *profile, time_t now, int reboot)
if (sofia_test_pflag(profile, PFLAG_ALL_REG_OPTIONS_PING)) {
switch_snprintf(sql, sizeof(sql), "select call_id,sip_user,sip_host,contact,status,rpid,"
"expires,user_agent,server_user,server_host,profile_name"
" from sip_registrations where hostname='%s'", mod_sofia_globals.hostname);
" from sip_registrations where hostname='%s' and "
"profile_name='%s'", mod_sofia_globals.hostname, profile->name);
sofia_glue_execute_sql_callback(profile, NULL, sql, sofia_reg_nat_callback, profile);
} else if (sofia_test_pflag(profile, PFLAG_NAT_OPTIONS_PING)) {
switch_snprintf(sql, sizeof(sql), "select call_id,sip_user,sip_host,contact,status,rpid,"
"expires,user_agent,server_user,server_host,profile_name"
" from sip_registrations where (status like '%%NAT%%' "
"or contact like '%%fs_nat=yes%%') and hostname='%s'", mod_sofia_globals.hostname);
"or contact like '%%fs_nat=yes%%') and hostname='%s' "
"and profile_name='%s'", mod_sofia_globals.hostname, profile->name);
sofia_glue_execute_sql_callback(profile, NULL, sql, sofia_reg_nat_callback, profile);
}