From e5b16c437455f3945df67bbd9196fc5e64bad8cf Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 16 Oct 2007 13:56:44 +0000 Subject: [PATCH] add channel_originate event git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5886 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/include/switch_types.h | 2 ++ src/switch_event.c | 1 + src/switch_ivr_originate.c | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/src/include/switch_types.h b/src/include/switch_types.h index 794e7b0c42..cb1fc6f86d 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -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, diff --git a/src/switch_event.c b/src/switch_event.c index 04e297a72b..2c5fe73a91 100644 --- a/src/switch_event.c +++ b/src/switch_event.c @@ -120,6 +120,7 @@ static char *EVENT_NAMES[] = { "CHANNEL_PARK", "CHANNEL_UNPARK", "CHANNEL_APPLICATION", + "CHANNEL_ORIGINATE", "API", "LOG", "INBOUND_CHAN", diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c index e6c65f4b95..dd6c6445a2 100644 --- a/src/switch_ivr_originate.c +++ b/src/switch_ivr_originate.c @@ -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) {