summaryrefslogtreecommitdiff
path: root/res/res_stasis.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2016-03-30 17:18:39 -0500
committerJoshua Colp <jcolp@digium.com>2016-04-05 18:14:17 -0500
commitabbb2edd4c897fc3ac8a3589c5b799ff53ed10d2 (patch)
tree331914612f6d23a58a720f008065256b90c96a99 /res/res_stasis.c
parentdd48d60c5ba239f76b054b1bb6c1e17c68537497 (diff)
ARI: Add method to Dial a created channel.
This adds a new ARI method that allows for you to dial a channel that you previously created in ARI. By combining this with the create method for channels, it allows for a workflow where a channel can be created, manipulated, and then dialed. The channel is under control of the ARI application during all stages of the Dial and can even be manipulated based on channel state changes observed within an ARI application. The overarching goal for this is to eventually be able to add a dialed channel to a Stasis bridge earlier than the "Up" state. However, at the moment more work is needed in the Dial and Bridge APIs in order to facilitate that. ASTERISK-25889 #close Change-Id: Ic6c399c791e66c4aa52454222fe4f8b02483a205
Diffstat (limited to 'res/res_stasis.c')
-rw-r--r--res/res_stasis.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/res/res_stasis.c b/res/res_stasis.c
index 63c565d44..02645f717 100644
--- a/res/res_stasis.c
+++ b/res/res_stasis.c
@@ -1282,6 +1282,7 @@ int stasis_app_exec(struct ast_channel *chan, const char *app_name, int argc,
int r;
int command_count;
RAII_VAR(struct ast_bridge *, last_bridge, NULL, ao2_cleanup);
+ struct ast_dial *dial;
/* Check to see if a bridge absorbed our hangup frame */
if (ast_check_hangup_locked(chan)) {
@@ -1291,6 +1292,7 @@ int stasis_app_exec(struct ast_channel *chan, const char *app_name, int argc,
last_bridge = bridge;
bridge = ao2_bump(stasis_app_get_bridge(control));
+ dial = stasis_app_get_dial(control);
if (bridge != last_bridge) {
app_unsubscribe_bridge(app, last_bridge);
@@ -1299,8 +1301,8 @@ int stasis_app_exec(struct ast_channel *chan, const char *app_name, int argc,
}
}
- if (bridge) {
- /* Bridge is handling channel frames */
+ if (bridge || dial) {
+ /* Bridge/dial is handling channel frames */
control_wait(control);
control_dispatch_all(control, chan);
continue;