[Asterisk-Dev] DECT channel

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Fri Dec 3 15:51:46 MST 2004


On Friday 03 December 2004 15:20, Chris Ostler wrote:
> 2) What is the best way to learn the required architecture for implementing
> an Asterisk channel.

In simplest terms, take a look at the ast_channel_register() function in the
various channels/chan_*.c files.  This function contains all the references to
make a functioning channel:

ast_channel_register(type, tdesc, capability, request), where:

- type is a string, the name of the channel
- tdesc is a string, a short description of the channel
- capability is a bitwise integer, describing the compatible codecs
- request is a function, specifying what to do (allocate, run, etc.) when
the channel is created and returns the corresponding ast_channel
structure.

All of the other related functions that the channel performs are located
in the chan->pvt structure.  See include/asterisk/channel_pvt.h and
include/asterisk/channel.h.  There are, of course, several other core
functions that need to be implemented in order for your module to load
correctly, e.g. load_module(), unload_module(), usecount(), key(), and
description().

One of the simplest channels to be found is chan_local, which you can
certainly use as a model of the most basic functions to implement in your
channel.  Other than that, you'll probably also want to look at chan_zap,
chan_modem_*, and chan_vpb, as these drivers all interface to hardware,
whereas chan_local, chan_sip, chan_iax2, and others of that ilk all are
interfaces to other software.

-- 
Tilghman



More information about the asterisk-dev mailing list