Send a manager event when the manager BridgeAction command is used.
authorMark Michelson <mmichelson@digium.com>
Fri, 26 Feb 2010 17:13:36 +0000 (17:13 +0000)
committerMark Michelson <mmichelson@digium.com>
Fri, 26 Feb 2010 17:13:36 +0000 (17:13 +0000)
(closes issue #16769)
Reported by: syspert
Patches:
      bridgeaction.patch uploaded by syspert (license 938)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@249105 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/features.c

index 1c52184..2baf793 100644 (file)
@@ -4534,7 +4534,7 @@ static int action_bridge(struct mansession *s, const struct message *m)
        const char *channela = astman_get_header(m, "Channel1");
        const char *channelb = astman_get_header(m, "Channel2");
        const char *playtone = astman_get_header(m, "Tone");
-       struct ast_channel *chana = NULL, *chanb = NULL;
+       struct ast_channel *chana = NULL, *chanb = NULL, *chans[2];
        struct ast_channel *tmpchana = NULL, *tmpchanb = NULL;
        struct ast_bridge_thread_obj *tobj = NULL;
 
@@ -4628,6 +4628,14 @@ static int action_bridge(struct mansession *s, const struct message *m)
                }
        }
 
+       chans[0] = tmpchana;
+       chans[1] = tmpchanb;
+
+       ast_manager_event_multichan(EVENT_FLAG_CALL, "BridgeAction", 2, chans,
+                               "Response: Success\r\n"
+                               "Channel1: %s\r\n"
+                               "Channel2: %s\r\n", tmpchana->name, tmpchanb->name);
+
        bridge_call_thread_launch(tobj);
 
        astman_send_ack(s, m, "Launched bridge thread with success");