[Freeswitch-svn] [commit] r2403 - in freeswitch/trunk/src/mod/applications: mod_dptools mod_playback

Freeswitch SVN mikej at freeswitch.org
Sat Aug 26 17:21:03 EDT 2006


Author: mikej
Date: Sat Aug 26 17:21:02 2006
New Revision: 2403

Modified:
   freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
   freeswitch/trunk/src/mod/applications/mod_playback/mod_playback.c

Log:
add answer application, change playback to preanswer by default.

Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	Sat Aug 26 17:21:02 2006
@@ -45,6 +45,14 @@
 	}
 }
 
+static void answer_function(switch_core_session_t *session, char *data)
+{
+	switch_channel_t *channel;
+	channel = switch_core_session_get_channel(session);
+    assert(channel != NULL);
+	switch_channel_answer(channel);
+}
+
 static void set_function(switch_core_session_t *session, char *data)
 {
 	switch_channel_t *channel;
@@ -118,11 +126,19 @@
 	/*.application_function */ set_function
 };
 
+static const switch_application_interface_t answer_application_interface = {
+	/*.interface_name */ "answer",
+	/*.application_function */ answer_function,
+	NULL,NULL,NULL,
+	&set_application_interface
+
+};
+
 static const switch_application_interface_t strftime_application_interface = {
 	/*.interface_name */ "strftime",
 	/*.application_function */ strftime_function,
 	NULL,NULL,NULL,
-	&set_application_interface
+	&answer_application_interface
 
 };
 

Modified: freeswitch/trunk/src/mod/applications/mod_playback/mod_playback.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_playback/mod_playback.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_playback/mod_playback.c	Sat Aug 26 17:21:02 2006
@@ -91,7 +91,7 @@
 		switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
 	}
 
-	switch_channel_answer(channel);
+	switch_channel_pre_answer(channel);
 	switch_ivr_speak_text(session, engine, voice, timer_name, codec->implementation->samples_per_second, on_dtmf, text, buf, sizeof(buf));
 	
 }



More information about the Freeswitch-svn mailing list