[Freeswitch-svn] [commit] r3051 - in freeswitch/trunk/src: . mod/endpoints/mod_dingaling

Freeswitch SVN anthm at freeswitch.org
Sun Oct 15 00:44:33 EDT 2006


Author: anthm
Date: Sun Oct 15 00:44:33 2006
New Revision: 3051

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c
   freeswitch/trunk/src/switch_ivr.c

Log:
update

Modified: freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c	Sun Oct 15 00:44:33 2006
@@ -1532,25 +1532,28 @@
 		switch(signal) {
 		case LDL_SIGNAL_PRESENCE_IN:
 			if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
-				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", profile->login);
-				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", from);
-				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", subject);
-				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "show", msg);
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", "jingle");
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", from);
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "%s", subject);
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "show", "%s", msg);
 				switch_event_fire(&event);
 			}
 			break;
 		case LDL_SIGNAL_PRESENCE_OUT:
 			if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_OUT) == SWITCH_STATUS_SUCCESS) {
-				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", profile->login);
-				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", from);
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", "jingle");
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", from);
 				switch_event_fire(&event);
 			}
 			break;
 		case LDL_SIGNAL_MSG:
 			if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
-				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", profile->login);
-				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", from);
-				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "subject", subject);
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", "jingle");
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", from);
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "subject", "%s", subject);
 				if (msg) {
 					switch_event_add_body(event, msg);
 				}
@@ -1564,19 +1567,19 @@
 			break;
 		case LDL_SIGNAL_LOGIN_SUCCESS:
 			if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, DL_EVENT_LOGIN_SUCCESS) == SWITCH_STATUS_SUCCESS) {
-				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", profile->login);
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
 				switch_event_fire(&event);
 			}
 			break;
 		case LDL_SIGNAL_LOGIN_FAILURE:
 			if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, DL_EVENT_LOGIN_FAILURE) == SWITCH_STATUS_SUCCESS) {
-				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", profile->login);
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
 				switch_event_fire(&event);
 			}
 			break;
 		case LDL_SIGNAL_CONNECTED:
 			if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, DL_EVENT_CONNECTED) == SWITCH_STATUS_SUCCESS) {
-				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", profile->login);
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
 				switch_event_fire(&event);
 			}
 			break;
@@ -1660,9 +1663,10 @@
 		}
 
 		if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
-			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", profile->login);
-			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", from);
-			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "subject", subject);
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", "jingle");
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", from);
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "subject", "%s", subject);
 			if (msg) {
 				switch_event_add_body(event, msg);
 			}

Modified: freeswitch/trunk/src/switch_ivr.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr.c	(original)
+++ freeswitch/trunk/src/switch_ivr.c	Sun Oct 15 00:44:33 2006
@@ -1968,7 +1968,7 @@
 		while ((!caller_channel || switch_channel_ready(caller_channel)) && 
 			   check_channel_status(peer_channels, peer_sessions, and_argc, &idx, file, key) && ((time(NULL) - start) < (time_t)timelimit_sec)) {
 
-			if (or_argc == 1 && and_argc == 1) { /* when there is only 1 channel to call and bridge */
+			if (session && or_argc == 1 && and_argc == 1) { /* when there is only 1 channel to call and bridge */
 				switch_core_session_message_t *message = NULL;
 				if (switch_core_session_dequeue_message(peer_sessions[0], &message) == SWITCH_STATUS_SUCCESS) {
 					switch_core_session_receive_message(session, message);



More information about the Freeswitch-svn mailing list