[asterisk-dev] chan_cellphone - Asterisk architecture question / discussion

Matthew Rubenstein email at mattruby.com
Wed Feb 7 18:18:26 MST 2007


	Please don't call it "chan_cellphone". Some of the devices that will
use it will be cell, others PCS, etc. Maybe "chan_mobile" or
"chan_radio", or "chan_X" where "X" describes generically the code
within, no matter the specific application of the devices linking to the
library.


On Wed, 2007-02-07 at 17:33 -0700, asterisk-dev-request at lists.digium.com
wrote:
> Date: Wed, 07 Feb 2007 18:08:42 -0600
> From: Russell Bryant <russell at digium.com>
> Subject: Re: [asterisk-dev] chan_cellphone - Asterisk architecture
>         question        /       discussion
> To: Asterisk Developers Mailing List <asterisk-dev at lists.digium.com>
> Message-ID: <45CA6A0A.6010308 at digium.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> David Bowerman wrote:
> > My question is, if I were to go down this track, how would you want
> > the abstraction module to be built in terms of the Asterisk
> > architecture?. Its not an app, and not a chan, so a res maybe ?
> > 
> > Asterisk <-> chan_cellphone <-> res_nokia | res_sony | res_xxx <->
> > bluetooth <->hardware
> > 
> > Any thoughts?
> 
> I would suggest doing something simpler than that.
> 
> 
> chan_cellphone.c --- The core channel driver
> 
> chan_cellphone_nokia.c --- The implementation of the nokia specific
> piece
> 
> chan_cellphone_sony.c -- sony specific piece ...
> 
> 
> Then, we can build chan_cellphone.so to comprise chan_cellphone.o as 
> well as chan_cellphone_*.o.
> 
> Then, for each phone specific component, you would need a way to 
> "register" it into the chan_cellphone core.  You could do the same
> thing 
> that Asterisk modules do when they get loaded.  We use constructors
> to 
> run the load_module() function so that the module doesn't have to
> care 
> whether it was getting dynamically loaded, or if it was just embedded 
> into the Asterisk executable.  So, you can use a constructor in each 
> sub-file that will register that phone specific implementation.
> 
> For more information on the constructor attribute, see the following 
> documentation on function attributes in general, as well as the 
> constructor attribute specifically:
> 
> http://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/Function-Attributes.html#Function-Attributes
> 
> -- 
> Russell Bryant 
-- 

(C) Matthew Rubenstein



More information about the asterisk-dev mailing list