[Asterisk-Dev] Module that works in Asterisk 1.0.x and 1.2.x

Juan Jose Comellas juanjo at comellas.com.ar
Thu Nov 17 09:09:25 MST 2005


Thanks for the tip. I checked it but it is much more complex than what I
need. I finally resorted to checking for the presence of some headers to
detect the version and set a define that I use in my source files.

Asterisk should really have some kind of facility for version checking.
I don't think I'm the only one that's developing modules for both
"production" versions of Asterisk right now.


Chris Wade wrote:
> Juan Jose Comellas wrote:
> 
>> I have written several Asterisk modules that need to work both with
>> Asterisk 1.0.x and Asterisk 1.2.x. To do this, the easiest way would be
>> to find a macro that I could use for conditional compilation. I thought
>> of using ASTERISK_VERSION_NUM from version.h but this file is not
>> included in the Asterisk 1.0.x headers.
>>
>> Does anybody have a better idea or will I have to pass a parameter
>> indicating the Asterisk version to my build scripts?
> 
> 
> Assuming Sergio doesn't mind you 'borrowing' his ideas, check out the
> create_config.sh script in the latest distribution of chan_sccp
> available on chan_sccp.berlios.de.  It auto-detects a bunch of various
> bits from 1.2.x vs 1.0.x.
> 





More information about the asterisk-dev mailing list