[asterisk-dev] [Code Review] Add a new option "require" to modules.conf to make Asterisk fail if a module does not load

Olle E Johansson oej at edvina.net
Thu Nov 12 07:46:03 CST 2009


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/426/
-----------------------------------------------------------

Review request for Asterisk Developers.


Summary
-------

If a module for some reason fail to load - compiled with the wrong build system, failure to load required library or something else, then Asterisk currently proceeds, regardless of configuration in modules.conf.

This patch adds "require=<module>" and "preload-require=<module>" but not "noload-require <module>" :-)

If the module doesn't load, Asterisk will print a message to stderr and then exit with the status of 2, so that scripts like safe_asterisk and similar can catch this situation. I don't want my Asterisk to run without chan_sip - AT ALL, which is a reason for this patch.


Diffs
-----

  /trunk/configs/modules.conf.sample 229637 
  /trunk/main/asterisk.c 229637 
  /trunk/main/loader.c 229637 

Diff: https://reviewboard.asterisk.org/r/426/diff


Testing
-------

Tested with preload-require and require on my own development system and some old modules that gives strange load errors and fail to load.

Noticed that logging to ERROR doesn't always get logged, since Asterisk exits, so I added the fprintf(stderr,"....");


Thanks,

Olle E




More information about the asterisk-dev mailing list