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

David Bowerman david.bowerman at gmail.com
Wed Feb 7 18:23:43 MST 2007


russell, thanks

that makes a lot of sense.

the core driver would need to expose a couple of non-static functions
to enable registration and un-registration. is there any function
naming convention I should follow?

regards

dave


On 2/8/07, Russell Bryant <russell at digium.com> wrote:
> 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
> Software Engineer
> Digium, Inc.
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev
>


More information about the asterisk-dev mailing list