]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Force rport on ADTRAN TA Devices
authorSpencer Thomason <spencer@whiteskycommunications.com>
Tue, 16 Sep 2014 19:53:12 +0000 (19:53 +0000)
committerSpencer Thomason <spencer@whiteskycommunications.com>
Thu, 2 Oct 2014 20:09:15 +0000 (13:09 -0700)
ADTRAN Total Access devices do not support sending the rport parameter in
the Via header. This allows us to detect the device and force rport when
using the "safe" parameter, enabling the device to be used behind NAT.

FS-6823 #resolve

libs/sofia-sip/libsofia-sip-ua/nta/nta.c
src/mod/endpoints/mod_sofia/sofia_reg.c

index 98d1ad25e16c7f4a847c478b9fbae317aed998bb..bb68025749e4f36663c0b612c6d5b96ee47efecd 100644 (file)
@@ -3188,7 +3188,9 @@ int agent_check_request_via(nta_agent_t *agent,
   else if (agent->sa_server_rport == 2 ||
                   (agent->sa_server_rport == 3 && sip && sip->sip_user_agent &&
                        sip->sip_user_agent->g_string &&
-                       (!strncasecmp(sip->sip_user_agent->g_string, "Polycom", 7) || !strncasecmp(sip->sip_user_agent->g_string, "KIRK Wireless Server", 20)))) {
+                       (!strncasecmp(sip->sip_user_agent->g_string, "Polycom", 7) ||
+                        !strncasecmp(sip->sip_user_agent->g_string, "KIRK Wireless Server", 20) ||
+                        !strncasecmp(sip->sip_user_agent->g_string, "ADTRAN_Total_Access", 19)))) {
     rport = su_sprintf(msg_home(msg), "rport=%u", ntohs(from->su_port));
     msg_header_replace_param(msg_home(msg), v->v_common, rport);
   }
index 053ddd9a9e2f3454837a2153afa70c41ac8ec7c0..9eacc1f576790c512617b7fcb91cf90a8ac8d755 100644 (file)
@@ -1499,7 +1499,9 @@ uint8_t sofia_reg_handle_register_token(nua_t *nua, sofia_profile_t *profile, nu
                        if (!is_tcp && !is_tls && (zstr(network_ip) || !switch_check_network_list_ip(network_ip, profile->local_network)) &&
                                profile->server_rport_level >= 2 && sip->sip_user_agent &&
                                sip->sip_user_agent->g_string &&
-                               ( !strncasecmp(sip->sip_user_agent->g_string, "Polycom", 7) || !strncasecmp(sip->sip_user_agent->g_string, "KIRK Wireless Server", 20) )) {
+                               ( !strncasecmp(sip->sip_user_agent->g_string, "Polycom", 7) ||
+                                 !strncasecmp(sip->sip_user_agent->g_string, "KIRK Wireless Server", 20) ||
+                                 !strncasecmp(sip->sip_user_agent->g_string, "ADTRAN_Total_Access", 19) )) {
                                if (sip && sip->sip_via) {
                                        const char *host = sip->sip_via->v_host;
                                        const char *c_port = sip->sip_via->v_port;