[asterisk-dev] [Code Review] Add 'optional API' support to eliminate need for registration of loadable APIs

Kevin Fleming kpfleming at digium.com
Wed Nov 19 07:58:14 CST 2008

This is an automatically generated e-mail. To reply, visit:

Review request for Asterisk Developers.


On systems where GCC provides both weak symbols and symbol aliases (pretty widely available), use a combination of them to provide automatically used (or avoided) stub functions for loadable APIs. This patch includes usage of this technique for ast_agi_register() only, but the technique could be used for all loadable APIs (res_musiconhold, res_adsi, res_odbc, etc).

This technique allows the consumer of the API to safely tell whether any module providing the API has been loaded or not, and then tailor its operation to take that result into account. For app_stack, this means it can optionally register its AGI command; for other modules that depend on the loadable API, they could issue an appropriate error message and safely exit when the loadable API is not present.


  /trunk/apps/app_stack.c 157747 
  /trunk/autoconf/ast_gcc_attribute.m4 157747 
  /trunk/configure.ac 157747 
  /trunk/contrib/asterisk-ng-doxygen 157747 
  /trunk/include/asterisk/agi.h 157747 
  /trunk/include/asterisk/autoconfig.h.in 157747 
  /trunk/res/res_agi.c 157747 

Diff: http://reviewboard.digium.com/r/62/diff


Compile testing



More information about the asterisk-dev mailing list