[Freeswitch-svn] [commit] r8039 - in freeswitch/trunk/src: include mod/applications/mod_fifo

Freeswitch SVN anthm at freeswitch.org
Sat Apr 5 11:48:13 EDT 2008


Author: anthm
Date: Sat Apr  5 11:48:12 2008
New Revision: 8039

Modified:
   freeswitch/trunk/src/include/switch_cpp.h
   freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c

Log:
add fifo_record_template

Modified: freeswitch/trunk/src/include/switch_cpp.h
==============================================================================
--- freeswitch/trunk/src/include/switch_cpp.h	(original)
+++ freeswitch/trunk/src/include/switch_cpp.h	Sat Apr  5 11:48:12 2008
@@ -91,6 +91,13 @@
 } session_flag_t;
 
 
+class switchEvent {
+ protected:
+	switch_event_t *event;
+ public:
+	switchEvent(switch_event_types_t event_id, const char *subclass_name);
+};
+
 class CoreSession {
  protected:
 	switch_input_args_t args; // holds ptr to cb function and input_callback_state struct

Modified: freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c	Sat Apr  5 11:48:12 2008
@@ -797,7 +797,9 @@
                 switch_channel_t *other_channel = switch_core_session_get_channel(other_session);
                 switch_caller_profile_t *cloned_profile;
 				const char *o_announce = NULL;
-
+				const char *record_template = switch_channel_get_variable(channel, "fifo_record_template");
+				char *expanded = NULL;
+				
 				if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, FIFO_EVENT) == SWITCH_STATUS_SUCCESS) {
                     switch_channel_event_set_data(other_channel, event);
                     switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Name", "%s", argv[0]);
@@ -864,8 +866,21 @@
                 switch_mutex_lock(node->mutex);
                 send_presence(node);
                 switch_mutex_unlock(node->mutex);
+
+				if (record_template) {
+					expanded = switch_channel_expand_variables(other_channel, record_template);
+					switch_ivr_record_session(session, expanded, 0, NULL);
+				}
+
                 switch_ivr_multi_threaded_bridge(session, other_session, on_dtmf, other_session, session);
 
+				if (record_template) {
+					switch_ivr_stop_record_session(session, expanded);
+					if (expanded != record_template) {
+						switch_safe_free(expanded);
+					}
+				}
+
                 ts = switch_timestamp_now();
                 switch_time_exp_lt(&tm, ts);
                 switch_strftime(date, &retsize, sizeof(date), "%Y-%m-%d %T", &tm);



More information about the Freeswitch-svn mailing list