[Freeswitch-svn] [commit] r12228 - in freeswitch/trunk: libs/esl/src libs/esl/src/include src src/include src/mod/applications/mod_conference src/mod/event_handlers/mod_event_socket

FreeSWITCH SVN anthm at freeswitch.org
Sat Feb 21 15:19:58 PST 2009


Author: anthm
Date: Sat Feb 21 17:19:58 2009
New Revision: 12228

Log:
event socket / ESL improvements

Modified:
   freeswitch/trunk/libs/esl/src/esl.c
   freeswitch/trunk/libs/esl/src/esl_event.c
   freeswitch/trunk/libs/esl/src/esl_oop.cpp
   freeswitch/trunk/libs/esl/src/include/esl.h
   freeswitch/trunk/libs/esl/src/include/esl_event.h
   freeswitch/trunk/src/include/switch_core.h
   freeswitch/trunk/src/include/switch_event.h
   freeswitch/trunk/src/include/switch_types.h
   freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
   freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
   freeswitch/trunk/src/switch_channel.c
   freeswitch/trunk/src/switch_core_session.c
   freeswitch/trunk/src/switch_cpp.cpp
   freeswitch/trunk/src/switch_event.c
   freeswitch/trunk/src/switch_ivr.c
   freeswitch/trunk/src/switch_ivr_async.c
   freeswitch/trunk/src/switch_ivr_bridge.c
   freeswitch/trunk/src/switch_ivr_play_say.c

Modified: freeswitch/trunk/libs/esl/src/esl.c
==============================================================================
--- freeswitch/trunk/libs/esl/src/esl.c	(original)
+++ freeswitch/trunk/libs/esl/src/esl.c	Sat Feb 21 17:19:58 2009
@@ -786,12 +786,11 @@
 
 	while(handle->connected) {
 		rrval = recv(handle->sock, c, 1, 0);
-
 		if (rrval == 0) {
 			if (++zc >= 100) {
 				esl_disconnect(handle);
 				esl_mutex_unlock(handle->mutex);
-				return ESL_FAIL;
+				return ESL_DISCONNECTED;
 			}
 		} else if (rrval < 0) {
 			strerror_r(handle->errnum, handle->err, sizeof(handle->err));
@@ -876,21 +875,16 @@
 
 		hval = esl_event_get_header(revent, "content-type");
 
-		if (!esl_strlen_zero(hval) && !esl_safe_strcasecmp(hval, "text/event-plain") && revent->body) {
-			const char *en;
+		if (!esl_safe_strcasecmp(hval, "text/disconnect-notice") && revent->body) {
+			goto fail;
+		}
+		
+		if (!esl_safe_strcasecmp(hval, "text/event-plain") && revent->body) {
 			esl_event_types_t et = ESL_EVENT_COMMAND;
 			char *body = strdup(revent->body);
 			
 			esl_event_safe_destroy(&handle->last_ievent);
 
-			if ((en = esl_stristr("event-name:", body))) {
-				en++;
-				while(*en == ' ') en++;
-				if (en) {
-					esl_name_event(en, &et);
-				}
-			}
-			
 			esl_event_create(&handle->last_ievent, et);
 
 			beg = body;
@@ -914,14 +908,18 @@
 				if (hname && hval) {
 					esl_url_decode(hval);
 					esl_log(ESL_LOG_DEBUG, "RECV INNER HEADER [%s] = [%s]\n", hname, hval);
+					if (!strcasecmp(hname, "event-name")) {
+						esl_event_del_header(handle->last_ievent, "event-name");
+					}
 					esl_event_add_header_string(handle->last_ievent, ESL_STACK_BOTTOM, hname, hval);
+					esl_name_event(hval, &handle->last_event->event_id);
 				}
 				
 				beg = c + 1;
 			}
 
 			free(body);
-
+			
 			if ((cl = esl_event_get_header(handle->last_ievent, "content-length"))) {
 				esl_ssize_t sofar = 0;
 		

Modified: freeswitch/trunk/libs/esl/src/esl_event.c
==============================================================================
--- freeswitch/trunk/libs/esl/src/esl_event.c	(original)
+++ freeswitch/trunk/libs/esl/src/esl_event.c	Sat Feb 21 17:19:58 2009
@@ -118,6 +118,8 @@
 	"GENERAL",
 	"COMMAND",
 	"SESSION_HEARTBEAT",
+	"CLIENT_DISCONNECTED",
+	"SERVER_DISCONNECTED",
 	"ALL"
 };
 
@@ -157,10 +159,12 @@
 
 	(*event)->event_id = event_id;
 
+	esl_event_add_header_string(*event, ESL_STACK_BOTTOM, "Event-Name", esl_event_name((*event)->event_id));
+
 	if (subclass_name) {
 		(*event)->subclass_name = DUP(subclass_name);
 		esl_event_add_header_string(*event, ESL_STACK_BOTTOM, "Event-Subclass", subclass_name);
-	}
+	}	
 	
 	return ESL_SUCCESS;
 }

Modified: freeswitch/trunk/libs/esl/src/esl_oop.cpp
==============================================================================
--- freeswitch/trunk/libs/esl/src/esl_oop.cpp	(original)
+++ freeswitch/trunk/libs/esl/src/esl_oop.cpp	Sat Feb 21 17:19:58 2009
@@ -163,7 +163,9 @@
 		}
 	}
 
