[asterisk-dev] [Code Review] 3362: func_beep: New function for periodic beeps.
Corey Farrell
reviewboard at asterisk.org
Sat Mar 15 14:58:54 CDT 2014
> On March 15, 2014, 2:46 p.m., Russell Bryant wrote:
> > 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 at dialplan_hooks)
> >
> > Does that sound better than the current BEEP()?
I like the idea. Do you plan to make it so only one PERIODIC_HOOK is allowed per channel or multiple?
- Corey
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3362/#review11230
-----------------------------------------------------------
On March 15, 2014, 2:15 p.m., Russell Bryant wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3362/
> -----------------------------------------------------------
>
> (Updated March 15, 2014, 2:15 p.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Repository: Asterisk
>
>
> Description
> -------
>
> 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.
>
>
> Diffs
> -----
>
> /trunk/funcs/func_beep.c PRE-CREATION
> /trunk/CHANGES 410649
>
> Diff: https://reviewboard.asterisk.org/r/3362/diff/
>
>
> Testing
> -------
>
> 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()
>
>
> Thanks,
>
> Russell Bryant
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140315/c3ae169a/attachment.html>
More information about the asterisk-dev
mailing list