add channel_originate event

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5886 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2007-10-16 13:56:44 +00:00
parent 9bb1534901
commit e5b16c4374
3 changed files with 8 additions and 0 deletions

View 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,

View File

@ -120,6 +120,7 @@ static char *EVENT_NAMES[] = {
"CHANNEL_PARK",
"CHANNEL_UNPARK",
"CHANNEL_APPLICATION",
"CHANNEL_ORIGINATE",
"API",
"LOG",
"INBOUND_CHAN",

View 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) {