<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://reviewboard.asterisk.org/r/3362/">https://reviewboard.asterisk.org/r/3362/</a>
     </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On March 15th, 2014, 2:46 p.m. EDT, <b>Russell Bryant</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">So, after talking to pabelanger about it, this could be a bit more generic without a lot of effort.  Right now it's hard coded to do a Playback(beep) into the call.  It could pretty easily changed to just be a periodic dialplan hook.  So you could have:

  [dialplan_hooks]

  exten => beep,1,Playback(beep)

  [something]

  ; Run the beep hook for this call every 30 seconds
  exten => foo,1,Set(PERIODIC_HOOK(30,beep@dialplan_hooks)

Does that sound better than the current BEEP()?</pre>
 </blockquote>







</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I like the idea.  Do you plan to make it so only one PERIODIC_HOOK is allowed per channel or multiple?</pre>
<br />










<p>- Corey</p>


<br />
<p>On March 15th, 2014, 2:15 p.m. EDT, Russell Bryant wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Asterisk Developers.</div>
<div>By Russell Bryant.</div>


<p style="color: grey;"><i>Updated March 15, 2014, 2:15 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
Asterisk
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">    This commit introduces a new dialplan function, BEEP().  It allows you
    to enable playing a beep tone at a regular interval into a call.  The
    most common use case for this is to use during call recording to
    notify and remind the callers that the call is being recorded.  A
    future commit will update the call recording applications in Asterisk
    to use this automatically if an option is specified for convenience.
    
    The implementation makes heavy use of existing Asterisk components.
    Instead of replicating logic required to load a sound file, transcode
    it if necessary, and do audio mixing, it makes use of
    Playback+ChanSpy to accomplish the task.
    
    The other important bit of the implementation is how it figures out
    when to trigger the beep playback.  This implementation uses the
    audiohook API, even though it's not actually touching the audio in any
    way.  It's a convenient way to get a callback and check if it's time
    to kick off another beep.  It would be nice if this was timer event
    based instead of polling based, but unfortunately I don't see a way to
    do it that won't interfere with other things.
</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Called the following extension, both letting it run all the way through, as well as hanging up at various points in the middle.

[test]

exten => 100,1,Answer()
   same => n,Set(BEEP(5)=on)
   same => n,Wait(20)
   same => n,Set(BEEP()=off)
   same => n,Wait(20)
   same => n,Hangup()
</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>/trunk/funcs/func_beep.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/CHANGES <span style="color: grey">(410649)</span></li>

</ul>

<p><a href="https://reviewboard.asterisk.org/r/3362/diff/" style="margin-left: 3em;">View Diff</a></p>







  </td>
 </tr>
</table>








  </div>
 </body>
</html>