]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add channel_originate event
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 16 Oct 2007 13:56:44 +0000 (13:56 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 16 Oct 2007 13:56:44 +0000 (13:56 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5886 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_types.h
src/switch_event.c
src/switch_ivr_originate.c

index 794e7b0c4219fef3b6539139012b459d1c4834e9..cb1fc6f86d6bf2058dd49a385aa97aa453481f79 100644 (file)
@@ -851,6 +851,7 @@ typedef enum {
        SWITCH_EVENT_CHANNEL_PARK               - A channel has been parked
        SWITCH_EVENT_CHANNEL_UNPARK     - A channel has been unparked
        SWITCH_EVENT_CHANNEL_APPLICATION- A channel has called and event from an application
+       SWITCH_EVENT_CHANNEL_ORIGINATE  - A channel has been originated
     SWITCH_EVENT_API                           - An API call has been executed
     SWITCH_EVENT_LOG                           - A LOG event has been triggered
     SWITCH_EVENT_INBOUND_CHAN          - A new inbound channel has been created
@@ -902,6 +903,7 @@ typedef enum {
        SWITCH_EVENT_CHANNEL_PARK,
        SWITCH_EVENT_CHANNEL_UNPARK,
        SWITCH_EVENT_CHANNEL_APPLICATION,
+       SWITCH_EVENT_CHANNEL_ORIGINATE,
        SWITCH_EVENT_API,
        SWITCH_EVENT_LOG,
        SWITCH_EVENT_INBOUND_CHAN,
index 04e297a72bc749a042b501327422f042f55481bc..2c5fe73a916bed0a4cfa07ef72c68fbefafd6962 100644 (file)
@@ -120,6 +120,7 @@ static char *EVENT_NAMES[] = {
        "CHANNEL_PARK",
        "CHANNEL_UNPARK",
        "CHANNEL_APPLICATION",
+       "CHANNEL_ORIGINATE",
        "API",
        "LOG",
        "INBOUND_CHAN",
index e6c65f4b95ff2505939017f6dac996dd5f98c580..dd6c6445a2fdf1967135e5d15857e6e83d6e3dad 100644 (file)
@@ -536,11 +536,16 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                                assert(peer_channels[i] != NULL);
 
                                if (var_event) {
+                                       switch_event_t *event;
                                        switch_event_header_t *header;
                                        /* install the vars from the {} params */
                                        for (header = var_event->headers; header; header = header->next) {
                                                switch_channel_set_variable(peer_channels[i], header->name, header->value);
                                        }
+                                       switch_event_create(&event, SWITCH_EVENT_CHANNEL_ORIGINATE);
+                                       assert(event);
+                                       switch_channel_event_set_data(peer_channels[i], event);
+                                       switch_event_fire(&event);
                                }
 
                                if (!table) {