diff options
author | Steve Murphy <murf@digium.com> | 2006-10-05 01:40:06 +0000 |
---|---|---|
committer | Steve Murphy <murf@digium.com> | 2006-10-05 01:40:06 +0000 |
commit | 3d323f5345583c7d380d79d1773a5625f0b441d1 (patch) | |
tree | 77e3c1c2a0db4dee32e111ad819061f2b36f444b /apps/app_read.c | |
parent | 975ef9de9df8d751f11bc66f0b5f9781b76eaeb0 (diff) |
As per ToDo list, I have made it so that Wait(), WaitExten(), Congestion(), Busy(), Read(), WaitForRing(), will now either actually handle a floating point argument as advertised, or has been upgraded to accept a floating point [timeout] arg.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_read.c')
-rw-r--r-- | apps/app_read.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/app_read.c b/apps/app_read.c index bb3dd669b..5db886b03 100644 --- a/apps/app_read.c +++ b/apps/app_read.c @@ -77,8 +77,8 @@ static char *descrip = " 'n' to read digits even if the line is not up.\n" " attempts -- if greater than 1, that many attempts will be made in the \n" " event no data is entered.\n" -" timeout -- An integer number of seconds to wait for a digit response. If greater\n" -" than 0, that value will override the default timeout.\n\n" +" timeout -- The number of seconds to wait for a digit response. If greater\n" +" than 0, that value will override the default timeout. Can be floating point.\n\n" "Read should disconnect if the function fails or errors out.\n"; @@ -91,6 +91,7 @@ static int read_exec(struct ast_channel *chan, void *data) char tmp[256] = ""; int maxdigits = 255; int tries = 1, to = 0, x = 0; + double tosec; char *argcopy = NULL; struct tone_zone_sound *ts; struct ast_flags flags = {0}; @@ -126,11 +127,11 @@ static int read_exec(struct ast_channel *chan, void *data) } if (!ast_strlen_zero(arglist.timeout)) { - to = atoi(arglist.timeout); - if (to <= 0) + tosec = atof(arglist.timeout); + if (tosec <= 0) to = 0; else - to *= 1000; + to = tosec * 1000.0; } if (ast_strlen_zero(arglist.filename)) { |