-	return NULL;
+	last_event_obj = new ESLevent("server_disconnected");
+
+	return last_event_obj;
 }
 
 ESLevent *ESLconnection::recvEventTimed(int ms)
@@ -183,7 +185,8 @@
 		}
     }
 	
-	return NULL;
+	last_event_obj = new ESLevent("server_disconnected");
+	return last_event_obj;
 }
 
 int ESLconnection::filter(const char *header, const char *value)

Modified: freeswitch/trunk/libs/esl/src/include/esl.h
==============================================================================
--- freeswitch/trunk/libs/esl/src/include/esl.h	(original)
+++ freeswitch/trunk/libs/esl/src/include/esl.h	Sat Feb 21 17:19:58 2009
@@ -248,7 +248,8 @@
 typedef enum {
 	ESL_SUCCESS,
 	ESL_FAIL,
-	ESL_BREAK
+	ESL_BREAK,
+	ESL_DISCONNECTED
 } esl_status_t;
 
 #include <esl_threadmutex.h>
@@ -341,7 +342,15 @@
 
 #define esl_recv(_h) esl_recv_event(_h, NULL)
 #define esl_recv_timed(_h, _ms) esl_recv_event_timed(_h, _ms, NULL)
-#define esl_safe_strcasecmp(_s1, _s2) ((_s1) && (_s2)) ? strcasecmp((_s1), (_s2)) : 1
+
+static __inline__ int esl_safe_strcasecmp(const char *s1, const char *s2)
+{
+	if (!(s1 && s2)) {
+		return 1;
+	}
+
+	return strcasecmp(s1, s2);
+}
 
 #ifdef __cplusplus
 }

Modified: freeswitch/trunk/libs/esl/src/include/esl_event.h
==============================================================================
--- freeswitch/trunk/libs/esl/src/include/esl_event.h	(original)
+++ freeswitch/trunk/libs/esl/src/include/esl_event.h	Sat Feb 21 17:19:58 2009
@@ -106,6 +106,8 @@
 	ESL_EVENT_GENERAL,
 	ESL_EVENT_COMMAND,
 	ESL_EVENT_SESSION_HEARTBEAT,
+	ESL_EVENT_CLIENT_DISCONNECTED,
+	ESL_EVENT_SERVER_DISCONNECTED,
 	ESL_EVENT_ALL
 } esl_event_types_t;
 

Modified: freeswitch/trunk/src/include/switch_core.h
==============================================================================
--- freeswitch/trunk/src/include/switch_core.h	(original)
+++ freeswitch/trunk/src/include/switch_core.h	Sat Feb 21 17:19:58 2009
@@ -830,9 +830,10 @@
   \brief DE-Queue an event on a given session
   \param session the session to de-queue the message on
   \param event the de-queued event
