mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-13 08:13:22 +00:00
fix timeout option
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5806 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -86,6 +86,7 @@ static int read_exec(struct ast_channel *chan, void *data)
|
|||||||
maxdigitstr = args[x++];
|
maxdigitstr = args[x++];
|
||||||
options = args[x++];
|
options = args[x++];
|
||||||
loops = args[x++];
|
loops = args[x++];
|
||||||
|
timeout = args[x++];
|
||||||
|
|
||||||
if (options) {
|
if (options) {
|
||||||
if (!strcasecmp(options, "skip"))
|
if (!strcasecmp(options, "skip"))
|
||||||
@@ -108,8 +109,10 @@ static int read_exec(struct ast_channel *chan, void *data)
|
|||||||
|
|
||||||
if(timeout) {
|
if(timeout) {
|
||||||
to = atoi(timeout);
|
to = atoi(timeout);
|
||||||
if(to <= 0)
|
if (to <= 0)
|
||||||
to = 0;
|
to = 0;
|
||||||
|
else
|
||||||
|
to *= 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(filename) || ast_strlen_zero(filename))
|
if (!(filename) || ast_strlen_zero(filename))
|
||||||
@@ -140,7 +143,7 @@ static int read_exec(struct ast_channel *chan, void *data)
|
|||||||
if (!res) {
|
if (!res) {
|
||||||
while(tries && !res) {
|
while(tries && !res) {
|
||||||
ast_stopstream(chan);
|
ast_stopstream(chan);
|
||||||
res = ast_app_getdata(chan, filename, tmp, maxdigits, 0);
|
res = ast_app_getdata(chan, filename, tmp, maxdigits, to);
|
||||||
if (res > -1) {
|
if (res > -1) {
|
||||||
pbx_builtin_setvar_helper(chan, varname, tmp);
|
pbx_builtin_setvar_helper(chan, varname, tmp);
|
||||||
if (!ast_strlen_zero(tmp)) {
|
if (!ast_strlen_zero(tmp)) {
|
||||||
|
Reference in New Issue
Block a user