[Asterisk-Dev] Adding a new channel

Holger Schurig hs4233 at mail.mn-solutions.de
Mon Dec 27 02:13:38 MST 2004


> hello all,
>
> i have been using asterisk for over a year now in our voip network.
> at the moment, we are using our SIP bridge to talk to asterisk however,
> we are interested in writing a channel what can directly work with our
> lightweight telephoney protocol
> (http://www.voip-info.org/tiki-index.php?page=LTP).
>
> can someone point me to the documents, headers of relevance? i
> understand that it requires developing a module. i also understand that
> multiple calls of a given protocol are handled by the same module
> instance.

Maybe you drop LTP and use IAX2 instead ...

But basically you should get the Asterisk Sourcecode via CVS and then 
search for the files that start with chan_*. Read some of them, look at 
the filesizes, you will then see which one is more simple.

I find http://cvs.sourceforge.net/viewcvs.py/chan-sccp/chan_sccp/ quite 
huge, but easy to read and understand.


Central to an asterisk channel is the load_module() function, which does 
usualy do many local setup things and then calls ast_channel_register(). 
Read include/asterisk/channel.h. Learn what the "requestor" is, search 
some of them, read them. Get some idea of "struct ast_channel" and how 
it's members are initialized and what they are doing, especially things 
like pvt->call, pvt->hangup, pvt->read, pvt->write. More on this in 
channel_pvt.h.

Later on you probably need to learn how to use struct ast_frame in frame.h 
and other things, but the above should get you going.



More information about the asterisk-dev mailing list