<p>N A has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/19712">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">chan_iax2: Fix stalled jitterbuffer prior to receiving audio.<br><br>Currently, chan_iax2 only calls jb_get to read frames from<br>the jitterbuffer when the voiceformat has been set on the pvt.<br>However, this only happens when we receive a voice frame, which<br>means that prior to receiving voice frames, other types of frames<br>get stalled completely in the jitter buffer.<br><br>To fix this, we now fallback to using the format negotiated during<br>the call until we've actually received a voice frame with a format.<br>This ensures we're always able to read from the jitter buffer.<br><br>ASTERISK-30354 #close<br><br>Change-Id: Ie4fd1e8e088a145ad89e0427c2100a530e964fe9<br>---<br>M channels/chan_iax2.c<br>1 file changed, 27 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/12/19712/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c</span><br><span>index ab6bd61..0a637df 100644</span><br><span>--- a/channels/chan_iax2.c</span><br><span>+++ b/channels/chan_iax2.c</span><br><span>@@ -4160,6 +4160,12 @@</span><br><span> ms = ast_tvdiff_ms(now, pvt->rxcore);</span><br><span> </span><br><span> voicefmt = ast_format_compatibility_bitfield2format(pvt->voiceformat);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!voicefmt) {</span><br><span style="color: hsl(120, 100%, 40%);">+ /* pvt->voiceformat won't be set if we haven't received any voice frames yet.</span><br><span style="color: hsl(120, 100%, 40%);">+ * In this case, fall back to using the format negotiated during call setup,</span><br><span style="color: hsl(120, 100%, 40%);">+ * so we don't stall the jitterbuffer completely. */</span><br><span style="color: hsl(120, 100%, 40%);">+ voicefmt = ast_format_compatibility_bitfield2format(pvt->peerformat);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> if (voicefmt && ms >= (next = jb_next(pvt->jb))) {</span><br><span> ret = jb_get(pvt->jb, &frame, ms, ast_format_get_default_ms(voicefmt));</span><br><span> switch(ret) {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/19712">change 19712</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/c/asterisk/+/19712"/><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-Change-Id: Ie4fd1e8e088a145ad89e0427c2100a530e964fe9 </div>
<div style="display:none"> Gerrit-Change-Number: 19712 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: N A <asterisk@phreaknet.org> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>