[asterisk-dev] build a module to add features

Jonathan Rose jrose at digium.com
Wed Mar 21 16:27:21 CDT 2012


----- Original Message -----
From: "Gustavo Villegas" <gustavovillega at gmail.com>
To: asterisk-dev at lists.digium.com
Sent: Wednesday, March 21, 2012 3:07:35 PM
Subject: [asterisk-dev] build a module to add features


> I take as example the add_on CDR. 
>
>
> if is not installed, the asterisk simply don't' record cdr 
> if is installed , automatically start recording CDR's into a DB 
>
>
> this is what i want, install the module and add features to asterisk, not to 
> recompile all again. 

I think you might be a little confused.  The only add-on module involving CDR is 
cdr_mysql, and it just logs CDR messages on a mysql database. It doesn't actually
control the recording of CDRs. The CDR engine itself is responsible for alerting
registered CDR logging methods of the need to log something, so it provides an API
for another module to subscribe/register for that purpose.

Generally, if a module isn't already designed to interface with other modules in
in this fashion, you will need to modify the original module to have some kind of
API to do so. A lot of this sort of thing is very context sensitive though, and
it's difficult to advice a particular way to do this for all cases.

Another example of modules getting behavior from other modules would be app.h
having functions installed to its voicemail functions by app_voicemail.so.
Really, you should probably just look at various stuff within Asterisk to get a
better idea of what to do in which circumstance.



More information about the asterisk-dev mailing list