summaryrefslogtreecommitdiff
path: root/main/stasis_bridges.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2013-08-02 14:13:04 +0000
committerMark Michelson <mmichelson@digium.com>2013-08-02 14:13:04 +0000
commit328e99f41d48d8f15832bf4f6c97beb0ef71fc0c (patch)
treec79646508e9ae44a0728fa38832ae112d02ece45 /main/stasis_bridges.c
parent41d6be2432a77cf9da5dbb3f0590a74340a2c54e (diff)
Make a couple of changes to help AMI events to be more clear in what is occurring.
* BridgeEnter now contains the unique ID of the channel that is to be swapped out, if applicable. * There is a ParkedCallSwap event that is sent when a parked channel has a new channel take its place. (closes issue ASTERISK-22193) reported by Mark Michelson Review: https://reviewboard.asterisk.org/r/2712 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396107 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/stasis_bridges.c')
-rw-r--r--main/stasis_bridges.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/main/stasis_bridges.c b/main/stasis_bridges.c
index 251f9d7af..a3eeef675 100644
--- a/main/stasis_bridges.c
+++ b/main/stasis_bridges.c
@@ -380,11 +380,20 @@ struct stasis_message *ast_bridge_blob_create(
return msg;
}
-void ast_bridge_publish_enter(struct ast_bridge *bridge, struct ast_channel *chan)
+void ast_bridge_publish_enter(struct ast_bridge *bridge, struct ast_channel *chan,
+ struct ast_channel *swap)
{
RAII_VAR(struct stasis_message *, msg, NULL, ao2_cleanup);
+ RAII_VAR(struct ast_json *, blob, NULL, ao2_cleanup);
- msg = ast_bridge_blob_create(ast_channel_entered_bridge_type(), bridge, chan, NULL);
+ if (swap) {
+ blob = ast_json_pack("{s: s}", "swap", ast_channel_uniqueid(swap));
+ if (!blob) {
+ return;
+ }
+ }
+
+ msg = ast_bridge_blob_create(ast_channel_entered_bridge_type(), bridge, chan, blob);
if (!msg) {
return;
}