diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-05-01 23:06:23 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-05-01 23:06:23 +0000 |
commit | d1cc29c9c1c324a7421f220482d8cc4f321540ba (patch) | |
tree | 3df7d1e791a878179b45272be0b3f3cccf8eeee0 /main/app.c | |
parent | 995531248a14d3ac9e88ffc12836176688bb137e (diff) |
Modify TIMEOUT() to be accurate down to the millisecond.
(closes issue #10540)
Reported by: spendergrass
Patches:
20080417__bug10540.diff.txt uploaded by Corydon76 (license 14)
Tested by: blitzrage
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@115076 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/app.c')
-rw-r--r-- | main/app.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/main/app.c b/main/app.c index e5c712948..868f44dbd 100644 --- a/main/app.c +++ b/main/app.c @@ -72,7 +72,7 @@ int ast_app_dtget(struct ast_channel *chan, const char *context, char *collect, maxlen = size; if (!timeout && chan->pbx) - timeout = chan->pbx->dtimeout; + timeout = chan->pbx->dtimeoutms / 1000.0; else if (!timeout) timeout = 5; @@ -130,8 +130,8 @@ int ast_app_getdata(struct ast_channel *c, const char *prompt, char *s, int maxl } if (ast_strlen_zero(filename)) { /* set timeouts for the last prompt */ - fto = c->pbx ? c->pbx->rtimeout * 1000 : 6000; - to = c->pbx ? c->pbx->dtimeout * 1000 : 2000; + fto = c->pbx ? c->pbx->rtimeoutms : 6000; + to = c->pbx ? c->pbx->dtimeoutms : 2000; if (timeout > 0) fto = to = timeout; @@ -142,7 +142,7 @@ int ast_app_getdata(struct ast_channel *c, const char *prompt, char *s, int maxl get rid of the long timeout between prompts, and make it 50ms */ fto = 50; - to = c->pbx ? c->pbx->dtimeout * 1000 : 2000; + to = c->pbx ? c->pbx->dtimeoutms : 2000; } res = ast_readstring(c, s, maxlen, to, fto, "#"); if (!ast_strlen_zero(s)) @@ -1431,7 +1431,7 @@ static int ivr_dispatch(struct ast_channel *chan, struct ast_ivr_option *option, res = 0; return res; case AST_ACTION_WAITOPTION: - res = ast_waitfordigit(chan, 1000 * (chan->pbx ? chan->pbx->rtimeout : 10)); + res = ast_waitfordigit(chan, chan->pbx ? chan->pbx->rtimeoutms : 10000); if (!res) return 't'; return res; @@ -1484,7 +1484,7 @@ static int read_newoption(struct ast_channel *chan, struct ast_ivr_menu *menu, c int res = 0; int ms; while (option_matchmore(menu, exten)) { - ms = chan->pbx ? chan->pbx->dtimeout : 5000; + ms = chan->pbx ? chan->pbx->dtimeoutms : 5000; if (strlen(exten) >= maxexten - 1) break; res = ast_waitfordigit(chan, ms); |