<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/6394">View Change</a></p><div style="white-space:pre-wrap">Approvals:
George Joseph: Looks good to me, but someone else must approve
Kevin Harwell: Looks good to me, approved
Jenkins2: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_session: Preserve stream name during renegotiation.<br><br>Stream names within Asterisk can have meaning so when an externally<br>initiated renegotiation occurs we need to preserve the name of<br>the stream if it already exists.<br><br>Change-Id: I29f50d0cc7f3238287d6d647777e76e1bdf8c596<br>---<br>M res/res_pjsip_session.c<br>1 file changed, 15 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c<br>index f6b3b93..7d0724d 100644<br>--- a/res/res_pjsip_session.c<br>+++ b/res/res_pjsip_session.c<br>@@ -588,7 +588,14 @@<br> stream = ast_stream_topology_get_stream(session->pending_media_state->topology, i);<br> }<br> if (!stream) {<br>- stream = ast_stream_alloc(ast_codec_media_type2str(type), type);<br>+ struct ast_stream *existing_stream = NULL;<br>+<br>+ if (session->active_media_state->topology &&<br>+ (i < ast_stream_topology_get_count(session->active_media_state->topology))) {<br>+ existing_stream = ast_stream_topology_get_stream(session->active_media_state->topology, i);<br>+ }<br>+<br>+ stream = ast_stream_alloc(existing_stream ? ast_stream_get_name(existing_stream) : ast_codec_media_type2str(type), type);<br> if (!stream) {<br> return -1;<br> }<br>@@ -1626,6 +1633,7 @@<br> char media[20];<br> struct ast_sip_session_sdp_handler *handler;<br> RAII_VAR(struct sdp_handler_list *, handler_list, NULL, ao2_cleanup);<br>+ struct ast_stream *existing_stream = NULL;<br> struct ast_stream *stream;<br> enum ast_media_type type;<br> struct ast_sip_session_media *session_media = NULL;<br>@@ -1634,8 +1642,13 @@<br> /* We need a null-terminated version of the media string */<br> ast_copy_pj_str(media, &sdp->media[i]->desc.media, sizeof(media));<br> <br>+ if (session->active_media_state->topology &&<br>+ (i < ast_stream_topology_get_count(session->active_media_state->topology))) {<br>+ existing_stream = ast_stream_topology_get_stream(session->active_media_state->topology, i);<br>+ }<br>+<br> type = ast_media_type_from_str(media);<br>- stream = ast_stream_alloc(ast_codec_media_type2str(type), type);<br>+ stream = ast_stream_alloc(existing_stream ? ast_stream_get_name(existing_stream) : ast_codec_media_type2str(type), type);<br> if (!stream) {<br> return -1;<br> }<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6394">change 6394</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/6394"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I29f50d0cc7f3238287d6d647777e76e1bdf8c596 </div>
<div style="display:none"> Gerrit-Change-Number: 6394 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>