[Asterisk-code-review] app dial: Fix incorrect device state when channel is picked up. (asterisk[14])

Anonymous Coward asteriskteam at digium.com
Wed Nov 2 14:08:33 CDT 2016


Anonymous Coward #1000019 has submitted this change and it was merged. ( https://gerrit.asterisk.org/4279 )

Change subject: app_dial: Fix incorrect device state when channel is picked up.
......................................................................


app_dial: Fix incorrect device state when channel is picked up.

Given the scenario where multiple channels are dialed using Dial()
but the caller is picked up using PickupChan() all outgoing channels
except the channel specified to PickupChan() would be marked
as ringing until the call had been hung up.

When using the PickupChan application the channel executing the
application is swapped into place of another channel. As part
of this process the channel is answered. The Dial application
has explicit logic which checks if the channel is answered,
cancels all other outgoing channels, and bridges. This logic is
different than the normal logic that is executed when an outgoing
channel is answered. This different logic failed to publish dial
events stating that the other outgoing channels had been canceled.
As a result references to the outgoing channels were held onto by
the dial masquerade process until the call had been ended and
the channels had gone away. This would result in the channels
appearing in the "core show channels" list despite not being present
anymore and would also result in incorrect device state.

This change makes it so that this logic also publishes
dial events stating that the other outgoing channels have been
canceled.

ASTERISK-26549

Change-Id: Iea7168e6e82f7d4609ec0366153804e4f55ea64f
---
M apps/app_dial.c
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Mark Michelson: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Anonymous Coward #1000019: Verified



diff --git a/apps/app_dial.c b/apps/app_dial.c
index b5d8f50..c80caeb 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -1303,6 +1303,7 @@
 						}
 					}
 					peer = c;
+					publish_dial_end_event(in, out_chans, peer, "CANCEL");
 					ast_copy_flags64(peerflags, o,
 						OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
 						OPT_CALLEE_HANGUP | OPT_CALLER_HANGUP |

-- 
To view, visit https://gerrit.asterisk.org/4279
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iea7168e6e82f7d4609ec0366153804e4f55ea64f
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-code-review mailing list