Review Board 1.7.16


IAX timer not loading

Review Request #262 - Created May 28, 2009 and submitted

David Vossel
15191
Reviewers
asterisk-dev
Asterisk
When loading chan_iax2, a timer is opened.  If this timer fails to open trunk peers/users may not be built correctly.  Depending on the order Asterisk loads modules, the timer may or may not be loaded before chan_iax2.  If it is not loaded before hand, trunk peers/users will not be set up even though a timing interface may be possible.  This patch waits until Asterisk is fully booted to create the timer.  If the timer fails, all trunked peers/users' IAX_TRUNK flags are cleared and a warning message appears.
tested with and without loading the timer module. worked correctly.

Diff revision 4 (Latest)

1 2 3 4
1 2 3 4

  1. /trunk/include/asterisk/module.h: Loading...
  2. /trunk/main/loader.c: Loading...
  3. /trunk/res/res_timing_timerfd.c: Loading...
/trunk/include/asterisk/module.h
Revision 199276 New Change
[20] 186 lines
[+20] [+] struct ast_module_user_list;
187
 */
187
 */
188

    
   
188

   
189
enum ast_module_flags {
189
enum ast_module_flags {
190
	AST_MODFLAG_DEFAULT = 0,
190
	AST_MODFLAG_DEFAULT = 0,
191
	AST_MODFLAG_GLOBAL_SYMBOLS = (1 << 0),
191
	AST_MODFLAG_GLOBAL_SYMBOLS = (1 << 0),

    
   
192
	AST_MODFLAG_LOAD_ORDER = (1 << 1),
192
};
193
};
193

    
   
194

   
194
struct ast_module_info {
195
struct ast_module_info {
195

    
   
196

   
196
	/*!
197
	/*!
[+20] [20] 20 lines
[+20] struct ast_module_info {
217
	const char *key;
218
	const char *key;
218
	unsigned int flags;
219
	unsigned int flags;
219

    
   
220

   
220
	/*! The value of AST_BUILDOPT_SUM when this module was compiled */
221
	/*! The value of AST_BUILDOPT_SUM when this module was compiled */
221
	const char buildopt_sum[33];
222
	const char buildopt_sum[33];

    
   
223

   

    
   
224
	/*! This value represents the order in which a module's load() function is initialized.

    
   
225
	 *  The lower this value, the higher the priority.  The value is only checked if the

    
   
226
	 *  AST_MODFLAG_LOAD_ORDER flag is set.  If the AST_MODFLAG_LOAD_ORDER flag is not set,

    
   
227
	 *  this value will never be read and the module will be given the lowest possible priority

    
   
228
	 *  on load. */

    
   
229
	unsigned char load_pri;
222
};
230
};
223

    
   
231

   
224
void ast_module_register(const struct ast_module_info *);
232
void ast_module_register(const struct ast_module_info *);
225
void ast_module_unregister(const struct ast_module_info *);
233
void ast_module_unregister(const struct ast_module_info *);
226

    
   
234

   
[+20] [20] 212 lines
/trunk/main/loader.c
Revision 199276 New Change
 
/trunk/res/res_timing_timerfd.c
Revision 199276 New Change
 
  1. /trunk/include/asterisk/module.h: Loading...
  2. /trunk/main/loader.c: Loading...
  3. /trunk/res/res_timing_timerfd.c: Loading...

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.