<p>Torrey Searle has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/8948">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res/res_rtp_asterisk: ensure marker bit is correctly set on ssrc change<br><br>ASTERISK-27845 #close<br><br>Certain race conditions between changing bridge types and DTMF can<br>cause the current FLAG_NEED_MARKER_BIT to send the marker bit before<br>the actual first packet of native bridging.<br><br>This logic keeps track of the ssrc the bridge is currently sending<br>and will correctly ensure the marker bit is set if SSRC as changed<br>from the previous sent packet<br><br>Change-Id: I01858bd0235f1e5e629e20de71b422b16f55759b<br>---<br>M res/res_rtp_asterisk.c<br>1 file changed, 13 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/48/8948/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 04e9fa5..350b293 100644<br>--- a/res/res_rtp_asterisk.c<br>+++ b/res/res_rtp_asterisk.c<br>@@ -38,6 +38,7 @@<br> <br> ASTERISK_FILE_VERSION(__FILE__, "$Revision$")<br> <br>+<br> #include <sys/time.h><br> #include <signal.h><br> #include <fcntl.h><br>@@ -5128,6 +5129,7 @@<br>       int res = 0, payload = 0, bridged_payload = 0, mark;<br>  RAII_VAR(struct ast_rtp_payload_type *, payload_type, NULL, ao2_cleanup);<br>     int reconstruct = ntohl(rtpheader[0]);<br>+       unsigned int ssrc = ntohl(rtpheader[2]);<br>      struct ast_sockaddr remote_address = { {0,} };<br>        int ice;<br>      unsigned int timestamp = ntohl(rtpheader[1]);<br>@@ -5234,6 +5236,17 @@<br>                 ast_clear_flag(bridged, FLAG_NEED_MARKER_BIT);<br>        }<br> <br>+ /*<br>+    * Check for this condition as increasing the lock duration we find marker bit may need setting<br>+       * for a changed SSRC<br>+         */<br>+  if(!mark && ssrc != bridged->ssrc) {<br>+              bridged->ssrc = ssrc;<br>+             mark = 1;<br>+            ast_debug(1, "Setting Marker bit for ssrc change\n");<br>+              ast_clear_flag(bridged, FLAG_NEED_MARKER_BIT);<br>+       }<br>+<br>  /* Reconstruct part of the packet */<br>  reconstruct &= 0xFF80FFFF;<br>        reconstruct |= (bridged_payload << 16);<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8948">change 8948</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/8948"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I01858bd0235f1e5e629e20de71b422b16f55759b </div>
<div style="display:none"> Gerrit-Change-Number: 8948 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Torrey Searle <tsearle@gmail.com> </div>