mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-03 03:02:15 +00:00
res_stasis: Expose event for call forwarding and follow forwarded channel.
This change adds an event for when an originated call is redirected to another target. This event contains the original channel and the newly created channel. If a stasis subscription exists on the original originated channel for a stasis application then a new subscription will also be created on the stasis application to the redirected channel. This allows the application to follow the call path completely. (closes issue ASTERISK-22719) Reported by: Joshua Colp Review: https://reviewboard.asterisk.org/r/3054/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@403808 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -422,14 +422,17 @@ static int handle_call_forward(struct ast_dial *dial, struct ast_dial_channel *c
|
||||
channel->device = ast_strdup(device);
|
||||
AST_LIST_UNLOCK(&dial->channels);
|
||||
|
||||
|
||||
/* Drop the original channel */
|
||||
ast_hangup(original);
|
||||
channel->owner = NULL;
|
||||
|
||||
/* Finally give it a go... send it out into the world */
|
||||
begin_dial_channel(channel, chan, chan ? 0 : 1);
|
||||
|
||||
ast_channel_publish_dial_forward(chan, original, channel->owner, NULL, "CANCEL",
|
||||
ast_channel_call_forward(original));
|
||||
|
||||
ast_hangup(original);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user