From 3cb315d6d41f84bec449d9d88a88d99e3e0e382a Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 4 Jan 2010 17:46:55 +0000 Subject: [PATCH] add SOCKET_EVENT event git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16135 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- libs/esl/src/esl.c | 3 +++ libs/esl/src/esl_event.c | 1 + libs/esl/src/include/esl_event.h | 1 + src/include/switch_types.h | 1 + src/mod/event_handlers/mod_event_socket/mod_event_socket.c | 2 +- src/switch_event.c | 1 + 6 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libs/esl/src/esl.c b/libs/esl/src/esl.c index 03d1e026ac..565cf9d5be 100644 --- a/libs/esl/src/esl.c +++ b/libs/esl/src/esl.c @@ -834,6 +834,9 @@ ESL_DECLARE(esl_status_t) esl_recv_event(esl_handle_t *handle, int check_q, esl_ if (!revent) { esl_event_create(&revent, ESL_EVENT_CLONE); + revent->event_id = ESL_EVENT_SOCKET_DATA; + esl_event_add_header_string(revent, ESL_STACK_BOTTOM, "Event-Name", "SOCKET_DATA"); + } hname = beg; diff --git a/libs/esl/src/esl_event.c b/libs/esl/src/esl_event.c index 27f680acf9..1188a01707 100644 --- a/libs/esl/src/esl_event.c +++ b/libs/esl/src/esl_event.c @@ -130,6 +130,7 @@ static const char *EVENT_NAMES[] = { "RECORD_STOP", "CALL_UPDATE", "FAILURE", + "SOCKET_DATA", "ALL" }; diff --git a/libs/esl/src/include/esl_event.h b/libs/esl/src/include/esl_event.h index 712c12fa45..790add2d54 100644 --- a/libs/esl/src/include/esl_event.h +++ b/libs/esl/src/include/esl_event.h @@ -118,6 +118,7 @@ typedef enum { ESL_EVENT_RECORD_STOP, ESL_EVENT_CALL_UPDATE, ESL_EVENT_FAILURE, + ESL_EVENT_SOCKET_DATA, ESL_EVENT_ALL } esl_event_types_t; diff --git a/src/include/switch_types.h b/src/include/switch_types.h index a3ff346cf0..9609a1fa78 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -1338,6 +1338,7 @@ typedef enum { SWITCH_EVENT_RECORD_STOP, SWITCH_EVENT_CALL_UPDATE, SWITCH_EVENT_FAILURE, + SWITCH_EVENT_SOCKET_DATA, SWITCH_EVENT_ALL } switch_event_types_t; diff --git a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c index 3ef03f3a9f..2480c8cc94 100644 --- a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c +++ b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c @@ -1084,7 +1084,7 @@ static switch_status_t read_packet(listener_t *listener, switch_event_t **event, } count++; if (count == 1) { - switch_event_create(event, SWITCH_EVENT_COMMAND); + switch_event_create(event, SWITCH_EVENT_SOCKET_DATA); switch_event_add_header_string(*event, SWITCH_STACK_BOTTOM, "Command", mbuf); } else if (cur) { char *var, *val; diff --git a/src/switch_event.c b/src/switch_event.c index 8ee097f271..85d6ed061a 100644 --- a/src/switch_event.c +++ b/src/switch_event.c @@ -186,6 +186,7 @@ static char *EVENT_NAMES[] = { "RECORD_STOP", "CALL_UPDATE", "FAILURE", + "SOCKET_DATA", "ALL" };