[Asterisk-code-review] stasis: Only place stasis created and dialed channels into dial bridge. (...asterisk[master])

Joshua Colp asteriskteam at digium.com
Fri May 3 10:50:38 CDT 2019


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/c/asterisk/+/11332 )

Change subject: stasis: Only place stasis created and dialed channels into dial bridge.
......................................................................

stasis: Only place stasis created and dialed channels into dial bridge.

The dial bridge is meant to hold channels which have been created
and dialed in stasis. It handles the frames coming from them and raises
the appropriate events.

It was possible for the code to mistakenly place calls which came
from the dialplan into the dial bridge if they were not in an
answered state. These channels are not outgoing channels and
should not be placed into the dial bridge.

The code now checks to ensure that only stasis created channels are
placed into the dial bridge by checking that a PBX does not exist
on the channel.

ASTERISK-27756

Change-Id: Ideee69ff06c9a0b31f7ed61165f5c055f51d21b6
---
M res/stasis/control.c
1 file changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve; Approved for Submit
  Kevin Harwell: Looks good to me, approved



diff --git a/res/stasis/control.c b/res/stasis/control.c
index e209a6a..6bac6e8 100644
--- a/res/stasis/control.c
+++ b/res/stasis/control.c
@@ -1070,7 +1070,11 @@
 {
 	ast_bridge_depart(chan);
 
-	if (!ast_check_hangup(chan) && ast_channel_state(chan) != AST_STATE_UP) {
+	/* Channels which have a PBX are not ones that have been created and dialed from ARI. They
+	 * have externally come in from the dialplan, and thus should not be placed into the dial
+	 * bridge. Only channels which are created and dialed in ARI should go into the dial bridge.
+	 */
+	if (!ast_check_hangup(chan) && ast_channel_state(chan) != AST_STATE_UP && !ast_channel_pbx(chan)) {
 		/* 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/+/11332
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Ideee69ff06c9a0b31f7ed61165f5c055f51d21b6
Gerrit-Change-Number: 11332
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Abhay Gupta <abhay at avissol.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190503/58dc7bc9/attachment-0001.html>


More information about the asterisk-code-review mailing list