From 5e4396a46eb3c6b6f29755f07d9e0fef1d8b26de Mon Sep 17 00:00:00 2001 From: Brian West Date: Mon, 19 Feb 2007 21:06:27 +0000 Subject: [PATCH] making private events fire (please test) git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4327 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/include/switch_types.h | 2 ++ src/switch_core.c | 1 + src/switch_event.c | 1 + src/switch_ivr.c | 3 ++- 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/include/switch_types.h b/src/include/switch_types.h index d3799cf719..3ca52b0b1a 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -746,6 +746,7 @@ typedef enum { SWITCH_EVENT_CODEC - Codec Change SWITCH_EVENT_BACKGROUND_JOB - Background Job SWITCH_EVENT_DETECTED_SPEECH - Detected Speech + SWITCH_EVENT_PRIVATE_COMMAND - A private command event SWITCH_EVENT_ALL - All events at once @@ -785,6 +786,7 @@ typedef enum { SWITCH_EVENT_CODEC, SWITCH_EVENT_BACKGROUND_JOB, SWITCH_EVENT_DETECTED_SPEECH, + SWITCH_EVENT_PRIVATE_COMMAND, SWITCH_EVENT_ALL } switch_event_types_t; diff --git a/src/switch_core.c b/src/switch_core.c index ee4ac2e8de..fe36e6cc5a 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -1909,6 +1909,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_queue_private_event(switch_c } if (session->private_event_queue) { + (*event)->event_id = SWITCH_EVENT_PRIVATE_COMMAND; if (switch_queue_trypush(session->private_event_queue, *event) == SWITCH_STATUS_SUCCESS) { *event = NULL; switch_core_session_kill_channel(session, SWITCH_SIG_BREAK); diff --git a/src/switch_event.c b/src/switch_event.c index e4373e29c2..0d1ee3a606 100644 --- a/src/switch_event.c +++ b/src/switch_event.c @@ -130,6 +130,7 @@ static char *EVENT_NAMES[] = { "CODEC", "BACKGROUND_JOB", "DETECTED_SPEECH", + "PRIVATE_COMMAND", "ALL" }; diff --git a/src/switch_ivr.c b/src/switch_ivr.c index e2ab69e72a..4743a4166e 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -98,6 +98,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se unsigned long CMD_NOMEDIA = apr_hashfunc_default("nomedia", &hlen); assert(channel != NULL); + assert(event != NULL); if (switch_strlen_zero(cmd)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Command!\n"); @@ -170,7 +171,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session, if (switch_core_session_dequeue_private_event(session, &event) == SWITCH_STATUS_SUCCESS) { switch_ivr_parse_event(session, event); - switch_event_destroy(&event); + switch_event_fire(&event); } if (switch_channel_has_dtmf(channel)) {