--resolve FS-5426

This commit is contained in:
Ken Rice 2013-07-03 11:21:47 -05:00
parent bf89fbd81d
commit 51fd5a6cee
5 changed files with 21 additions and 1 deletions

View File

@ -178,6 +178,10 @@
<!-- if you want to send any special bind params of your own -->
<!--<param name="bind-params" value="transport=udp"/>-->
<!--<param name="unregister-on-options-fail" value="true"/>-->
<!-- Send an OPTIONS packet to all registered endpoints -->
<!--<param name="all-reg-options-ping" value="true"/>-->
<!-- Send an OPTIONS packet to NATed registered endpoints. Can be 'true' or 'udp-only'. --!>
<!--<param name="nat-options-ping" value="true"/>-->
<!-- TLS: disabled by default, set to "true" to enable -->
<param name="tls" value="$${internal_ssl_enable}"/>

View File

@ -205,6 +205,10 @@
<!-- if you want to send any special bind params of your own -->
<!-- <param name="bind-params" value="transport=udp"/> -->
<!-- <param name="unregister-on-options-fail" value="true"/> -->
<!-- Send an OPTIONS packet to all registered endpoints -->
<!--<param name="all-reg-options-ping" value="true"/>-->
<!-- Send an OPTIONS packet to NATed registered endpoints. Can be 'true' or 'udp-only
<!--<param name="nat-options-ping" value="true"/>-->
<!-- TLS: disabled by default, set to "true" to enable -->
<param name="tls" value="$${internal_ssl_enable}"/>

View File

@ -230,6 +230,7 @@ typedef enum {
PFLAG_DISABLE_SRV503,
PFLAG_DISABLE_NAPTR,
PFLAG_NAT_OPTIONS_PING,
PFLAG_UDP_NAT_OPTIONS_PING,
PFLAG_ALL_REG_OPTIONS_PING,
PFLAG_MESSAGE_QUERY_ON_REGISTER,
PFLAG_MESSAGE_QUERY_ON_FIRST_REGISTER,

View File

@ -4309,10 +4309,13 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name)
} else if (!strcasecmp(var, "contact-user")) {
profile->contact_user = switch_core_strdup(profile->pool, val);
} else if (!strcasecmp(var, "nat-options-ping")) {
if (switch_true(val)) {
if (!strcasecmp(val, "udp-only")) {
sofia_set_pflag(profile, PFLAG_UDP_NAT_OPTIONS_PING);
} else if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_NAT_OPTIONS_PING);
} else {
sofia_clear_pflag(profile, PFLAG_NAT_OPTIONS_PING);
sofia_clear_pflag(profile, PFLAG_UDP_NAT_OPTIONS_PING);
}
} else if (!strcasecmp(var, "all-reg-options-ping")) {
if (switch_true(val)) {

View File

@ -822,6 +822,14 @@ void sofia_reg_check_expire(sofia_profile_t *profile, time_t now, int reboot)
" from sip_registrations where hostname='%s' and "
"profile_name='%s'", mod_sofia_globals.hostname, profile->name);
sofia_glue_execute_sql_callback(profile, profile->dbh_mutex, sql, sofia_reg_nat_callback, profile);
switch_safe_free(sql);
} else if (sofia_test_pflag(profile, PFLAG_UDP_NAT_OPTIONS_PING)) {
sql = switch_mprintf("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 '%%UDP-NAT%%' "
"and hostname='%s' and profile_name='%s'", mod_sofia_globals.hostname, profile->name);
sofia_glue_execute_sql_callback(profile, profile->dbh_mutex, sql, sofia_reg_nat_callback, profile);
switch_safe_free(sql);
} else if (sofia_test_pflag(profile, PFLAG_NAT_OPTIONS_PING)) {