<p>Torrey Searle has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/8988">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>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>ASTERISK-27845<br><br>Change-Id: I01858bd0235f1e5e629e20de71b422b16f55759b<br>---<br>M res/res_rtp_asterisk.c<br>1 file changed, 12 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/88/8988/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 5579914..e5f6b0a 100644<br>--- a/res/res_rtp_asterisk.c<br>+++ b/res/res_rtp_asterisk.c<br>@@ -5877,6 +5877,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>@@ -5984,6 +5985,17 @@<br> ast_clear_flag(bridged, FLAG_NEED_MARKER_BIT);<br> }<br> <br>+ /* While in the middle of a DTMF digit it is possible for the marker bit to get set on the<br>+ * DTMF packet, which carries the old SSRC. To combat this store the actual bridged SSRC and<br>+ * use it for packets even after the bridge is over. This way we can determine if the SSRC<br>+ * is different than we expect and set the marker bit.<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>+ }<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/8988">change 8988</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/8988"/><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: I01858bd0235f1e5e629e20de71b422b16f55759b </div>
<div style="display:none"> Gerrit-Change-Number: 8988 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Torrey Searle <tsearle@gmail.com> </div>