Revision
15119
Author
anthm
Date
2009-10-08 11:52:55 -0500 (Thu, 08 Oct 2009)

Log Message

add CALL_UPDATE event

Modified Paths

Diff

Modified: freeswitch/trunk/libs/esl/src/esl_event.c (15118 => 15119)


--- freeswitch/trunk/libs/esl/src/esl_event.c	2009-10-08 16:14:45 UTC (rev 15118)
+++ freeswitch/trunk/libs/esl/src/esl_event.c	2009-10-08 16:52:55 UTC (rev 15119)
@@ -128,6 +128,7 @@
 	"NAT",
 	"RECORD_START",
 	"RECORD_STOP",
+	"CALL_UPDATE",
 	"ALL"
 };
 

Modified: freeswitch/trunk/libs/esl/src/include/esl_event.h (15118 => 15119)


--- freeswitch/trunk/libs/esl/src/include/esl_event.h	2009-10-08 16:14:45 UTC (rev 15118)
+++ freeswitch/trunk/libs/esl/src/include/esl_event.h	2009-10-08 16:52:55 UTC (rev 15119)
@@ -116,6 +116,7 @@
 	ESL_EVENT_NAT,
 	ESL_EVENT_RECORD_START,
 	ESL_EVENT_RECORD_STOP,
+	ESL_EVENT_CALL_UPDATE,
 	ESL_EVENT_ALL
 } esl_event_types_t;
 

Modified: freeswitch/trunk/src/include/switch_types.h (15118 => 15119)


--- freeswitch/trunk/src/include/switch_types.h	2009-10-08 16:14:45 UTC (rev 15118)
+++ freeswitch/trunk/src/include/switch_types.h	2009-10-08 16:52:55 UTC (rev 15119)
@@ -1290,6 +1290,7 @@
 	SWITCH_EVENT_NAT,
 	SWITCH_EVENT_RECORD_START,
 	SWITCH_EVENT_RECORD_STOP,
+	SWITCH_EVENT_CALL_UPDATE,
 	SWITCH_EVENT_ALL
 } switch_event_types_t;
 

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (15118 => 15119)


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	2009-10-08 16:14:45 UTC (rev 15118)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	2009-10-08 16:52:55 UTC (rev 15119)
@@ -1284,6 +1284,7 @@
 			if (!switch_strlen_zero(name)) {
 				char message[256] = "";
 				const char *ua = switch_channel_get_variable(tech_pvt->channel, "sip_user_agent");
+				switch_event_t *event;
 
 				if (switch_strlen_zero(number)) {
 					number = tech_pvt->caller_profile->destination_number;
@@ -1303,6 +1304,22 @@
 							   TAG_END());
 				}
 
+
+				
+				if (switch_event_create(&event, SWITCH_EVENT_CALL_UPDATE) == SWITCH_STATUS_SUCCESS) {
+					const char *uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
+					switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Direction", "SEND");
+					switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Callee-Name", name);
+					switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Callee-Number", number);
+					if (uuid) {
+						switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridged-To", uuid);
+					}
+					switch_channel_event_set_data(channel, event);
+					switch_event_fire(&event);
+				}
+
+
+
 			}
 
 			switch_safe_free(arg);

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (15118 => 15119)


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	2009-10-08 16:14:45 UTC (rev 15118)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	2009-10-08 16:52:55 UTC (rev 15119)
@@ -420,6 +420,7 @@
 	const char *number = "unknown", *tmp;
 	switch_caller_profile_t *caller_profile;
 	char *dup = NULL;
+	switch_event_t *event;
 
 	if (sip->sip_to) {
 		number = sip->sip_to->a_url->url_user;
@@ -450,6 +451,18 @@
 		number = tmp;
 	}
 
+	if (switch_event_create(&event, SWITCH_EVENT_CALL_UPDATE) == SWITCH_STATUS_SUCCESS) {
+		const char *uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Direction", "RECV");
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Callee-Name", name);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Callee-Number", number);
+		if (uuid) {
+			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridged-To", uuid);
+		}
+		switch_channel_event_set_data(channel, event);
+		switch_event_fire(&event);
+	}
+	
 	caller_profile = switch_channel_get_caller_profile(channel);
 	caller_profile->callee_id_name = switch_core_strdup(caller_profile->pool, name);
 	caller_profile->callee_id_number = switch_core_strdup(caller_profile->pool, number);
@@ -5673,6 +5686,7 @@
 						   TAG_IF(!switch_strlen_zero(b_tech_pvt->user_via), SIPTAG_VIA_STR(b_tech_pvt->user_via)),
 						   TAG_END());
 			}
+
 		}
 	}
 }

Modified: freeswitch/trunk/src/switch_channel.c (15118 => 15119)


--- freeswitch/trunk/src/switch_channel.c	2009-10-08 16:14:45 UTC (rev 15118)
+++ freeswitch/trunk/src/switch_channel.c	2009-10-08 16:52:55 UTC (rev 15119)
@@ -1408,6 +1408,7 @@
 		event->event_id == SWITCH_EVENT_API ||
 		event->event_id == SWITCH_EVENT_RECORD_START ||
 		event->event_id == SWITCH_EVENT_RECORD_STOP ||
+		event->event_id == SWITCH_EVENT_CALL_UPDATE ||
 		event->event_id == SWITCH_EVENT_CUSTOM
 		) {
 

Modified: freeswitch/trunk/src/switch_event.c (15118 => 15119)


--- freeswitch/trunk/src/switch_event.c	2009-10-08 16:14:45 UTC (rev 15118)
+++ freeswitch/trunk/src/switch_event.c	2009-10-08 16:52:55 UTC (rev 15119)
@@ -182,6 +182,7 @@
 	"NAT",
 	"RECORD_START",
 	"RECORD_STOP",
+	"CALL_UPDATE"
 	"ALL"
 };