[Freeswitch-svn] [commit] r11395 - freeswitch/trunk/src/mod/event_handlers/mod_erlang_event

FreeSWITCH SVN andrew at freeswitch.org
Thu Jan 22 13:20:36 PST 2009


Author: andrew
Date: Thu Jan 22 15:20:36 2009
New Revision: 11395

Log:
Tweak some stuff, make the registered process name an atom, return baduuid if the requested uuid isn't found


Modified:
   freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/ei_helpers.c
   freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/handle_msg.c

Modified: freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/ei_helpers.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/ei_helpers.c	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/ei_helpers.c	Thu Jan 22 15:20:36 2009
@@ -167,7 +167,7 @@
 		return SWITCH_STATUS_FALSE;
 	}
 
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ei initialized at %s\n", thisnodename);
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "ei initialized node at %s\n", thisnodename);
 	return SWITCH_STATUS_SUCCESS;
 }
 

Modified: freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/handle_msg.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/handle_msg.c	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/handle_msg.c	Thu Jan 22 15:20:36 2009
@@ -523,28 +523,25 @@
 
 	if (arity != 3 ||
 		ei_decode_string(buf->buff, &buf->index, uuid_str) ||
-		ei_decode_string(buf->buff, &buf->index, reg_name)) {
+		ei_decode_atom(buf->buff, &buf->index, reg_name)) {
 		ei_x_encode_tuple_header(rbuf, 2);
 		ei_x_encode_atom(rbuf, "error");
 		ei_x_encode_atom(rbuf, "badarg");
-	}
-	else {
+	} else {
 		switch_core_session_t *session;
 		if (!switch_strlen_zero(uuid_str) && (session = switch_core_session_locate(uuid_str))) {
 			/* create a new sesion list element and attach it to this listener */
 			if (attach_call_to_listener(listener,reg_name,session)) {
 				ei_x_encode_atom(rbuf, "ok");
-			}
-			else {
+			} else {
 				ei_x_encode_tuple_header(rbuf, 2);
 				ei_x_encode_atom(rbuf, "error");
 				ei_x_encode_atom(rbuf, "badsession");
 			}
-		}
-		else {
+		} else {
 			ei_x_encode_tuple_header(rbuf, 2);
 			ei_x_encode_atom(rbuf, "error");
-			ei_x_encode_atom(rbuf, "badarg");
+			ei_x_encode_atom(rbuf, "baduuid");
 		}
 	}
 	return SWITCH_STATUS_SUCCESS;



More information about the Freeswitch-svn mailing list