[asterisk-dev] [Code Review] Calendaring API for Asterisk

Kevin P. Fleming kpfleming at digium.com
Thu Nov 13 05:08:52 CST 2008


Terry Wilson wrote:

> Most of it already is modules (res_icalendar, res_caldav, and  
> res_exchangecal).  You could hack around and check if the main  
> calendar module was loaded in each of the technology modules, then  
> load the module from those modules if it wasn't loaded (2nd way I  
> designed it).  But that is an uglier solution in my mind.  I really  
> hate the idea of loadable modules depending on each other--it just  
> feels dirty to me.  If asterisk had a mechanism for enforcing a  
> particular load order with modules specifying what their dependencies  
> were, etc. then it wouldn't be too bad.  Unfortunately, when you go  
> down that rabbit hole you have to deal with graphs and loops and it is  
> probably much more trouble than it is worth.

Actually, we already have the infrastructure you need for this. If
res_icalendar, res_caldav and res_exchangecal don't export symbols, then
res_calendar (which would export the registration methods) will always
be loaded prior to them by the loader in any automatic loading scenario.
The only way this would break would be if the modules.conf file
explicitly loaded one of them *before* res_calendar, and you can use the
technique I just put into agi.h/app_stack.c to deal with that situation
and report a suitable error. I would not recommend that any automatic
module loading occur; if the administrator has misconfigured
modules.conf in this way, he should get an error and be forced to fix it.

-- 
Kevin P. Fleming
Director of Software Technologies
Digium, Inc. - "The Genuine Asterisk Experience" (TM)



More information about the asterisk-dev mailing list