diff options
author | root <root@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-09-21 17:01:53 +0000 |
---|---|---|
committer | root <root@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-09-21 17:01:53 +0000 |
commit | f299b4f1fcacf2953c914dc676b299fc3d27de0a (patch) | |
tree | 36cf7b4b9347b4b9135c9d350445abbf10e8247c /apps | |
parent | a79f85090a4d159b8652d06fc46f5ef24405cae9 (diff) |
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@43421 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_rpt.c | 95 |
1 files changed, 47 insertions, 48 deletions
diff --git a/apps/app_rpt.c b/apps/app_rpt.c index c8b10e44d..913baaba8 100644 --- a/apps/app_rpt.c +++ b/apps/app_rpt.c @@ -897,55 +897,54 @@ static int telem_lookup(struct ast_channel *chan, char *node, char *name) static int get_wait_interval(struct rpt *myrpt, int type) { - int interval; - char *wait_times; - char *wait_times_save; - - wait_times_save = NULL; - wait_times = ast_variable_retrieve(cfg, myrpt->name, "wait_times"); - - if(wait_times){ - wait_times_save = ast_strdupa(wait_times); - if(!wait_times_save){ - ast_log(LOG_WARNING, "Out of memory in wait_interval()\n"); - wait_times = NULL; - } - } - - switch(type){ - case DLY_TELEM: - if(wait_times) - interval = retrieve_astcfgint(wait_times_save, "telemwait", 500, 5000, 1000); - else - interval = 1000; - break; - - case DLY_ID: - if(wait_times) - interval = retrieve_astcfgint(wait_times_save, "idwait",250,5000,500); - else - interval = 500; - break; - - case DLY_UNKEY: - if(wait_times) - interval = retrieve_astcfgint(wait_times_save, "unkeywait",500,5000,1000); - else - interval = 1000; - break; - - case DLY_CALLTERM: - if(wait_times) - interval = retrieve_astcfgint(wait_times_save, "calltermwait",500,5000,1500); - else - interval = 1500; - break; - - default: - return 0; - } + int interval; + char *wait_times; + char *wait_times_save = NULL; + + wait_times = ast_variable_retrieve(cfg, myrpt->name, "wait_times"); + + if (wait_times) { + wait_times_save = ast_strdupa(wait_times); + if (!wait_times_save) { + ast_log(LOG_WARNING, "Out of memory in wait_interval()\n"); + wait_times = NULL; + } + } + + switch (type) { + case DLY_TELEM: + if (wait_times) + interval = retrieve_astcfgint(wait_times_save, "telemwait", 500, 5000, 1000); + else + interval = 1000; + break; + + case DLY_ID: + if (wait_times) + interval = retrieve_astcfgint(wait_times_save, "idwait", 250, 5000, 500); + else + interval = 500; + break; + + case DLY_UNKEY: + if (wait_times) + interval = retrieve_astcfgint(wait_times_save, "unkeywait", 500, 5000, 1000); + else + interval = 1000; + break; + + case DLY_CALLTERM: + if (wait_times) + interval = retrieve_astcfgint(wait_times_save, "calltermwait", 500, 5000, 1500); + else + interval = 1500; + break; + + default: + return 0; + } return interval; -} +} /* |