[asterisk-dev] Tracking Hold events

Kevin P. Fleming kpfleming at digium.com
Mon Jan 23 10:32:20 CST 2012


On 01/23/2012 10:21 AM, marcotasto at libero.it wrote:
> Hello List.
>
> I need to track when an agent in a call center presses the Hold button to
> place current caller on MOH (and revert back to a normal conversation).
> To do that I've found a solution I would like to share and discuss with all of
> you in the list.
>
> The idea is to write a specific function that uses audiohooks to read channel
> frames, and triggers a specific gosub in dialplan when MOH events are found.
> Audiohooks did not receive control frames; for that reason I've modified the
> channel.c in order to pass them to audiohook.
> I did something similar to what's done for the DTMF events and, in my test
> bench, all functions should now register to audiohook to listen control frames
> through a specific flag.
> I've tested on asterisk 10.0.1 and I'm able to write something on CLI logs
> when an agent presses the HOLD button on the phone (I've not yet implemented
> the part that triggers a gosub).

In Asterisk 1.8 and Asterisk 10 (and trunk, of course) there are 
'framehooks', which provide access to *all* frames being read or 
written. There is no reason to modify 'audiohooks', which are by 
definition specific to audio.

-- 
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
Jabber: kfleming at digium.com | SIP: kpfleming at digium.com | Skype: kpfleming
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list