]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add NDLB-allow-nondup-sdp to indicate you want to parse a differnt sdp in 200 ok...
authorAnthony Minessale <anthm@freeswitch.org>
Sat, 30 Jul 2011 03:16:39 +0000 (22:16 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Sat, 30 Jul 2011 03:16:39 +0000 (22:16 -0500)
src/mod/endpoints/mod_sofia/mod_sofia.h
src/mod/endpoints/mod_sofia/sofia.c

index 466597af1ada0259d3f61fc146ef42b952f1cd46..795c7b5e59fde482cd0ceec2d460d85b065c40fe 100644 (file)
@@ -257,7 +257,8 @@ typedef enum {
        PFLAG_NDLB_TO_IN_200_CONTACT = (1 << 0),
        PFLAG_NDLB_BROKEN_AUTH_HASH = (1 << 1),
        PFLAG_NDLB_SENDRECV_IN_SESSION = (1 << 2),
-       PFLAG_NDLB_ALLOW_BAD_IANANAME = (1 << 3)
+       PFLAG_NDLB_ALLOW_BAD_IANANAME = (1 << 3),
+       PFLAG_NDLB_ALLOW_NONDUP_SDP = (1 << 4)
 } sofia_NDLB_t;
 
 typedef enum {
index e3f056379648436a3a04cabc45bdf47341bc4366..cfe9335211ce9e3eb7e650e8b1edc53762c457d0 100644 (file)
@@ -2954,6 +2954,12 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
                                                } else {
                                                        profile->ndlb &= ~PFLAG_NDLB_ALLOW_BAD_IANANAME;
                                                }
+                                       } else if (!strcasecmp(var, "NDLB-allow-nondup-sdp")) {
+                                               if (switch_true(val)) {
+                                                       profile->ndlb |= PFLAG_NDLB_ALLOW_NONDUP_SDP;
+                                               } else {
+                                                       profile->ndlb &= ~PFLAG_NDLB_ALLOW_NONDUP_SDP;
+                                               }
                                        } else if (!strcasecmp(var, "aggressive-nat-detection")) {
                                                if (switch_true(val)) {
                                                        sofia_set_pflag(profile, PFLAG_AGGRESSIVE_NAT_DETECTION);
@@ -3952,6 +3958,12 @@ switch_status_t config_sofia(int reload, char *profile_name)
                                                } else {
                                                        profile->ndlb &= ~PFLAG_NDLB_ALLOW_BAD_IANANAME;
                                                }
+                                       } else if (!strcasecmp(var, "NDLB-allow-nondup-sdp")) {
+                                               if (switch_true(val)) {
+                                                       profile->ndlb |= PFLAG_NDLB_ALLOW_NONDUP_SDP;
+                                               } else {
+                                                       profile->ndlb &= ~PFLAG_NDLB_ALLOW_NONDUP_SDP;
+                                               }
                                        } else if (!strcasecmp(var, "pass-rfc2833")) {
                                                if (switch_true(val)) {
                                                        sofia_set_pflag(profile, PFLAG_PASS_RFC2833);
@@ -5088,7 +5100,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
                        sdp_parser_t *parser;
                        sdp_session_t *sdp;
 
-                       if (!zstr(tech_pvt->remote_sdp_str) && !strcmp(tech_pvt->remote_sdp_str, r_sdp)) {
+                       if ((profile->ndlb & PFLAG_NDLB_ALLOW_NONDUP_SDP) || !zstr(tech_pvt->remote_sdp_str) && !strcmp(tech_pvt->remote_sdp_str, r_sdp)) {
                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Duplicate SDP\n%s\n", r_sdp);
                                is_dup_sdp = 1;
                        } else {