summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins2 <jenkins2@gerrit.asterisk.org>2017-12-14 15:30:11 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-12-14 15:30:11 -0600
commitcff0f366867fda31fc689a7b76c9e8fe67080a35 (patch)
treed3b10664b57387d8831fcf3e93add9b0046f1c2c
parentc3e1f4f66be64d5d6df1fefb89c9277903c76712 (diff)
parent272594a70a4f4c6f522bd0e2135b405c2162d2dc (diff)
Merge "res_pjsip_session: Reinvite using active stream topology if none requested." into 15
-rw-r--r--res/res_pjsip_session.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c
index 55b91208a..958f2254b 100644
--- a/res/res_pjsip_session.c
+++ b/res/res_pjsip_session.c
@@ -3878,10 +3878,15 @@ static struct pjmedia_sdp_session *create_local_sdp(pjsip_inv_session *inv, stru
if (!session->pending_media_state->topology || !ast_stream_topology_get_count(session->pending_media_state->topology)) {
/* We've encountered a situation where we have been told to create a local SDP but noone has given us any indication
- * of what kind of stream topology they would like. As a fallback we use the topology from the configured endpoint.
+ * of what kind of stream topology they would like. We try to not alter the current state of the SDP negotiation
+ * by using what is currently negotiated. If this is unavailable we fall back to what is configured on the endpoint.
*/
ast_stream_topology_free(session->pending_media_state->topology);
- session->pending_media_state->topology = ast_stream_topology_clone(session->endpoint->media.topology);
+ if (session->active_media_state->topology) {
+ session->pending_media_state->topology = ast_stream_topology_clone(session->active_media_state->topology);
+ } else {
+ session->pending_media_state->topology = ast_stream_topology_clone(session->endpoint->media.topology);
+ }
if (!session->pending_media_state->topology) {
return NULL;
}