diff options
author | Richard Mudgett <rmudgett@digium.com> | 2012-01-21 00:23:13 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2012-01-21 00:23:13 +0000 |
commit | 20c6ff71b634e8c200dedec3781776d89fbf22a6 (patch) | |
tree | 026a5e27c578af054feb5363cdd6d589dbf52830 /main/app.c | |
parent | 02408a2476a8462fda158829b3b75df5a33d9dad (diff) |
Fix ast_app_dtget() time unit inconsistency.
Note: Noone calls ast_app_dtget() with the timeout parameter of zero so
the bad code normally will never get executed.
* Fix unnecessary floating point division in func_timeout.c
timeout_write() when all other values are integers.
(closes issue ASTERISK-16817)
Reported by: Dmitry Andrianov
........
Merged revisions 352029 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 352035 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352041 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/app.c')
-rw-r--r-- | main/app.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/main/app.c b/main/app.c index ca25964a5..c27f71341 100644 --- a/main/app.c +++ b/main/app.c @@ -108,7 +108,7 @@ static AST_RWLIST_HEAD_STATIC(groups, ast_group_info); * \param collect * \param size * \param maxlen - * \param timeout timeout in seconds + * \param timeout timeout in milliseconds * * \return 0 if extension does not exist, 1 if extension exists */ @@ -121,10 +121,12 @@ int ast_app_dtget(struct ast_channel *chan, const char *context, char *collect, maxlen = size; } - if (!timeout && chan->pbx) { - timeout = chan->pbx->dtimeoutms / 1000.0; - } else if (!timeout) { - timeout = 5; + if (!timeout) { + if (chan->pbx && chan->pbx->dtimeoutms) { + timeout = chan->pbx->dtimeoutms; + } else { + timeout = 5000; + } } if ((ts = ast_get_indication_tone(chan->zone, "dial"))) { |