summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--funcs/func_timeout.c4
-rw-r--r--main/app.c12
2 files changed, 9 insertions, 7 deletions
diff --git a/funcs/func_timeout.c b/funcs/func_timeout.c
index 53bbab753..d15e28f8d 100644
--- a/funcs/func_timeout.c
+++ b/funcs/func_timeout.c
@@ -171,7 +171,7 @@ static int timeout_write(struct ast_channel *chan, const char *cmd, char *data,
case 'r':
case 'R':
if (chan->pbx) {
- chan->pbx->rtimeoutms = when.tv_sec * 1000 + when.tv_usec / 1000.0;
+ chan->pbx->rtimeoutms = when.tv_sec * 1000 + when.tv_usec / 1000;
ast_verb(3, "Response timeout set to %.3f\n", chan->pbx->rtimeoutms / 1000.0);
}
break;
@@ -179,7 +179,7 @@ static int timeout_write(struct ast_channel *chan, const char *cmd, char *data,
case 'd':
case 'D':
if (chan->pbx) {
- chan->pbx->dtimeoutms = when.tv_sec * 1000 + when.tv_usec / 1000.0;
+ chan->pbx->dtimeoutms = when.tv_sec * 1000 + when.tv_usec / 1000;
ast_verb(3, "Digit timeout set to %.3f\n", chan->pbx->dtimeoutms / 1000.0);
}
break;
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"))) {