]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add support for NDLB-force-rport=safe param that does force-rport behavior only on...
authorMichael Jerris <mike@jerris.com>
Wed, 3 Nov 2010 15:53:39 +0000 (11:53 -0400)
committerMichael Jerris <mike@jerris.com>
Wed, 3 Nov 2010 15:53:39 +0000 (11:53 -0400)
libs/sofia-sip/.update
libs/sofia-sip/libsofia-sip-ua/nta/nta.c
src/mod/endpoints/mod_sofia/sofia.c

index 8a93851773250e1981c2ee18c5793aa363cd9b8a..5e1bb2ba7b884f4e478bff44c68e5e764268f3eb 100644 (file)
@@ -1 +1 @@
-Tue Nov  2 17:57:25 CDT 2010
+Wed Nov  3 11:46:27 EDT 2010
index abe7e68c448495c7d414182bddac622e491cccea..7d3280fef61ecebe0c6371d79472ef03ab18b0a3 100644 (file)
@@ -1674,7 +1674,7 @@ int agent_set_params(nta_agent_t *agent, tagi_t *tags)
     progress = 60 * 1000;
   agent->sa_progress = progress;
 
-  if (server_rport > 2)
+  if (server_rport > 3)
     server_rport = 1;
   else if (server_rport < 0)
     server_rport = 1;
@@ -3084,7 +3084,9 @@ int agent_check_request_via(nta_agent_t *agent,
     rport = su_sprintf(msg_home(msg), "rport=%u", ntohs(from->su_port));
     msg_header_replace_param(msg_home(msg), v->v_common, rport);
   }
-  else if (agent->sa_server_rport == 2) {
+  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))) {
     rport = su_sprintf(msg_home(msg), "rport=%u", ntohs(from->su_port));
     msg_header_replace_param(msg_home(msg), v->v_common, rport);
   }
index 0f9e265c4d2bcf067ceba2633b7e7f6f052dcf3d..ac1251daa9e6876e852e12aefe0a99f80a7608be 100644 (file)
@@ -2414,7 +2414,9 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
                                                        profile->dtmf_type = DTMF_NONE;
                                                }
                                        } else if (!strcasecmp(var, "NDLB-force-rport")) {
-                                               if (switch_true(val)) {
+                                               if (val && !strcasecmp(val, "safe")) {
+                                                       profile->rport_level = 3;
+                                               } else if (switch_true(val)) {
                                                        profile->rport_level = 2;
                                                }
                                        } else if (!strcasecmp(var, "caller-id-type")) {
@@ -3083,7 +3085,9 @@ switch_status_t config_sofia(int reload, char *profile_name)
                                                        profile->dtmf_type = DTMF_NONE;
                                                }
                                        } else if (!strcasecmp(var, "NDLB-force-rport")) {
-                                               if (switch_true(val)) {
+                                               if (val && !strcasecmp(val, "safe")) {
+                                                       profile->rport_level = 3;
+                                               } else if (switch_true(val)) {
                                                        profile->rport_level = 2;
                                                }
                                        } else if (!strcasecmp(var, "auto-rtp-bugs")) {