[Freeswitch-svn] [commit] r8955 - in freeswitch/trunk/src: . include

Freeswitch SVN anthm at freeswitch.org
Wed Jul 9 12:03:04 EDT 2008


Author: anthm
Date: Wed Jul  9 12:03:03 2008
New Revision: 8955

Modified:
   freeswitch/trunk/src/include/switch_types.h
   freeswitch/trunk/src/switch_ivr_bridge.c

Log:
add copy_xml_cdr variable

Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h	(original)
+++ freeswitch/trunk/src/include/switch_types.h	Wed Jul  9 12:03:03 2008
@@ -100,6 +100,7 @@
 #define SWITCH_PATH_SEPARATOR "/"
 #endif
 #define SWITCH_URL_SEPARATOR "://"
+#define SWITCH_COPY_XML_CDR_VARIABLE "copy_xml_cdr"
 #define SWITCH_CURRENT_APPLICATION_VARIABLE "current_application"
 #define SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE "proto_specific_hangup_cause"
 #define SWITCH_CHANNEL_EXECUTE_ON_ANSWER_VARIABLE "execute_on_answer"

Modified: freeswitch/trunk/src/switch_ivr_bridge.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_bridge.c	(original)
+++ freeswitch/trunk/src/switch_ivr_bridge.c	Wed Jul  9 12:03:03 2008
@@ -382,6 +382,20 @@
 		switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
 	}
 
+	if (switch_true(switch_channel_get_variable(channel, SWITCH_COPY_XML_CDR_VARIABLE))) {
+		switch_xml_t cdr;
+		char *xml_text;
+
+		if (switch_ivr_generate_xml_cdr(session, &cdr) == SWITCH_STATUS_SUCCESS) {
+			if ((xml_text = switch_xml_toxml(cdr, SWITCH_FALSE))) {
+				switch_channel_set_variable_partner(channel, "b_leg_cdr", xml_text);
+				switch_safe_free(xml_text);
+			}
+			switch_xml_free(cdr);
+		}
+	}
+
+
 	return SWITCH_STATUS_FALSE;
 }
 



More information about the Freeswitch-svn mailing list