summaryrefslogtreecommitdiff
path: root/res/res_pjsip_sdp_rtp.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2015-01-27 17:34:37 +0000
committerJoshua Colp <jcolp@digium.com>2015-01-27 17:34:37 +0000
commita43d24a9d3d61274e6b7b8cf594af0d802c100b7 (patch)
tree15b7e72afbfaf7bb1e6769944e3c083a0d2779c7 /res/res_pjsip_sdp_rtp.c
parentfb8a2e039978b264737aa7a4ed08f9af4c329f47 (diff)
bridge / res_pjsip_sdp_rtp: Fix issues with media not being reinvited during direct media.
This change fixes two issues: 1. During a swap operation bridging added the new channel before having the swap channel leave. This was not handled in bridge_native_rtp and could result in a channel not getting reinvited back to Asterisk. After this change the swap channel will leave first and the new channel will then join. 2. If a re-invite was received after a session had been established any upstream elements (such as bridge_native_rtp) were not notified that they may want to re-evaluate things. After this change an UPDATE_RTP_PEER control frame is queued when this situation occurs and upstream can react. AST-1524 #close Review: https://reviewboard.asterisk.org/r/4378/ ........ Merged revisions 431157 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip_sdp_rtp.c')
-rw-r--r--res/res_pjsip_sdp_rtp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c
index 4077caad3..a3ccd19d4 100644
--- a/res/res_pjsip_sdp_rtp.c
+++ b/res/res_pjsip_sdp_rtp.c
@@ -1180,6 +1180,10 @@ static int apply_negotiated_sdp_stream(struct ast_sip_session *session, struct a
/* audio stream handles music on hold */
if (media_type != AST_MEDIA_TYPE_AUDIO) {
+ if ((pjmedia_sdp_neg_was_answer_remote(session->inv_session->neg) == PJ_FALSE)
+ && (session->inv_session->state == PJSIP_INV_STATE_CONFIRMED)) {
+ ast_queue_control(session->channel, AST_CONTROL_UPDATE_RTP_PEER);
+ }
return 1;
}
@@ -1199,6 +1203,9 @@ static int apply_negotiated_sdp_stream(struct ast_sip_session *session, struct a
ast_queue_unhold(session->channel);
ast_queue_frame(session->channel, &ast_null_frame);
session_media->remotely_held = 0;
+ } else if ((pjmedia_sdp_neg_was_answer_remote(session->inv_session->neg) == PJ_FALSE)
+ && (session->inv_session->state == PJSIP_INV_STATE_CONFIRMED)) {
+ ast_queue_control(session->channel, AST_CONTROL_UPDATE_RTP_PEER);
}
/* This purposely resets the encryption to the configured in case it gets added later */