[asterisk-dev] Help to catch media immediately after channel being answered

Russell Bryant russell at digium.com
Wed Jun 1 12:59:47 CDT 2011


On 06/01/2011 03:23 AM, Yaroslav Panych wrote:
> 2011/5/31 Russell Bryant <russell at digium.com>:
>>
>> There are a couple of hook APIs that can be used for this.
>>
>> to hook into audio frames:
>>    include/asterisk/audiohook.h
>>    example usage: funcs/func_volume.c
>>
>> to hook into _all_ frames (1.8 and up):
>>    include/asterisk/framehook.h
>>    no example usage yet (it's being used for T.38 Gateway support)
>>
> 
> Tanks, I think it is exactly what I need. And derived question - how
> to create framehook for all channels(including newly created in
> future). But for now it is enough for me to create framehook in
> dialplan manually.

It's up to you.  It's a C API.  Dialplan functions tend to be the way we
write interfaces to add a hook to a channel.  If you do it as a dialplan
function, you can do it from the dialplan, or just from the config file.
 For example, in sip.conf:

[myphone]
...
setvar=MY_HOOK()=on

Then all channels created for SIP/myphone will have that hook.

-- 
Russell Bryant
Digium, Inc.   |   Engineering Manager, Open Source Software
445 Jan Davis Drive NW    -     Huntsville, AL 35806  -  USA
www.digium.com  -=-  www.asterisk.org -=- blogs.asterisk.org



More information about the asterisk-dev mailing list