FS-9060: [mod_sofia] correct issues with hold and broken soa negotiations after performing a bypass media reinvite

This commit is contained in:
Anthony Minessale
2016-04-15 19:35:00 -05:00
committed by Michael Jerris
parent d95d87ca07
commit 0a8e115b98
4 changed files with 39 additions and 17 deletions
+16 -16
View File
@@ -1510,10 +1510,13 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
switch_channel_clear_flag(tech_pvt->channel, CF_MEDIA_ACK);
switch_channel_set_flag(tech_pvt->channel, CF_REQ_MEDIA);
nua_invite(tech_pvt->nh, NUTAG_MEDIA_ENABLE(0),
sofia_glue_clear_soa(session, SWITCH_TRUE);
nua_invite(tech_pvt->nh,
NUTAG_MEDIA_ENABLE(0),
TAG_IF(msg->string_arg, SIPTAG_CONTENT_TYPE_STR("application/sdp")),
TAG_IF(msg->string_arg, SIPTAG_PAYLOAD_STR(msg->string_arg)),
SIPTAG_PAYLOAD_STR(msg->string_arg),
TAG_IF(!zstr(extra_headers), SIPTAG_HEADER_STR(extra_headers)), TAG_END());
switch_safe_free(extra_headers);
@@ -1523,10 +1526,13 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
{
char *extra_headers = sofia_glue_get_extra_headers(channel, SOFIA_SIP_HEADER_PREFIX);
sofia_clear_flag(tech_pvt, TFLAG_ENABLE_SOA);
switch_channel_clear_flag(tech_pvt->channel, CF_MEDIA_ACK);
switch_channel_clear_flag(tech_pvt->channel, CF_MEDIA_SET);
switch_channel_set_flag(tech_pvt->channel, CF_REQ_MEDIA);
sofia_glue_clear_soa(session, SWITCH_TRUE);
nua_invite(tech_pvt->nh, NUTAG_MEDIA_ENABLE(0), SIPTAG_PAYLOAD_STR(""),
TAG_IF(!zstr(extra_headers), SIPTAG_HEADER_STR(extra_headers)), TAG_END());
@@ -2078,19 +2084,13 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
switch_core_media_patch_sdp(tech_pvt->session);
switch_core_media_proxy_remote_addr(session, NULL);
}
if (sofia_use_soa(tech_pvt)) {
nua_respond(tech_pvt->nh, code, su_strdup(nua_handle_home(tech_pvt->nh), reason), SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
SOATAG_USER_SDP_STR(tech_pvt->mparams.local_sdp_str),
SOATAG_REUSE_REJECTED(1),
SOATAG_AUDIO_AUX("cn telephone-event"), NUTAG_INCLUDE_EXTRA_SDP(1),
TAG_IF(!zstr(extra_headers), SIPTAG_HEADER_STR(extra_headers)), TAG_END());
} else {
nua_respond(tech_pvt->nh, code, su_strdup(nua_handle_home(tech_pvt->nh), reason), SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
NUTAG_MEDIA_ENABLE(0),
SIPTAG_CONTENT_TYPE_STR("application/sdp"),
SIPTAG_PAYLOAD_STR(tech_pvt->mparams.local_sdp_str),
TAG_IF(!zstr(extra_headers), SIPTAG_HEADER_STR(extra_headers)), TAG_END());
}
nua_respond(tech_pvt->nh, code, su_strdup(nua_handle_home(tech_pvt->nh), reason), SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
NUTAG_MEDIA_ENABLE(0),
SIPTAG_CONTENT_TYPE_STR("application/sdp"),
SIPTAG_PAYLOAD_STR(tech_pvt->mparams.local_sdp_str),
TAG_IF(!zstr(extra_headers), SIPTAG_HEADER_STR(extra_headers)), TAG_END());
if (sofia_test_pflag(tech_pvt->profile, PFLAG_3PCC_PROXY) && sofia_test_flag(tech_pvt, TFLAG_3PCC)) {
/* Unlock the session signal to allow the ack to make it in */
// Maybe we should timeout?