[Freeswitch-svn] [commit] r12889 - freeswitch/trunk/libs/esl/src

FreeSWITCH SVN anthm at freeswitch.org
Thu Apr 2 11:16:59 PDT 2009


Author: anthm
Date: Thu Apr  2 13:16:59 2009
New Revision: 12889

Log:
add event name when sending

Modified:
   freeswitch/trunk/libs/esl/src/esl.c

Modified: freeswitch/trunk/libs/esl/src/esl.c
==============================================================================
--- freeswitch/trunk/libs/esl/src/esl.c	(original)
+++ freeswitch/trunk/libs/esl/src/esl.c	Thu Apr  2 13:16:59 2009
@@ -427,6 +427,7 @@
 ESL_DECLARE(esl_status_t) esl_sendevent(esl_handle_t *handle, esl_event_t *event)
 {
 	char *txt;
+	char event_buf[256] = "";
 
 	if (!handle->connected || !event) {
 		return ESL_FAIL;
@@ -436,7 +437,9 @@
 
 	esl_log(ESL_LOG_DEBUG, "SEND EVENT\n%s\n", txt);
 		
-	send(handle->sock, "sendevent\n", 10, 0);
+	snprintf(event_buf, sizeof(event_buf), "sendevent %s\n", esl_event_name(event->event_id));
+	
+	send(handle->sock, event_buf, strlen(event_buf), 0);
 	send(handle->sock, txt, strlen(txt), 0);
 	send(handle->sock, "\n\n", 2, 0);
 



More information about the Freeswitch-svn mailing list