]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
make nat options ping configurable and leave it off by default
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 2 Apr 2009 21:53:47 +0000 (21:53 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 2 Apr 2009 21:53:47 +0000 (21:53 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12897 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.h
src/mod/endpoints/mod_sofia/sofia.c
src/mod/endpoints/mod_sofia/sofia_reg.c

index ed3616c762eec9728755343b13452f8aeb4f9838..212d0445f5258525d832cf795005c593d5a1b2fc 100644 (file)
@@ -182,7 +182,7 @@ typedef enum {
        PFLAG_DISABLE_SRV,
        PFLAG_DISABLE_NAPTR,
        PFLAG_AUTOFLUSH,
-
+       PFLAG_NAT_OPTIONS_PING,
        /* No new flags below this line */
        PFLAG_MAX
 } PFLAGS;
index b1900e5111f75bf0692050c6f97bd9d2d61730f7..52108aa8ed29bf13b6ea0f353028ce77cd17a3f8 100644 (file)
@@ -1679,6 +1679,12 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
                                                } else {
                                                        sofia_clear_pflag(profile, PFLAG_AUTOFLUSH);
                                                }
+                                       } else if (!strcasecmp(var, "nat-options-ping")) {
+                                               if (switch_true(val)) {
+                                                       sofia_set_pflag(profile, PFLAG_NAT_OPTIONS_PING);
+                                               } else {
+                                                       sofia_clear_pflag(profile, PFLAG_NAT_OPTIONS_PING);
+                                               }
                                        } else if (!strcasecmp(var, "inbound-codec-negotiation")) {
                                                if (!strcasecmp(val, "greedy")) {
                                                        sofia_set_pflag(profile, PFLAG_GREEDY);
@@ -2211,6 +2217,12 @@ switch_status_t config_sofia(int reload, char *profile_name)
                                                } else {
                                                        sofia_clear_pflag(profile, PFLAG_AUTOFLUSH);
                                                }
+                                       } else if (!strcasecmp(var, "nat-options-ping")) {
+                                               if (switch_true(val)) {
+                                                       sofia_set_pflag(profile, PFLAG_NAT_OPTIONS_PING);
+                                               } else {
+                                                       sofia_clear_pflag(profile, PFLAG_NAT_OPTIONS_PING);
+                                               }
                                        } else if (!strcasecmp(var, "inbound-codec-negotiation")) {
                                                if (!strcasecmp(val, "greedy")) {
                                                        sofia_set_pflag(profile, PFLAG_GREEDY);
index 3fc06aaaa1c2d52bf5e6c4a7671f48a559636a1c..322734caff403b24ff68f0528fd7f9872394b4dd 100644 (file)
@@ -596,7 +596,7 @@ void sofia_reg_check_expire(sofia_profile_t *profile, time_t now, int reboot)
        sofia_glue_actually_execute_sql(profile, SWITCH_FALSE, sql, NULL);
 
 
-       if (now) {
+       if (now && 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 '%%AUTO-NAT%%' "