I have a case where it would be useful to inject a beep into a channel. The specific case would be User A calls User B and their channels are bridged. When User A hang up, I want User B to hear a beep.
I have a global hangup-handler context that I use to finalize CDRs. Every time someone hangs up the channel is routed there. It seems this would probably be the place to do it, but I am unsure of exactly which combination of applications to use (Playback or Background in a new context that uses Whisper?) or if it’s even possible to use certain combinations of applications.
If anyone knows how to implement this kind of thing any advice would be much appreciated. Thanks.
h is run when you can no longer rely on any connection being up.
To do this you would need the reverse of the Dial g option. I believe something like that exists in the latest versions.
Ah, I forgot to mention that I am running 1.8.15.0.
Also, what is the benefit of using the “g” Dial option instead of dropping into a do-beep context in my global hangup handler context?
Also thanks for the reply.
I don’t know what your “global header hangup” context is. Is this something that is part of a GUI environment?
The reason you cannot use an h extension processor is that you cannot assume that either part is still connected to the PBX at that stage.
g runs on the calling channel, so is not directly usable for your case. However I seem to remember seeing an option to allow dialplan to continue on the called channel when the calling one hangs up.
Of course none of this is particularly natural to Asterisk.
Check F option of Dial application.
[quote]F([[context^]exten^]priority): When the caller hangs up, transfer
the called party to the specified destination and continue execution at
that location.
F: Proceed with dialplan execution at the next priority in the current
extension if the source channel hangs up.
[/quote]
wiki.asterisk.org/wiki/display/ … ation_Dial
–Satish Barot
satish4asterisk@gmail.com