[asterisk-dev] [Code Review] IAX timer not loading

Kevin P. Fleming kpfleming at digium.com
Tue Jun 2 11:57:53 CDT 2009


Alec Davis wrote:
> I had similar thoughts regarding David's patch about other res_* modules
> depending on res_timing_*.
>  
> But wondered what the priority was regarding preload modules in
> modules.conf, which comes first, the David's patch loading all res_*
> or the preload modules in module.conf.
>  
> Or could it be made to work to our advantage:
>     1st.   preload res_* modules that specifically need to be loaded
> first and in order from modules.conf
>     2nd.  preload all other res_* using David's patch.

Ugh... rehashing old conversations :-)

I'd really like not to put any 'magic' in module file name if we can
avoid it; we had it before, it was not obvious to users what was going
on, and it did not solve very many problems (which is reason why we have
explicit 'load' statements in the sample modules.conf file now).

In addition, this will fail if anyone has a 'res' module that uses
timing resources, and we are right back in the same situation.

In essence, there are two (related) problems involved here: symbol
resolution and module initialization.

We've already attacked symbol resolution to some extent, by marking
modules that export symbols and those that don't, and loading all
symbol-exporting modules before non-exporting modules. It's not perfect,
but it seems to be working well enough.

Module initialization is another issue; without explicit dependencies
declared in modules, the loader cannot do things in the 'right' order.
I'll propose another alternative: let's follow the module most Linux
/etc/init.d startup processes use, and assign an (optional) 'init order'
value to modules. Then, the loader would load them all without actually
calling load_module() in any of them (in two phases, 'preload' and
'normal', just like now), and then call load_module() in each module in
order based on these 'order' values.

This would allow us to make res_timing_* modules have a *very* early
'init order' value, with all other modules default to a very late init
order. It would also be explicit in the module definition, and not based
on unrelated information (the module filename).

-- 
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
skype: kpfleming | jabber: kpfleming at digium.com
Check us out at www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list