From 6772c795e029639e48fc0b6e2248de5c919f9c41 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 15 Oct 2010 17:59:00 -0500 Subject: [PATCH] FS-2787 --- src/mod/endpoints/mod_sofia/sofia.c | 2 +- src/mod/endpoints/mod_sofia/sofia_reg.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 0d69bdb4bb..2f5cbbd8f9 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -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 { diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index 81cd534834..c2c85e8885 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -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); }