[Freeswitch-svn] [commit] r12897 - freeswitch/trunk/src/mod/endpoints/mod_sofia
FreeSWITCH SVN
anthm at freeswitch.org
Thu Apr 2 14:53:47 PDT 2009
Author: anthm
Date: Thu Apr 2 16:53:47 2009
New Revision: 12897
Log:
make nat options ping configurable and leave it off by default
Modified:
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h Thu Apr 2 16:53:47 2009
@@ -182,7 +182,7 @@
PFLAG_DISABLE_SRV,
PFLAG_DISABLE_NAPTR,
PFLAG_AUTOFLUSH,
-
+ PFLAG_NAT_OPTIONS_PING,
/* No new flags below this line */
PFLAG_MAX
} PFLAGS;
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Thu Apr 2 16:53:47 2009
@@ -1679,6 +1679,12 @@
} 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 @@
} 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);
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c Thu Apr 2 16:53:47 2009
@@ -596,7 +596,7 @@
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%%' "
More information about the Freeswitch-svn
mailing list