+  \param force force the dequeue
   \return the  SWITCH_STATUS_SUCCESS if the event was de-queued
 */
-SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_event(_In_ switch_core_session_t *session, _Out_ switch_event_t **event);
+SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_event(_In_ switch_core_session_t *session, _Out_ switch_event_t **event, switch_bool_t force);
 
 /*! 
   \brief Queue a private event on a given session

Modified: freeswitch/trunk/src/include/switch_event.h
==============================================================================
--- freeswitch/trunk/src/include/switch_event.h	(original)
+++ freeswitch/trunk/src/include/switch_event.h	Sat Feb 21 17:19:58 2009
@@ -121,7 +121,10 @@
   \param subclass_name the subclass name for custom event (only valid when event_id is SWITCH_EVENT_CUSTOM)
   \return SWITCH_STATUS_SUCCESS on success
 */
-SWITCH_DECLARE(switch_status_t) switch_event_create_subclass(switch_event_t **event, switch_event_types_t event_id, const char *subclass_name);
+SWITCH_DECLARE(switch_status_t) switch_event_create_subclass_detailed(const char *file, const char *func, int line,
+																	  switch_event_t **event, switch_event_types_t event_id, const char *subclass_name);
+
+#define switch_event_create_subclass(_e, _eid, _sn) switch_event_create_subclass_detailed(__FILE__, (char * )__SWITCH_FUNC__, __LINE__, _e, _eid, _sn)
 
 /*!
   \brief Set the priority of an event
@@ -198,6 +201,10 @@
 */
 SWITCH_DECLARE(switch_status_t) switch_event_fire_detailed(const char *file, const char *func, int line, switch_event_t **event, void *user_data);
 
