diff options
author | Joshua Colp <jcolp@digium.com> | 2017-09-21 14:59:52 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-09-21 14:59:52 -0500 |
commit | 1fd68fb253abee753c58d751f0f89082288facdc (patch) | |
tree | 4177291496994cd7a2323fa56b2961899c18b0d5 /res/res_pjsip_session.c | |
parent | 95cb45cfc8027a57d19a9fa3df3a05a2dcc56197 (diff) | |
parent | 693c06f8a3d668289ef0178647ef67c6a24d664c (diff) |
Merge "bridge: Change participant SFU streams when source streams change." into 15
Diffstat (limited to 'res/res_pjsip_session.c')
-rw-r--r-- | res/res_pjsip_session.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c index 77ddfbc14..163c2b868 100644 --- a/res/res_pjsip_session.c +++ b/res/res_pjsip_session.c @@ -765,6 +765,7 @@ static int handle_negotiated_sdp(struct ast_sip_session *session, const pjmedia_ { int i; struct ast_stream_topology *topology; + unsigned int changed = 0; for (i = 0; i < local->media_count; ++i) { struct ast_sip_session_media *session_media; @@ -802,6 +803,9 @@ static int handle_negotiated_sdp(struct ast_sip_session *session, const pjmedia_ if (handle_negotiated_sdp_session_media(session_media, session, local, remote, i, stream)) { return -1; } + + changed |= session_media->changed; + session_media->changed = 0; } /* Apply the pending media state to the channel and make it active */ @@ -858,7 +862,13 @@ static int handle_negotiated_sdp(struct ast_sip_session *session, const pjmedia_ ast_channel_unlock(session->channel); - ast_queue_frame(session->channel, &ast_null_frame); + if (changed) { + struct ast_frame f = { AST_FRAME_CONTROL, .subclass.integer = AST_CONTROL_STREAM_TOPOLOGY_SOURCE_CHANGED }; + + ast_queue_frame(session->channel, &f); + } else { + ast_queue_frame(session->channel, &ast_null_frame); + } return 0; } |