diff options
author | Kinsey Moore <kmoore@digium.com> | 2014-08-07 15:30:19 +0000 |
---|---|---|
committer | Kinsey Moore <kmoore@digium.com> | 2014-08-07 15:30:19 +0000 |
commit | 0ac7f96057fb9fc0d012515f47bfea8d63eb5199 (patch) | |
tree | 8f807ace812c5d8d1cccb01b021ae050e975e550 /main/channel.c | |
parent | a8829490b6b9891b352e39f3846de1f274ca632c (diff) |
Stasis: Convey transfer information to applications
This fixes a class of issues where Stasis applications were not made
aware that their channels were being manipulated or replaced by
external entitiessuch as transfers, AMI commands, or dialplan
applications such as Bridge(). Inconsistent information such as
StasisEnd events with unknown channels as a result of masquerades has
also been corrected. To accomplish these fixes, several new fields
were added to blind and attended transfer messages as well as
StasisStart and BridgeAttendedTransfer Stasis events.
ASTERISK-23941 #close
Review: https://reviewboard.asterisk.org/r/3865/
Review: https://reviewboard.asterisk.org/r/3857/
Review: https://reviewboard.asterisk.org/r/3852/
Review: https://reviewboard.asterisk.org/r/3816/
Review: https://reviewboard.asterisk.org/r/3731/
Review: https://reviewboard.asterisk.org/r/3729/
Review: https://reviewboard.asterisk.org/r/3728/
........
Merged revisions 420325 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420338 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/channel.c')
-rw-r--r-- | main/channel.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/main/channel.c b/main/channel.c index 23799d9be..50b9e8726 100644 --- a/main/channel.c +++ b/main/channel.c @@ -6596,17 +6596,36 @@ static void channel_do_masquerade(struct ast_channel *original, struct ast_chann *ast_channel_hangup_handlers(original) = *ast_channel_hangup_handlers(clonechan); *ast_channel_hangup_handlers(clonechan) = exchange.handlers; - /* Move data stores over */ + /* Call fixup handlers for the clone chan */ if (AST_LIST_FIRST(ast_channel_datastores(clonechan))) { struct ast_datastore *ds; /* We use a safe traversal here because some fixup routines actually * remove the datastore from the list and free them. */ AST_LIST_TRAVERSE_SAFE_BEGIN(ast_channel_datastores(clonechan), ds, entry) { - if (ds->info->chan_fixup) + if (ds->info->chan_fixup) { ds->info->chan_fixup(ds->data, clonechan, original); + } + } + AST_LIST_TRAVERSE_SAFE_END; + } + + /* Call breakdown handlers for the original chan */ + if (AST_LIST_FIRST(ast_channel_datastores(original))) { + struct ast_datastore *ds; + /* We use a safe traversal here because some breakdown routines may + * remove the datastore from the list and free them. + */ + AST_LIST_TRAVERSE_SAFE_BEGIN(ast_channel_datastores(original), ds, entry) { + if (ds->info->chan_breakdown) { + ds->info->chan_breakdown(ds->data, clonechan, original); + } } AST_LIST_TRAVERSE_SAFE_END; + } + + /* Move data stores over */ + if (AST_LIST_FIRST(ast_channel_datastores(clonechan))) { AST_LIST_APPEND_LIST(ast_channel_datastores(original), ast_channel_datastores(clonechan), entry); } |