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

This commit is contained in:
Anthony Minessale 2011-07-29 22:16:39 -05:00
parent f9612fecfe
commit 3f489a2a21
2 changed files with 15 additions and 2 deletions

View 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 {

View 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 {