提交 216f1e11 authored 作者: Anthony Minessale's avatar Anthony Minessale

make nat options ping configurable and leave it off by default

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12897 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 241beaa4
...@@ -182,7 +182,7 @@ typedef enum { ...@@ -182,7 +182,7 @@ typedef enum {
PFLAG_DISABLE_SRV, PFLAG_DISABLE_SRV,
PFLAG_DISABLE_NAPTR, PFLAG_DISABLE_NAPTR,
PFLAG_AUTOFLUSH, PFLAG_AUTOFLUSH,
PFLAG_NAT_OPTIONS_PING,
/* No new flags below this line */ /* No new flags below this line */
PFLAG_MAX PFLAG_MAX
} PFLAGS; } PFLAGS;
......
...@@ -1679,6 +1679,12 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile) ...@@ -1679,6 +1679,12 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
} else { } else {
sofia_clear_pflag(profile, PFLAG_AUTOFLUSH); 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")) { } else if (!strcasecmp(var, "inbound-codec-negotiation")) {
if (!strcasecmp(val, "greedy")) { if (!strcasecmp(val, "greedy")) {
sofia_set_pflag(profile, PFLAG_GREEDY); sofia_set_pflag(profile, PFLAG_GREEDY);
...@@ -2211,6 +2217,12 @@ switch_status_t config_sofia(int reload, char *profile_name) ...@@ -2211,6 +2217,12 @@ switch_status_t config_sofia(int reload, char *profile_name)
} else { } else {
sofia_clear_pflag(profile, PFLAG_AUTOFLUSH); 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")) { } else if (!strcasecmp(var, "inbound-codec-negotiation")) {
if (!strcasecmp(val, "greedy")) { if (!strcasecmp(val, "greedy")) {
sofia_set_pflag(profile, PFLAG_GREEDY); sofia_set_pflag(profile, PFLAG_GREEDY);
......
...@@ -596,7 +596,7 @@ void sofia_reg_check_expire(sofia_profile_t *profile, time_t now, int reboot) ...@@ -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); 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," switch_snprintf(sql, sizeof(sql), "select call_id,sip_user,sip_host,contact,status,rpid,"
"expires,user_agent,server_user,server_host,profile_name" "expires,user_agent,server_user,server_host,profile_name"
" from sip_registrations where (status like '%%AUTO-NAT%%' " " from sip_registrations where (status like '%%AUTO-NAT%%' "
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论