+SWITCH_DECLARE(void) switch_event_prep_for_delivery_detailed(const char *file, const char *func, int line, switch_event_t *event);
+#define switch_event_prep_for_delivery(_event) switch_event_prep_for_delivery_detailed(__FILE__, (char * )__SWITCH_FUNC__, __LINE__, _event)
+
+
 /*!
   \brief Bind an event callback to a specific event
   \param id an identifier token of the binder

Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h	(original)
+++ freeswitch/trunk/src/include/switch_types.h	Sat Feb 21 17:19:58 2009
@@ -844,6 +844,7 @@
 	CF_REQ_MEDIA,
 	CF_VERBOSE_EVENTS,
 	CF_PAUSE_BUGS,
+	CF_DIVERT_EVENTS,
 	/* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
 	CF_FLAG_MAX
 } switch_channel_flag_t;
@@ -1212,6 +1213,8 @@
 	SWITCH_EVENT_GENERAL,
 	SWITCH_EVENT_COMMAND,
 	SWITCH_EVENT_SESSION_HEARTBEAT,
+	SWITCH_EVENT_CLIENT_DISCONNECTED,
+	SWITCH_EVENT_SERVER_DISCONNECTED,
 	SWITCH_EVENT_ALL
 } switch_event_types_t;
 

Modified: freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c	Sat Feb 21 17:19:58 2009
@@ -1900,7 +1900,7 @@
 
 		switch_mutex_lock(member->control_mutex);
 
-		if (switch_core_session_dequeue_event(member->session, &event) == SWITCH_STATUS_SUCCESS) {
+		if (switch_core_session_dequeue_event(member->session, &event, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {
 			if (event->event_id == SWITCH_EVENT_MESSAGE) {
 				char *from = switch_event_get_header(event, "from");
 				char *to = switch_event_get_header(event, "to");

Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	Sat Feb 21 17:19:58 2009
@@ -218,7 +218,7 @@
 	if (!listen_list.ready) {
 		return;
 	}
-
+	
 	lp = listen_list.listeners;
 
 	switch_mutex_lock(globals.listener_mutex);
@@ -328,7 +328,6 @@
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Memory Error!\n");
 			}
 		}
-
 	}
 	switch_mutex_unlock(globals.listener_mutex);
 }
@@ -988,8 +987,9 @@
 	while (listener->sock && !prefs.done) {
 		uint8_t do_sleep = 1;
 		mlen = 1;
-		status = switch_socket_recv(listener->sock, ptr, &mlen);
 
+		status = switch_socket_recv(listener->sock, ptr, &mlen);
+		
 		if (prefs.done || (!SWITCH_STATUS_IS_BREAK(status) && status != SWITCH_STATUS_SUCCESS)) {
 			return SWITCH_STATUS_FALSE;
 		}
@@ -1129,12 +1129,26 @@
 				}
 			}
 			
+
+			if (listener->session) {
+				switch_channel_t *channel = switch_core_session_get_channel(listener->session);
+				if (switch_channel_get_state(channel) < CS_HANGUP && switch_channel_test_flag(channel, CF_DIVERT_EVENTS)) {
+					switch_event_t *e = NULL;
+					while (switch_core_session_dequeue_event(listener->session, &e, SWITCH_TRUE) == SWITCH_STATUS_SUCCESS) {
+						if (switch_queue_trypush(listener->event_queue, e) != SWITCH_STATUS_SUCCESS) {
+							switch_core_session_queue_event(listener->session, &e);
+							break;
+						}
+					}
+				}
+			}
+
 			if (switch_test_flag(listener, LFLAG_EVENTS)) {
 				while (switch_queue_trypop(listener->event_queue, &pop) == SWITCH_STATUS_SUCCESS) {
 					char hbuf[512];
 					switch_event_t *pevent = (switch_event_t *) pop;
 					char *etype;
-
+					
 					do_sleep = 0;
 					if (listener->format == EVENT_FORMAT_PLAIN) {
 						etype = "plain";
@@ -1473,6 +1487,47 @@
 	}
 
 
+	if (!strncasecmp(cmd, "divert_events", 13)) {
+		char *onoff = cmd + 13;
+		switch_channel_t *channel;
+		
+		if (!listener->session) {
+			switch_snprintf(reply, reply_len, "-ERR not controlling a session.");
+			goto done;
+		}
+
+		channel = switch_core_session_get_channel(listener->session);
+		
+		if (onoff) {
+			while(*onoff == ' ') {
+				onoff++;
+			}
+			
+			if (*onoff == '\r' || *onoff == '\n') {
+				onoff = NULL;
+			} else {
+				strip_cr(onoff);
+			}
+		}
+
+		if (switch_strlen_zero(onoff)) {
+			switch_snprintf(reply, reply_len, "-ERR missing value.");
+			goto done;
+		}
+
+		
+		if (!strcasecmp(onoff, "on")) {
+			switch_snprintf(reply, reply_len, "+OK events diverted");
+			switch_channel_set_flag(channel, CF_DIVERT_EVENTS);
+		} else {
+			switch_snprintf(reply, reply_len, "+OK events not diverted");
+			switch_channel_clear_flag(channel, CF_DIVERT_EVENTS);
+		}
+
+		goto done;
+
+	}
+
 	if (!strncasecmp(cmd, "sendmsg", 7)) {
 		switch_core_session_t *session;
 		char *uuid = cmd + 7;

Modified: freeswitch/trunk/src/switch_channel.c
==============================================================================
--- freeswitch/trunk/src/switch_channel.c	(original)
+++ freeswitch/trunk/src/switch_channel.c	Sat Feb 21 17:19:58 2009
@@ -373,7 +373,11 @@
 		switch_channel_event_set_data(channel, event);
 		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "DTMF-Digit", "%c", dtmf->digit);
 		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "DTMF-Duration", "%u", dtmf->duration);
-		switch_event_fire(&event);
+		if (switch_channel_test_flag(channel, CF_DIVERT_EVENTS)) {
+			switch_core_session_queue_event(channel->session, &event);
+		} else {
+			switch_event_fire(&event);
+		}
 	}
 
 	return status;

Modified: freeswitch/trunk/src/switch_core_session.c
==============================================================================
--- freeswitch/trunk/src/switch_core_session.c	(original)
+++ freeswitch/trunk/src/switch_core_session.c	Sat Feb 21 17:19:58 2009
@@ -680,14 +680,14 @@
 	return 0;
 }
 
-SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_event(switch_core_session_t *session, switch_event_t **event)
+SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_event(switch_core_session_t *session, switch_event_t **event, switch_bool_t force)
 {
 	switch_status_t status = SWITCH_STATUS_FALSE;
 	void *pop;
 
 	switch_assert(session != NULL);
 
-	if (session->event_queue) {
+	if (session->event_queue && (force || !switch_channel_test_flag(session->channel, CF_DIVERT_EVENTS))) {
 		if ((status = (switch_status_t) switch_queue_trypop(session->event_queue, &pop)) == SWITCH_STATUS_SUCCESS) {
 			*event = (switch_event_t *) pop;
 		}

Modified: freeswitch/trunk/src/switch_cpp.cpp
==============================================================================
--- freeswitch/trunk/src/switch_cpp.cpp	(original)
+++ freeswitch/trunk/src/switch_cpp.cpp	Sat Feb 21 17:19:58 2009
@@ -986,7 +986,7 @@
 	}
 	channel = switch_core_session_get_channel(session);
 
-	while (switch_core_session_dequeue_event(session, &event) == SWITCH_STATUS_SUCCESS) {
+	while (switch_core_session_dequeue_event(session, &event, SWITCH_TRUE) == SWITCH_STATUS_SUCCESS) {
 		switch_event_destroy(&event);
 	}
 	return SWITCH_STATUS_SUCCESS;

Modified: freeswitch/trunk/src/switch_event.c
==============================================================================
--- freeswitch/trunk/src/switch_event.c	(original)
+++ freeswitch/trunk/src/switch_event.c	Sat Feb 21 17:19:58 2009
@@ -170,6 +170,8 @@
 	"GENERAL",
 	"COMMAND",
 	"SESSION_HEARTBEAT",
+	"CLIENT_DISCONNECTED",
+	"SERVER_DISCONNECTED",
 	"ALL"
 };
 
@@ -589,7 +591,8 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-SWITCH_DECLARE(switch_status_t) switch_event_create_subclass(switch_event_t **event, switch_event_types_t event_id, const char *subclass_name)
+SWITCH_DECLARE(switch_status_t) switch_event_create_subclass_detailed(const char *file, const char *func, int line,
+																	  switch_event_t **event, switch_event_types_t event_id, const char *subclass_name)
 {
 	void *pop;
 
@@ -610,6 +613,8 @@
 
 	(*event)->event_id = event_id;
 
+	switch_event_prep_for_delivery_detailed(file, func, line, *event);
+
 	if (subclass_name) {
 		(*event)->subclass_name = DUP(subclass_name);
 		switch_event_add_header_string(*event, SWITCH_STACK_BOTTOM, "Event-Subclass", subclass_name);
@@ -1054,13 +1059,37 @@
 	return xml;
 }
 
-SWITCH_DECLARE(switch_status_t) switch_event_fire_detailed(const char *file, const char *func, int line, switch_event_t **event, void *user_data)
+SWITCH_DECLARE(void) switch_event_prep_for_delivery_detailed(const char *file, const char *func, int line, switch_event_t *event)
 {
 	switch_time_exp_t tm;
 	char date[80] = "";
 	switch_size_t retsize;
 	switch_time_t ts = switch_micro_time_now();
 
+
+	switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Event-Name", switch_event_name(event->event_id));
+	switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Core-UUID", switch_core_get_uuid());
+	switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FreeSWITCH-Hostname", hostname);
+	switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FreeSWITCH-IPv4", guess_ip_v4);
+	switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FreeSWITCH-IPv6", guess_ip_v6);
+
+	switch_time_exp_lt(&tm, ts);
+	switch_strftime_nocheck(date, &retsize, sizeof(date), "%Y-%m-%d %T", &tm);
+	switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Event-Date-Local", date);
+	switch_rfc822_date(date, ts);
+	switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Event-Date-GMT", date);
+	switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Event-Date-Timestamp", "%" SWITCH_UINT64_T_FMT, (uint64_t) ts);
+	switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Event-Calling-File", switch_cut_path(file));
+	switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Event-Calling-Function", func);
+	switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Event-Calling-Line-Number", "%d", line);
+
+
+}
+
+SWITCH_DECLARE(switch_status_t) switch_event_fire_detailed(const char *file, const char *func, int line, switch_event_t **event, void *user_data)
+{
+
+	
 	switch_assert(BLOCK != NULL);
 	switch_assert(RUNTIME_POOL != NULL);
 	switch_assert(EVENT_QUEUE_MUTEX != NULL);
@@ -1072,22 +1101,6 @@
 		return SWITCH_STATUS_SUCCESS;
 	}
 
-	switch_event_add_header_string(*event, SWITCH_STACK_BOTTOM, "Event-Name", switch_event_name((*event)->event_id));
-	switch_event_add_header_string(*event, SWITCH_STACK_BOTTOM, "Core-UUID", switch_core_get_uuid());
-	switch_event_add_header_string(*event, SWITCH_STACK_BOTTOM, "FreeSWITCH-Hostname", hostname);
-	switch_event_add_header_string(*event, SWITCH_STACK_BOTTOM, "FreeSWITCH-IPv4", guess_ip_v4);
-	switch_event_add_header_string(*event, SWITCH_STACK_BOTTOM, "FreeSWITCH-IPv6", guess_ip_v6);
-
-	switch_time_exp_lt(&tm, ts);
-	switch_strftime_nocheck(date, &retsize, sizeof(date), "%Y-%m-%d %T", &tm);
-	switch_event_add_header_string(*event, SWITCH_STACK_BOTTOM, "Event-Date-Local", date);
-	switch_rfc822_date(date, ts);
-	switch_event_add_header_string(*event, SWITCH_STACK_BOTTOM, "Event-Date-GMT", date);
-	switch_event_add_header(*event, SWITCH_STACK_BOTTOM, "Event-Date-Timestamp", "%" SWITCH_UINT64_T_FMT, (uint64_t) ts);
-	switch_event_add_header_string(*event, SWITCH_STACK_BOTTOM, "Event-Calling-File", switch_cut_path(file));
-	switch_event_add_header_string(*event, SWITCH_STACK_BOTTOM, "Event-Calling-Function", func);
-	switch_event_add_header(*event, SWITCH_STACK_BOTTOM, "Event-Calling-Line-Number", "%d", line);
-
 	if (user_data) {
 		(*event)->event_user_data = user_data;
 	}

Modified: freeswitch/trunk/src/switch_ivr.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr.c	(original)
+++ freeswitch/trunk/src/switch_ivr.c	Sat Feb 21 17:19:58 2009
@@ -248,7 +248,7 @@
 			if (args->input_callback) {
 				switch_event_t *event = NULL;
 
-				if (switch_core_session_dequeue_event(session, &event) == SWITCH_STATUS_SUCCESS) {
+				if (switch_core_session_dequeue_event(session, &event, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {
 					status = args->input_callback(session, event, SWITCH_INPUT_TYPE_EVENT, args->buf, args->buflen);
 					switch_event_destroy(&event);
 				}
@@ -783,7 +783,7 @@
 				}
 			}
 
-			if (switch_core_session_dequeue_event(session, &event) == SWITCH_STATUS_SUCCESS) {
+			if (switch_core_session_dequeue_event(session, &event, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {
 				if (args && args->input_callback) {
 					if ((status = args->input_callback(session, event, SWITCH_INPUT_TYPE_EVENT, args->buf, args->buflen)) != SWITCH_STATUS_SUCCESS) {
 						break;
@@ -853,7 +853,7 @@
 			status = args->input_callback(session, (void *) &dtmf, SWITCH_INPUT_TYPE_DTMF, args->buf, args->buflen);
 		}
 
-		if (switch_core_session_dequeue_event(session, &event) == SWITCH_STATUS_SUCCESS) {
+		if (switch_core_session_dequeue_event(session, &event, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {
 			status = args->input_callback(session, event, SWITCH_INPUT_TYPE_EVENT, args->buf, args->buflen);
 			switch_event_destroy(&event);
 		}

Modified: freeswitch/trunk/src/switch_ivr_async.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_async.c	(original)
+++ freeswitch/trunk/src/switch_ivr_async.c	Sat Feb 21 17:19:58 2009
@@ -126,7 +126,7 @@
 			if (args->input_callback) {
 				switch_event_t *event = NULL;
 
-				if (switch_core_session_dequeue_event(session, &event) == SWITCH_STATUS_SUCCESS) {
+				if (switch_core_session_dequeue_event(session, &event, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {
 					status = args->input_callback(session, event, SWITCH_INPUT_TYPE_EVENT, args->buf, args->buflen);
 					switch_event_destroy(&event);
 				}
@@ -692,7 +692,7 @@
 				goto end;
 			}
 
-			if (switch_core_session_dequeue_event(session, &event) == SWITCH_STATUS_SUCCESS) {
+			if (switch_core_session_dequeue_event(session, &event, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {
 				char *command = switch_event_get_header(event, "eavesdrop-command");
 				if (command) {
 					fcommand = command;

Modified: freeswitch/trunk/src/switch_ivr_bridge.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_bridge.c	(original)
+++ freeswitch/trunk/src/switch_ivr_bridge.c	Sat Feb 21 17:19:58 2009
@@ -279,7 +279,7 @@
 			}
 		}
 
-		if (switch_core_session_dequeue_event(session_a, &event) == SWITCH_STATUS_SUCCESS) {
+		if (switch_core_session_dequeue_event(session_a, &event, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {
 			if (input_callback) {
 				status = input_callback(session_a, event, SWITCH_INPUT_TYPE_EVENT, user_data, 0);
 			}

Modified: freeswitch/trunk/src/switch_ivr_play_say.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_play_say.c	(original)
+++ freeswitch/trunk/src/switch_ivr_play_say.c	Sat Feb 21 17:19:58 2009
@@ -575,7 +575,7 @@
 			if (args->input_callback) {
 				switch_event_t *event = NULL;
 
-				if (switch_core_session_dequeue_event(session, &event) == SWITCH_STATUS_SUCCESS) {
+				if (switch_core_session_dequeue_event(session, &event, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {
 					status = args->input_callback(session, event, SWITCH_INPUT_TYPE_EVENT, args->buf, args->buflen);
 					switch_event_destroy(&event);
 				}
@@ -742,7 +742,7 @@
 			if (args->input_callback) {
 				switch_event_t *event;
 
-				if (switch_core_session_dequeue_event(session, &event) == SWITCH_STATUS_SUCCESS) {
+				if (switch_core_session_dequeue_event(session, &event, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {
 					status = args->input_callback(session, event, SWITCH_INPUT_TYPE_EVENT, args->buf, args->buflen);
 					switch_event_destroy(&event);
 				}
@@ -1070,7 +1070,7 @@
 			if (args->input_callback) {
 				switch_event_t *event;
 
-				if (switch_core_session_dequeue_event(session, &event) == SWITCH_STATUS_SUCCESS) {
+				if (switch_core_session_dequeue_event(session, &event, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {
 					status = args->input_callback(session, event, SWITCH_INPUT_TYPE_EVENT, args->buf, args->buflen);
 					switch_event_destroy(&event);
 				}
@@ -1715,7 +1715,7 @@
 			}
 
 			if (args->input_callback) {
-				if (switch_core_session_dequeue_event(session, &event) == SWITCH_STATUS_SUCCESS) {
+				if (switch_core_session_dequeue_event(session, &event, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {
 					status = args->input_callback(session, event, SWITCH_INPUT_TYPE_EVENT, args->buf, args->buflen);
 					switch_event_destroy(&event);
 				}



More information about the Freeswitch-svn mailing list