Skip to content

Commit

Permalink
uac_registrant: add some sanity checks during module init
Browse files Browse the repository at this point in the history
(cherry picked from commit 2998f06)
  • Loading branch information
ovidiusas committed May 30, 2014
1 parent ec10686 commit 38089b7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions modules/uac_registrant/registrant.c
Expand Up @@ -174,6 +174,8 @@ struct module_exports exports= {
/** Module init function */
static int mod_init(void)
{
unsigned int _timer;

if(load_uac_auth_api(&uac_auth_api)<0){
LM_ERR("Failed to load uac_auth api\n");
return -1;
Expand Down Expand Up @@ -221,8 +223,13 @@ static int mod_init(void)
return -1;
}

register_timer("uac_reg_check", timer_check, 0,
timer_interval/reg_hsize);
_timer = timer_interval/reg_hsize;
if (_timer) {
register_timer("uac_reg_check", timer_check, 0, _timer);
} else {
LM_ERR("timer_interval=[%d] MUST be bigger then reg_hsize=[%d]\n", timer_interval, reg_hsize);
return -1;
}

return 0;
}
Expand Down

0 comments on commit 38089b7

Please sign in to comment.