diff options
author | Joshua Colp <jcolp@digium.com> | 2017-06-05 08:07:39 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-06-05 08:07:39 -0500 |
commit | 0d0b1730af9bca5462504d2b90c1eaa9c78535d5 (patch) | |
tree | 8aecf4566fea774279f5a9a3fc9be495da9e81e4 | |
parent | b3590c96025c7f12c2c8ed36dd9412c806aeb11e (diff) | |
parent | 001f4ddda43092d936980ebedcd9ea789e961cf5 (diff) |
Merge "pbx_builtin: Properly handle hangup during Background"
-rw-r--r-- | main/pbx_builtins.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/main/pbx_builtins.c b/main/pbx_builtins.c index 20fdb4c22..bc27b0d58 100644 --- a/main/pbx_builtins.c +++ b/main/pbx_builtins.c @@ -1111,6 +1111,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. @@ -1130,7 +1137,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, |