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

Freeswitch SVN anthm at freeswitch.org
Wed Oct 8 10:22:56 EDT 2008


Author: anthm
Date: Wed Oct  8 10:22:55 2008
New Revision: 9891

Modified:
   freeswitch/trunk/src/switch_channel.c
   freeswitch/trunk/src/switch_core_io.c

Log:
tweak evnts

Modified: freeswitch/trunk/src/switch_channel.c
==============================================================================
--- freeswitch/trunk/src/switch_channel.c	(original)
+++ freeswitch/trunk/src/switch_channel.c	Wed Oct  8 10:22:55 2008
@@ -1128,6 +1128,27 @@
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-Write-Codec-Name", switch_str_nil(codec->implementation->iananame));
 		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-Write-Codec-Rate", "%u", codec->implementation->actual_samples_per_second);
 	}
+	
+	/* Index Caller's Profile */
+	if (caller_profile) {
+		switch_caller_profile_event_set_data(caller_profile, "Caller", event);
+	}
+	
+	if (originator_caller_profile && originatee_caller_profile) {
+		/* Index Originator's Profile */
+		switch_caller_profile_event_set_data(originator_caller_profile, "Originator", event);
+		
+		/* Index Originatee's Profile */
+		switch_caller_profile_event_set_data(originatee_caller_profile, "Originatee", event);
+	} else {
+		/* Index Originator's Profile */
+		if (originator_caller_profile) {
+			switch_caller_profile_event_set_data(originator_caller_profile, "Other-Leg", event);
+		} else if (originatee_caller_profile) {	/* Index Originatee's Profile */
+			switch_caller_profile_event_set_data(originatee_caller_profile, "Other-Leg", event);
+		}
+	}
+
 
 	if (switch_test_flag(channel, CF_VERBOSE_EVENTS) || 
 		event->event_id == SWITCH_EVENT_CHANNEL_ORIGINATE ||
@@ -1137,28 +1158,10 @@
 		event->event_id == SWITCH_EVENT_CHANNEL_HANGUP ||
 		event->event_id == SWITCH_EVENT_REQUEST_PARAMS ||
 		event->event_id == SWITCH_EVENT_CHANNEL_DATA ||
+		event->event_id == SWITCH_EVENT_SESSION_HEARTBEAT ||
 		event->event_id == SWITCH_EVENT_CUSTOM
 		) {
 
-		/* Index Caller's Profile */
-		if (caller_profile) {
-			switch_caller_profile_event_set_data(caller_profile, "Caller", event);
-		}
-
-		if (originator_caller_profile && originatee_caller_profile) {
-			/* Index Originator's Profile */
-			switch_caller_profile_event_set_data(originator_caller_profile, "Originator", event);
-
-			/* Index Originatee's Profile */
-			switch_caller_profile_event_set_data(originatee_caller_profile, "Originatee", event);
-		} else {
-			/* Index Originator's Profile */
-			if (originator_caller_profile) {
-				switch_caller_profile_event_set_data(originator_caller_profile, "Other-Leg", event);
-			} else if (originatee_caller_profile) {	/* Index Originatee's Profile */
-				switch_caller_profile_event_set_data(originatee_caller_profile, "Other-Leg", event);
-			}
-		}
 		x = 0;
 		/* Index Variables */
 		if (channel->variables) {

Modified: freeswitch/trunk/src/switch_core_io.c
==============================================================================
--- freeswitch/trunk/src/switch_core_io.c	(original)
+++ freeswitch/trunk/src/switch_core_io.c	Wed Oct  8 10:22:55 2008
@@ -106,7 +106,6 @@
 	switch_status_t status;
 	int need_codec, perfect, do_bugs = 0, do_resample = 0, is_cng = 0;
 	unsigned int flag = 0;
-	switch_event_header_t *hi;
 
 	switch_assert(session != NULL);
 
@@ -131,26 +130,6 @@
 
 			switch_event_create(&event, SWITCH_EVENT_SESSION_HEARTBEAT);
 			switch_channel_event_set_data(session->channel, event);
-			if (!switch_channel_test_flag(session->channel, CF_VERBOSE_EVENTS)) {
-				if ((hi = switch_channel_variable_first(session->channel))) {
-					for (; hi; hi = hi->next) {
-						char buf[1024] = "";
-						char *vvar = NULL, *vval = NULL;
-						
-						if (strncasecmp(hi->name, "hb_", 3)) {
-							continue;
-						}
-						
-						vvar = (char *) hi->name;
-						vval = (char *) hi->value;
-						
-						switch_assert(vvar && vval);
-						switch_snprintf(buf, sizeof(buf), "variable_%s", vvar);
-						switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, buf, vval);
-					}
-					switch_channel_variable_last(session->channel);
-				}
-			}
 			switch_event_fire(&event);
 		} else {
 			session->read_frame_count--;



More information about the Freeswitch-svn mailing list