]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-2787
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 15 Oct 2010 22:59:00 +0000 (17:59 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 15 Oct 2010 22:59:00 +0000 (17:59 -0500)
src/mod/endpoints/mod_sofia/sofia.c
src/mod/endpoints/mod_sofia/sofia_reg.c

index 0d69bdb4bb6d66a86d340b054e6f8b52d2dbbb23..2f5cbbd8f94dcac73844849b6bb34b4d491b1760 100644 (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 {
index 81cd5348345b9a77e1b2e3403c4ab2367ed69682..c2c85e88853a0e50adf04f5993732c0f5e99789e 100644 (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);
                }