[asterisk-dev] Help for developing a channel driver module

Joshua Colp jcolp at digium.com
Sun May 22 09:36:54 CDT 2016


Gilles Mazoyer wrote:
> Hi
>
> I'm developping a channel module to add support for telephony on modem
> HW553 running OpenWrt.
> My project is hosted on github https://github.com/pgid69/bcm63xx-phone.
> Today the channel seems to work but i'm not sure that it's very efficient.
> So I wanted to known if there is guideline for developping a channel module
> More specifically
> - does my channel module must provide a file descriptor to Asterisk,
> used in ast_waitfor() ?
> All channel modules but chan_local provide at least one file descriptor
> (calling ast_channel_set_fd());
> - should my channel pass audio data that it receives as fast as possible
> to Asterisk (using ast_queue_frame()) or should it wait that asterisk
> call the read callback ?

You can use either mechanism and which is right depends on the 
underlying channel driver. If you put a file descriptor on the channel 
then when there is data to be read your read callback will be called. If 
you don't then you have to queue up the frames.

-- 
Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org




More information about the asterisk-dev mailing list