Playing and recording an audio beep during MixMonitor

I am looking for a way (Asterisk 13) to play and record an audio beep every x seconds on a call to both parties to indicate the call is being recorded. I have identified 3 ways this can be done. However, none of them can satisfy the requirements I am looking for. Here are the requirements: Play a beep of a certain tone and volume every 15 seconds, without interrupting the phone conversation, and being able to hear the beep on the recording (proof we are playing a beep when recording).

Solution 1: use the B(x) option on MixMonitor. Issues: This will only play the BEEP sound file supplied by Asterisk. This sound file does not meet the legal specifications of the beep we need to play. This beep also can’t be heard when playing back the recording.

Solution 2: “L” option on Dial application. The only issue with this is that when the beep occurs, it cuts out the conversation. Of all solutions, this is the one we are currently doing, but I have been tasked to make it so it does not cut out the conversation during the play back of the beep.

Solution 3: Periodic_Hooks to play a beep on channels you specify. The beep can’t be heard when playing back the recording.

It seems like there are so many ways to solve this problem, but they all fall short.

Can anyone give any suggestions on a solution or enhancements to one of the solutions I mentioned? Or maybe some things to try with the above solutions I mentioned?


Using some combination of local channels and ChanSpy might work. For instance:

exten => 101,1,NoOp()
same => n,Dial(Local/orig)
same => n,Hangup()

exten => orig,1,NoOp()
same => n,Originate(Local/playback,exten,default,spy,1)
same => n,MixMonitor(/tmp/mixmonitor.wav)
same => n,Dial(PJSIP/101)
same => n,Hangup()

exten => playback,1,NoOp()
same => n,Playback(tt-monkeys)
same => n,Hangup()

exten => spy,1,NoOp()
same => n,ChanSpy(PJSIP,BEw)
same => n,Hangup()

Here 101 is being called. A local channel is used to originate another to start “spying” (whispering in this case), and playing back. Of course what you’d want to do is setup a loop in playback that plays your beep every 15 seconds. With this setup you might be able to use ChanSpy to even record. One thing I noticed in playing around with this example though was it took about 10 seconds for Asterisk to find the channel and start “spying”. Maybe someone knows a better way to do this?

Another option that would work is putting things into a ConfBridge. However, handling hangups gets awkward.

Lastly, if you can use ARI then you can put whatever channels into a bridge, and go from there.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.