[Asterisk-code-review] pbx builtin: Properly handle hangup during Background (asterisk[master])
Sean Bright
asteriskteam at digium.com
Wed May 31 12:25:54 CDT 2017
Sean Bright has uploaded a new change for review. ( https://gerrit.asterisk.org/5748 )
Change subject: pbx_builtin: Properly handle hangup during Background
......................................................................
pbx_builtin: Properly handle hangup during Background
Before this patch, when a user hung up during a Background, we would
stuff 0xff into a char and attempt a dialplan lookup of it. This caused
problems for some realtime engines which interpreted the value as the
beginning of an invalid UTF-8 sequence.
ASTERISK-19291 #close
Reported by: Andrew Nowrot
Change-Id: I8ca6da93252d61c76ebdb46a4aa65e73ca985358
---
M main/pbx_builtins.c
1 file changed, 7 insertions(+), 1 deletion(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/48/5748/1
diff --git a/main/pbx_builtins.c b/main/pbx_builtins.c
index 20fdb4c..bc27b0d 100644
--- a/main/pbx_builtins.c
+++ b/main/pbx_builtins.c
@@ -1111,6 +1111,13 @@
}
}
+ /* 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 @@
* 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,
--
To view, visit https://gerrit.asterisk.org/5748
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8ca6da93252d61c76ebdb46a4aa65e73ca985358
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
More information about the asterisk-code-review
mailing list