diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index f54891ca16..afe6a44747 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -954,7 +954,16 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi TAG_IF(!switch_strlen_zero(max_forwards), SIPTAG_MAX_FORWARDS_STR(max_forwards)), TAG_END()); } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Responding with %d %s\n", code, reason); - nua_respond(tech_pvt->nh, code, reason, SIPTAG_CONTACT_STR(tech_pvt->reply_contact), TAG_END()); + + if (!switch_strlen_zero(((char *)msg->pointer_arg))) { + nua_respond(tech_pvt->nh, code, reason, SIPTAG_CONTACT_STR(tech_pvt->reply_contact), + SOATAG_USER_SDP_STR(msg->pointer_arg), + SOATAG_AUDIO_AUX("cn telephone-event"), + NUTAG_INCLUDE_EXTRA_SDP(1), + TAG_END()); + } else { + nua_respond(tech_pvt->nh, code, reason, SIPTAG_CONTACT_STR(tech_pvt->reply_contact), TAG_END()); + } } } diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 87d27a1c2c..110f98796a 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -1327,14 +1327,20 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status switch_clear_flag_locked(tech_pvt, TFLAG_SENT_UPDATE); if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) && (other_session = switch_core_session_locate(uuid))) { + const char *r_sdp = NULL; switch_core_session_message_t msg = { 0 }; - + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Passing %d %s to other leg\n", status, phrase); + tl_gets(tags, SOATAG_REMOTE_SDP_STR_REF(r_sdp), TAG_END()); msg.message_id = SWITCH_MESSAGE_INDICATE_RESPOND; msg.from = __FILE__; msg.numeric_arg = status; msg.string_arg = switch_core_session_strdup(other_session, phrase); + if (r_sdp) { + msg.pointer_arg = switch_core_session_strdup(other_session, r_sdp); + msg.pointer_arg_size = strlen(r_sdp); + } switch_core_session_receive_message(other_session, &msg); switch_core_session_rwunlock(other_session); }