1） a channel reads a configuration file on startup which tells it
something about the hardware it’s going to be servicing.
2）it launches a thread which monitors all the idle channels (See the chan_modem or the chan_ixj for an example of this).
3）a “RING” or equivalent is detected, the monitoring thread should allocate a channel structure and assign all the callbacks to it (see ixj_new, for example),
4）call ast_pbx_start on that channel. ast_pbx_start will launch a new thread to handle the channel as long as the call is up, so once pbx_start has
successfully been run, the monitor should no longer monitor that channel.
5） The PBX thread will use the channel, reading, writing, calling, etc., and
multiplexing that channel with others using select() on the channel’s
file descriptor (if your channel doesn’t have an associated file
descriptor, you’ll need to emulate one somehow, perhaps along the lines of
what the translator API does with its channel.
6） the PBX is finished with the line, it will hang up the line, at which
point it the hardware should again be monitored by the monitoring thread.