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

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_rtp_asterisk: Allow remote SSRC to change on an RTP instance.<br><br>When SDP renegotiation occurs it is possible for an RTP<br>instance to be reused for a new stream, resulting in the remote<br>SSRC changing if it is part of a bundle group. This change<br>allows this and updates its mapping in the current bundle<br>group.<br><br>ASTERISK-27231<br><br>Change-Id: I6e3703974f236bc024c5dbe9bd43adae0c6fb490<br>---<br>M res/res_rtp_asterisk.c<br>1 file changed, 26 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c<br>index 65ab902..722e061 100644<br>--- a/res/res_rtp_asterisk.c<br>+++ b/res/res_rtp_asterisk.c<br>@@ -6141,10 +6141,35 @@<br> {<br>    struct ast_rtp *rtp = ast_rtp_instance_get_data(instance);<br> <br>-        if (rtp->themssrc) {<br>+      if (rtp->themssrc == ssrc) {<br>               return;<br>       }<br> <br>+ /* If this is bundled we need to update the SSRC mapping */<br>+  if (rtp->bundled) {<br>+               struct ast_rtp *bundled_rtp;<br>+         int index;<br>+<br>+                ao2_unlock(instance);<br>+<br>+             /* The child lock can't be held while accessing the parent */<br>+            ao2_lock(rtp->bundled);<br>+           bundled_rtp = ast_rtp_instance_get_data(rtp->bundled);<br>+<br>+         for (index = 0; index < AST_VECTOR_SIZE(&bundled_rtp->ssrc_mapping); ++index) {<br>+                    struct rtp_ssrc_mapping *mapping = AST_VECTOR_GET_ADDR(&bundled_rtp->ssrc_mapping, index);<br>+<br>+                 if (mapping->ssrc == rtp->themssrc) {<br>+                          mapping->ssrc = ssrc;<br>+                             break;<br>+                       }<br>+            }<br>+<br>+         ao2_unlock(rtp->bundled);<br>+<br>+              ao2_lock(instance);<br>+  }<br>+<br>  rtp->themssrc = ssrc;<br> }<br> <br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6329">change 6329</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/6329"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15.0 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I6e3703974f236bc024c5dbe9bd43adae0c6fb490 </div>
<div style="display:none"> Gerrit-Change-Number: 6329 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Matthew Fredrickson <creslin@digium.com> </div>