[Asterisk-code-review] ARI: Re-implement the ARI dial command, allowing for early b... (asterisk[master])

Mark Michelson asteriskteam at digium.com
Fri May 27 09:10:06 CDT 2016


Mark Michelson has uploaded a new patch set (#10).

Change subject: ARI: Re-implement the ARI dial command, allowing for early bridging.
......................................................................

ARI: Re-implement the ARI dial command, allowing for early bridging.

ARI dial had been implemented using the Dial API. This made great sense
when dialing was 100% separate from bridging. However, if a channel were
to be added to a bridge during the dial attempt, there would be a
conflict between the dialing thread and the bridging thread. Each would
be attempting to read frames from the dialed channel and act on them.

The initial attempt to make the two play nice was to have the Dial API
suspend the channel in the bridge and stay in charge of the channel
until the dial was complete. The problem with this was that it was
riddled with potential race conditions. It also was not well-suited for
the case where the channel changed which bridge it was in during the
dial.

This new approach removes the use of the Dial API altogether. Instead,
the channel we are dialing is placed into an invisible ARI dialing
bridge. The bridge channel thread handles incoming frames from the
channel. If the channel is added to a real bridge, it is departed from
the invisible bridge and then added to the real bridge. Similarly, if
the channel is removed from the real bridge, it is automatically added
back to the invisible bridge if the dial attempt is still active.

This approach keeps the threading simple by always having the channel
being handled by bridge channel threads.

ASTERISK-25925

Change-Id: I7750359ddf45fcd45eaec749c5b3822de4a8ddbb
---
M include/asterisk/stasis_app.h
M res/ari/resource_channels.c
M res/res_stasis.c
M res/stasis/control.c
4 files changed, 480 insertions(+), 106 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/90/2790/10
-- 
To view, visit https://gerrit.asterisk.org/2790
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I7750359ddf45fcd45eaec749c5b3822de4a8ddbb
Gerrit-PatchSet: 10
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list