diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.h b/src/mod/endpoints/mod_sofia/mod_sofia.h index 6540405..8c98249 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.h +++ b/src/mod/endpoints/mod_sofia/mod_sofia.h @@ -226,6 +226,7 @@ typedef enum { PFLAG_IN_DIALOG_CHAT, PFLAG_DEL_SUBS_ON_REG, PFLAG_IGNORE_183NOSDP, + PFLAG_REMOVE_183SDP, PFLAG_PRESENCE_PROBE_ON_REGISTER, PFLAG_PRESENCE_ON_REGISTER, PFLAG_PRESENCE_ON_FIRST_REGISTER, diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index be24a00..23e4b8f 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -2464,6 +2464,12 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile) } else { sofia_clear_pflag(profile, PFLAG_IGNORE_183NOSDP); } + } else if (!strcasecmp(var, "remove-183sdp")) { + if (switch_true(val)) { + sofia_set_pflag(profile, PFLAG_REMOVE_183SDP); + } else { + sofia_clear_pflag(profile, PFLAG_REMOVE_183SDP); + } } else if (!strcasecmp(var, "renegotiate-codec-on-hold")) { if (switch_true(val)) { sofia_set_pflag(profile, PFLAG_RENEG_ON_HOLD); @@ -3160,6 +3166,12 @@ switch_status_t config_sofia(int reload, char *profile_name) } else { sofia_clear_pflag(profile, PFLAG_IGNORE_183NOSDP); } + } else if (!strcasecmp(var, "remove-183sdp")) { + if (switch_true(val)) { + sofia_set_pflag(profile, PFLAG_REMOVE_183SDP); + } else { + sofia_clear_pflag(profile, PFLAG_REMOVE_183SDP); + } } else if (!strcasecmp(var, "renegotiate-codec-on-hold")) { if (switch_true(val)) { sofia_set_pflag(profile, PFLAG_RENEG_ON_HOLD); @@ -4809,6 +4821,14 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, status = 183; } + if (status == 183 && r_sdp) { + if ((channel && switch_true(switch_channel_get_variable(channel, "sip_remove_183sdp"))) || sofia_test_pflag(profile, PFLAG_REMOVE_183SDP)) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s Removing SDP from 183\n", channel ? switch_channel_get_name(channel) : "None"); + status = 180; + r_sdp = NULL; + } + } + if (channel && (status == 180 || status == 183) && switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND) { const char *val; if ((val = switch_channel_get_variable(channel, "sip_auto_answer")) && switch_true(val)) {