<p>Joshua Colp has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/6328">View Change</a></p><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-2731<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;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/28/6328/1</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 0f4f6ab..ab80384 100644<br>--- a/res/res_rtp_asterisk.c<br>+++ b/res/res_rtp_asterisk.c<br>@@ -6173,10 +6173,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/6328">change 6328</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/6328"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I6e3703974f236bc024c5dbe9bd43adae0c6fb490 </div>
<div style="display:none"> Gerrit-Change-Number: 6328 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Joshua Colp <jcolp@digium.com> </div>