<p>Joshua C. Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/10902">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Joshua C. Colp: Looks good to me, but someone else must approve; Approved for Submit
  Kevin Harwell: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">bridge_softmix: Use MSID:LABEL metadata as the cloned stream's appendix<br><br>To avoid the stream name collide if there're more than one video track<br>in one client. If client has multi video tracks, the name of ast_stream<br>which represents each video track may be the same. Use the MSID:LABEL<br>here because it's identifiable.<br><br>ASTERISK-28196 #close<br>Reported-by: xiemchen<br><br>Change-Id: Ib62b2886e8d3a30e481d94616b0ceaeab68a870b<br>---<br>M bridges/bridge_softmix.c<br>M res/res_pjsip_sdp_rtp.c<br>2 files changed, 17 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/bridges/bridge_softmix.c b/bridges/bridge_softmix.c</span><br><span>index cf61340..290ea2b 100644</span><br><span>--- a/bridges/bridge_softmix.c</span><br><span>+++ b/bridges/bridge_softmix.c</span><br><span>@@ -502,6 +502,7 @@</span><br><span>    const struct ast_stream_topology *source)</span><br><span> {</span><br><span>       int i;</span><br><span style="color: hsl(120, 100%, 40%);">+        const char *stream_identify;</span><br><span> </span><br><span>     for (i = 0; i < ast_stream_topology_get_count(source); ++i) {</span><br><span>             struct ast_stream *stream;</span><br><span>@@ -513,8 +514,13 @@</span><br><span>                    continue;</span><br><span>            }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+         stream_identify = ast_stream_get_metadata(stream, "MSID:LABEL");</span><br><span style="color: hsl(120, 100%, 40%);">+            if (!stream_identify) {</span><br><span style="color: hsl(120, 100%, 40%);">+                       stream_identify = ast_stream_get_name(stream);</span><br><span style="color: hsl(120, 100%, 40%);">+                }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>          if (ast_asprintf(&stream_clone_name, "%s_%s_%s", SOFTBRIDGE_VIDEO_DEST_PREFIX,</span><br><span style="color: hsl(0, 100%, 40%);">-                    channel_name, ast_stream_get_name(stream)) < 0) {</span><br><span style="color: hsl(120, 100%, 40%);">+                  channel_name, stream_identify) < 0) {</span><br><span>                     return -1;</span><br><span>           }</span><br><span> </span><br><span>@@ -2186,6 +2192,7 @@</span><br><span> </span><br><span>            for (i = 0; i < ast_stream_topology_get_count(topology); ++i) {</span><br><span>                   struct ast_stream *stream = ast_stream_topology_get_stream(topology, i);</span><br><span style="color: hsl(120, 100%, 40%);">+                      const char *stream_identify;</span><br><span> </span><br><span>                     if (is_video_source(stream)) {</span><br><span>                               AST_VECTOR_APPEND(&media_types, AST_MEDIA_TYPE_VIDEO);</span><br><span>@@ -2202,7 +2209,12 @@</span><br><span>                           */</span><br><span>                          ast_channel_unlock(participant->chan);</span><br><span>                            ast_bridge_channel_unlock(participant);</span><br><span style="color: hsl(0, 100%, 40%);">-                         map_source_to_destinations(ast_stream_get_name(stream), ast_channel_name(participant->chan),</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+                             stream_identify = ast_stream_get_metadata(stream, "MSID:LABEL");</span><br><span style="color: hsl(120, 100%, 40%);">+                            if (!stream_identify) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                       stream_identify = ast_stream_get_name(stream);</span><br><span style="color: hsl(120, 100%, 40%);">+                                }</span><br><span style="color: hsl(120, 100%, 40%);">+                             map_source_to_destinations(stream_identify, ast_channel_name(participant->chan),</span><br><span>                                  AST_VECTOR_SIZE(&media_types) - 1, &bridge->channels);</span><br><span>                            ast_bridge_channel_lock(participant);</span><br><span>                                ast_channel_lock(participant->chan);</span><br><span>diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c</span><br><span>index c18627e..c2b7d67 100644</span><br><span>--- a/res/res_pjsip_sdp_rtp.c</span><br><span>+++ b/res/res_pjsip_sdp_rtp.c</span><br><span>@@ -1157,7 +1157,9 @@</span><br><span>     }</span><br><span> </span><br><span>        if (ast_strlen_zero(session_media->label)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                 ast_uuid_generate_str(session_media->label, sizeof(session_media->label));</span><br><span style="color: hsl(120, 100%, 40%);">+              ast_uuid_generate_str(session_media->label, sizeof(session_media->label));</span><br><span style="color: hsl(120, 100%, 40%);">+              /* add for stream identification to replace stream_name */</span><br><span style="color: hsl(120, 100%, 40%);">+            ast_stream_set_metadata(stream, "MSID:LABEL", session_media->label);</span><br><span>    }</span><br><span> </span><br><span>        snprintf(msid, sizeof(msid), "%s %s", session_media->mslabel, session_media->label);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/10902">change 10902</a>. To unsubscribe, or for help writing mail filters, 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/10902"/><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: Ib62b2886e8d3a30e481d94616b0ceaeab68a870b </div>
<div style="display:none"> Gerrit-Change-Number: 10902 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Joshua C. Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation (1000185) </div>
<div style="display:none"> Gerrit-Reviewer: Joshua C. Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Xiemin Chen <chenxiemin@gmail.com> </div>