[Asterisk-code-review] stasis: control->pbx is null (...asterisk[16])
Abhay Gupta
asteriskteam at digium.com
Tue Apr 30 09:25:40 CDT 2019
Abhay Gupta has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/11320
Change subject: stasis: control->pbx is null
......................................................................
stasis: control->pbx is null
When we get a incoming call on stasis which is not answered
put that in a bridge then control->pbx is null . In such a
case when bridge is deleted and it tried to impart the channel
it gives has a PBX thread and cannot be imparted into bridge
and hanging up the channel crashes asterisk.
ASTERISK-27756
Change-Id: Ideee69ff06c9a0b31f7ed61165f5c055f51d21b6
---
M res/stasis/control.c
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/20/11320/1
diff --git a/res/stasis/control.c b/res/stasis/control.c
index 866b58e..802fa03 100644
--- a/res/stasis/control.c
+++ b/res/stasis/control.c
@@ -1084,8 +1084,8 @@
static int depart_channel(struct stasis_app_control *control, struct ast_channel *chan)
{
ast_bridge_depart(chan);
-
- if (!ast_check_hangup(chan) && ast_channel_state(chan) != AST_STATE_UP) {
+ /* when a incoming channel is not answered and is put in bridge then control->pbx is null */
+ if (!ast_check_hangup(chan) && ast_channel_state(chan) != AST_STATE_UP && control->pbx != NULL) {
/* Channel is still being dialed, so put it back in the dialing bridge */
add_to_dial_bridge(control, chan);
}
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/11320
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: Ideee69ff06c9a0b31f7ed61165f5c055f51d21b6
Gerrit-Change-Number: 11320
Gerrit-PatchSet: 1
Gerrit-Owner: Abhay Gupta <abhay at avissol.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190430/47462d9f/attachment.html>
More information about the asterisk-code-review
mailing list