[Freeswitch-svn] [commit] r12257 - freeswitch/trunk/src

FreeSWITCH SVN anthm at freeswitch.org
Mon Feb 23 16:05:19 PST 2009


Author: anthm
Date: Mon Feb 23 18:05:19 2009
New Revision: 12257

Log:
FSCORE-308

Modified:
   freeswitch/trunk/src/switch_channel.c
   freeswitch/trunk/src/switch_core_session.c
   freeswitch/trunk/src/switch_core_sqldb.c

Modified: freeswitch/trunk/src/switch_channel.c
==============================================================================
--- freeswitch/trunk/src/switch_channel.c	(original)
+++ freeswitch/trunk/src/switch_channel.c	Mon Feb 23 18:05:19 2009
@@ -982,7 +982,9 @@
 				switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-Name", channel->name);
 				switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Unique-ID", switch_core_session_get_uuid(channel->session));
 				switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Call-Direction",
-										switch_channel_test_flag(channel, CF_OUTBOUND) ? "outbound" : "inbound");
+											   channel->direction == SWITCH_CALL_DIRECTION_OUTBOUND ? "outbound" : "inbound");
+				switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Presence-Call-Direction",
+											   channel->direction == SWITCH_CALL_DIRECTION_OUTBOUND ? "outbound" : "inbound");
 				if (switch_channel_test_flag(channel, CF_ANSWERED)) {
 					switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Answer-State", "answered");
 				} else if (switch_channel_test_flag(channel, CF_EARLY_MEDIA)) {
@@ -1230,8 +1232,13 @@
 	switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-State-Number", state_num);
 	switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-Name", switch_channel_get_name(channel));
 	switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Unique-ID", switch_core_session_get_uuid(channel->session));
+	
+	switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Call-Direction",
+								   channel->direction == SWITCH_CALL_DIRECTION_OUTBOUND ? "outbound" : "inbound");
+	switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Presence-Call-Direction",
+								   channel->direction == SWITCH_CALL_DIRECTION_OUTBOUND ? "outbound" : "inbound");
+
 
-	switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Call-Direction", switch_channel_test_flag(channel, CF_OUTBOUND) ? "outbound" : "inbound");
 	if (switch_channel_test_flag(channel, CF_ANSWERED)) {
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Answer-State", "answered");
 	} else if (switch_channel_test_flag(channel, CF_EARLY_MEDIA)) {

Modified: freeswitch/trunk/src/switch_core_session.c
==============================================================================
--- freeswitch/trunk/src/switch_core_session.c	(original)
+++ freeswitch/trunk/src/switch_core_session.c	Mon Feb 23 18:05:19 2009
@@ -269,8 +269,6 @@
 
 		switch_assert(channel != NULL);
 
-		switch_channel_set_flag(channel, CF_OUTBOUND);
-
 		forwardvar = switch_channel_get_variable(channel, SWITCH_MAX_FORWARDS_VARIABLE);
 		if (!switch_strlen_zero(forwardvar)) {
 			forwardval = atoi(forwardvar) - 1;
@@ -1100,12 +1098,12 @@
 		abort();
 	}
 
+	switch_channel_init(session->channel, session, CS_NEW, 0);
+
 	if (direction == SWITCH_CALL_DIRECTION_OUTBOUND) {
 		switch_channel_set_flag(session->channel, CF_OUTBOUND);
 	}
-
-	switch_channel_init(session->channel, session, CS_NEW, 0);
-
+	
 	/* The session *IS* the pool you may not alter it because you have no idea how
 	   its all private it will be passed to the thread run function */
 

Modified: freeswitch/trunk/src/switch_core_sqldb.c
==============================================================================
--- freeswitch/trunk/src/switch_core_sqldb.c	(original)
+++ freeswitch/trunk/src/switch_core_sqldb.c	Mon Feb 23 18:05:19 2009
@@ -285,7 +285,7 @@
 							 switch_event_get_header_nil(event, "channel-state"),
 							 switch_event_get_header_nil(event, "caller-dialplan"),
 							 switch_event_get_header_nil(event, "caller-context")
-			);
+							 );
 		break;
 	case SWITCH_EVENT_CODEC:
 		sql =



More information about the Freeswitch-svn mailing list