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

Freeswitch SVN anthm at freeswitch.org
Mon Sep 15 10:32:24 EDT 2008


Author: anthm
Date: Mon Sep 15 10:32:23 2008
New Revision: 9567

Modified:
   freeswitch/trunk/src/switch_caller.c

Log:
expose time table to variable interface via caller field lookup 

Modified: freeswitch/trunk/src/switch_caller.c
==============================================================================
--- freeswitch/trunk/src/switch_caller.c	(original)
+++ freeswitch/trunk/src/switch_caller.c	Mon Sep 15 10:32:23 2008
@@ -207,6 +207,29 @@
 	if (!strcasecmp(name, "privacy_hide_number")) {
 		return switch_test_flag(caller_profile, SWITCH_CPF_HIDE_NUMBER) ? "true" : "false";
 	}
+	if (!strcasecmp(name, "profile_created_time")) {
+		return switch_core_sprintf(caller_profile->pool, "%" SWITCH_TIME_T_FMT, caller_profile->times->profile_created);		
+	}
+	if (!strcasecmp(name, "created_time")) {
+		return switch_core_sprintf(caller_profile->pool, "%" SWITCH_TIME_T_FMT, caller_profile->times->created);		
+	}
+	if (!strcasecmp(name, "answered_time")) {
+		return switch_core_sprintf(caller_profile->pool, "%" SWITCH_TIME_T_FMT, caller_profile->times->answered);		
+	}
+	if (!strcasecmp(name, "progress_time")) {
+		return switch_core_sprintf(caller_profile->pool, "%" SWITCH_TIME_T_FMT, caller_profile->times->progress);		
+	}
+	if (!strcasecmp(name, "progress_media_time")) {
+		return switch_core_sprintf(caller_profile->pool, "%" SWITCH_TIME_T_FMT, caller_profile->times->progress_media);		
+	}
+	if (!strcasecmp(name, "hungup_time")) {
+		return switch_core_sprintf(caller_profile->pool, "%" SWITCH_TIME_T_FMT, caller_profile->times->hungup);		
+	}
+	if (!strcasecmp(name, "transferred_time")) {
+		return switch_core_sprintf(caller_profile->pool, "%" SWITCH_TIME_T_FMT, caller_profile->times->transferred);		
+	}
+	
+
 	return NULL;
 }
 
@@ -271,10 +294,16 @@
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->profile_index);
 	}
 	if (caller_profile->times) {
+		switch_snprintf(header_name, sizeof(header_name), "%s-Profile-Created-Time", prefix);
+		switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%" SWITCH_TIME_T_FMT, caller_profile->times->profile_created);
 		switch_snprintf(header_name, sizeof(header_name), "%s-Channel-Created-Time", prefix);
 		switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%" SWITCH_TIME_T_FMT, caller_profile->times->created);
 		switch_snprintf(header_name, sizeof(header_name), "%s-Channel-Answered-Time", prefix);
 		switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%" SWITCH_TIME_T_FMT, caller_profile->times->answered);
+		switch_snprintf(header_name, sizeof(header_name), "%s-Channel-Progress-Time", prefix);
+		switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%" SWITCH_TIME_T_FMT, caller_profile->times->progress);		
+		switch_snprintf(header_name, sizeof(header_name), "%s-Channel-Progress-Media-Time", prefix);
+		switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%" SWITCH_TIME_T_FMT, caller_profile->times->progress_media);
 		switch_snprintf(header_name, sizeof(header_name), "%s-Channel-Hangup-Time", prefix);
 		switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%" SWITCH_TIME_T_FMT, caller_profile->times->hungup);
 		switch_snprintf(header_name, sizeof(header_name), "%s-Channel-Transfer-Time", prefix);



More information about the Freeswitch-svn mailing list