<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/6023">View Change</a></p><div style="white-space:pre-wrap">Approvals:
George Joseph: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved
Jenkins2: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res/res_stasis_snoop: generate silence when audiohook returns null<br><br>Currently when rtp is paused, no packets are written to the<br>recorded audio file, causing the silence to be skipped and recording<br>not properly time aligned. The read handler as been adapted to<br>return a silence frame of the correct size.<br><br>ASTERISK-27128 #close<br><br>Change-Id: I2d7f60650457860b9c70907b14426756b058a844<br>---<br>M res/res_stasis_snoop.c<br>1 file changed, 21 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/res/res_stasis_snoop.c b/res/res_stasis_snoop.c<br>index abdef6e..da66894 100644<br>--- a/res/res_stasis_snoop.c<br>+++ b/res/res_stasis_snoop.c<br>@@ -74,6 +74,8 @@<br> unsigned int whisper_active:1;<br> /*! \brief Uniqueid of the channel this snoop is snooping on */<br> char uniqueid[AST_MAX_UNIQUEID];<br>+ /*! \brief A frame of silence to use when the audiohook returns null */<br>+ struct ast_frame silence;<br> };<br> <br> /*! \brief Destructor for snoop structure */<br>@@ -91,6 +93,11 @@<br> <br> if (snoop->whisper_active) {<br> ast_audiohook_destroy(&snoop->whisper);<br>+ }<br>+<br>+ if (snoop->silence.data.ptr) {<br>+ ast_free(snoop->silence.data.ptr);<br>+ snoop->silence.data.ptr = NULL;<br> }<br> <br> ast_free(snoop->app);<br>@@ -199,7 +206,7 @@<br> frame = ast_audiohook_read_frame(&snoop->spy, snoop->spy_samples, snoop->spy_direction, snoop->spy_format);<br> ast_audiohook_unlock(&snoop->spy);<br> <br>- return frame ? frame : &ast_null_frame;<br>+ return frame ? frame : &snoop->silence;<br> }<br> <br> /*! \brief Callback function for hanging up a Snoop channel */<br>@@ -385,6 +392,19 @@<br> <br> snoop->spy_samples = ast_format_get_sample_rate(snoop->spy_format) / (1000 / SNOOP_INTERVAL);<br> snoop->spy_active = 1;<br>+<br>+ snoop->silence.frametype = AST_FRAME_VOICE,<br>+ snoop->silence.datalen = snoop->spy_samples * sizeof(uint16_t),<br>+ snoop->silence.samples = snoop->spy_samples,<br>+ snoop->silence.mallocd = 0,<br>+ snoop->silence.offset = 0,<br>+ snoop->silence.src = __PRETTY_FUNCTION__,<br>+ snoop->silence.subclass.format = snoop->spy_format,<br>+ snoop->silence.data.ptr = ast_calloc(snoop->spy_samples, sizeof(uint16_t));<br>+ if (!snoop->silence.data.ptr) {<br>+ ast_hangup(snoop->chan);<br>+ return NULL;<br>+ }<br> }<br> <br> /* If whispering is enabled set up the audiohook */<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6023">change 6023</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/6023"/><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: merged </div>
<div style="display:none"> Gerrit-Change-Id: I2d7f60650457860b9c70907b14426756b058a844 </div>
<div style="display:none"> Gerrit-Change-Number: 6023 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@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: Torrey Searle <tsearle@gmail.com> </div>