diff options
author | citats <citats@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-04-02 07:47:23 +0000 |
---|---|---|
committer | citats <citats@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-04-02 07:47:23 +0000 |
commit | e22999aa42691e0901bdef577fadaa21f575fc4c (patch) | |
tree | fc14e920aaae211ff61825617cc489bab6296a2c /apps/app_dial.c | |
parent | ae864c9a6e21d2d2d7e6292197c276cb62601414 (diff) |
Make app_dial complain if the timeout passed is non numeric
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2601 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_dial.c')
-rwxr-xr-x | apps/app_dial.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c index 35221aa93..af3c70c6d 100755 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -668,9 +668,13 @@ static int dial_exec(struct ast_channel *chan, void *data) cur = rest; } while(cur); - if (timeout && strlen(timeout)) - to = atoi(timeout) * 1000; - else + if (timeout && strlen(timeout)) { + to = atoi(timeout); + if (to > 0) + to *= 1000; + else + ast_log(LOG_WARNING, "Invalid timeout specified: '%s'\n", timeout); + } else to = -1; peer = wait_for_answer(chan, outgoing, &to, &allowredir_in, &allowredir_out, &allowdisconnect); if (!peer) { |