<!-- 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}"/>
<!-- 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}"/>
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,
} 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)) {
" 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)) {