summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins2 <jenkins2@gerrit.asterisk.org>2017-06-05 07:35:23 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-06-05 07:35:23 -0500
commitcee5b78be8246c81c591e7d9460b5ebc9f80750d (patch)
treef5a217e1b6f019f29c2d9092beb2f5b18704d2b2
parent174a9b5d993563a5c139401189218e6bc1c9277b (diff)
parent283cc59af746896a2b2bc23899fc86118895f7c0 (diff)
Merge "pbx_builtin: Properly handle hangup during Background" into 13
-rw-r--r--main/pbx_builtins.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/main/pbx_builtins.c b/main/pbx_builtins.c
index fa155888a..605e0c97e 100644
--- a/main/pbx_builtins.c
+++ b/main/pbx_builtins.c
@@ -1113,6 +1113,13 @@ static int pbx_builtin_background(struct ast_channel *chan, const char *data)
}
}
+ /* If ast_waitstream didn't give us back a digit, there is nothing else to do */
+ if (res <= 0) {
+ goto done;
+ }
+
+ exten[0] = res;
+
/*
* If the single digit DTMF is an extension in the specified context, then
* go there and signal no DTMF. Otherwise, we should exit with that DTMF.
@@ -1132,7 +1139,6 @@ static int pbx_builtin_background(struct ast_channel *chan, const char *data)
* be returned (see #16434).
*/
if (!ast_test_flag(ast_channel_flags(chan), AST_FLAG_DISABLE_WORKAROUNDS)
- && (exten[0] = res)
&& ast_canmatch_extension(chan, args.context, exten, 1,
S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))
&& !ast_matchmore_extension(chan, args.context, exten, 1,