From 3f489a2a2104f9c5520969f43f0bee8086b89510 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 29 Jul 2011 22:16:39 -0500 Subject: [PATCH] add NDLB-allow-nondup-sdp to indicate you want to parse a differnt sdp in 200 ok from 1xx (previous default) this is a RFC violation so I decided not to support it by default anymore. Enable this if you want that broken behaviour --- src/mod/endpoints/mod_sofia/mod_sofia.h | 3 ++- src/mod/endpoints/mod_sofia/sofia.c | 14 +++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.h b/src/mod/endpoints/mod_sofia/mod_sofia.h index 466597af1a..795c7b5e59 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.h +++ b/src/mod/endpoints/mod_sofia/mod_sofia.h @@ -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 { diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index e3f0563796..cfe9335211 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -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 {