[Freeswitch-svn] [commit] r4300 - in freeswitch/trunk/src: . include mod/applications/mod_park

Freeswitch SVN anthm at freeswitch.org
Fri Feb 16 16:32:49 EST 2007


Author: anthm
Date: Fri Feb 16 16:32:49 2007
New Revision: 4300

Modified:
   freeswitch/trunk/src/include/switch_ivr.h
   freeswitch/trunk/src/mod/applications/mod_park/mod_park.c
   freeswitch/trunk/src/switch_ivr.c

Log:
add callbacks to park

Modified: freeswitch/trunk/src/include/switch_ivr.h
==============================================================================
--- freeswitch/trunk/src/include/switch_ivr.h	(original)
+++ freeswitch/trunk/src/include/switch_ivr.h	Fri Feb 16 16:32:49 2007
@@ -77,7 +77,7 @@
 */
 SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session, uint32_t ms);
 
-SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session);
+SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session, switch_input_args_t *args);
 
 /*!
   \brief Wait for DTMF digits calling a pluggable callback function when digits are collected.

Modified: freeswitch/trunk/src/mod/applications/mod_park/mod_park.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_park/mod_park.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_park/mod_park.c	Fri Feb 16 16:32:49 2007
@@ -34,7 +34,7 @@
 
 static void park_function(switch_core_session_t *session, char *data)
 {
-	switch_ivr_park(session);
+	switch_ivr_park(session, NULL);
 	
 }
 

Modified: freeswitch/trunk/src/switch_ivr.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr.c	(original)
+++ freeswitch/trunk/src/switch_ivr.c	Fri Feb 16 16:32:49 2007
@@ -143,7 +143,7 @@
 
 }
 
-SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session)
+SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session, switch_input_args_t *args)
 {
 	switch_status_t status = SWITCH_STATUS_SUCCESS;
 	switch_channel_t *channel;
@@ -177,11 +177,22 @@
 			if (switch_channel_has_dtmf(channel)) {
                 char dtmf[128];
                 switch_channel_dequeue_dtmf(channel, dtmf, sizeof(dtmf));
+				if (args && args->input_callback) {
+					if ((status = args->input_callback(session, dtmf, SWITCH_INPUT_TYPE_DTMF, args->buf, args->buflen)) != SWITCH_STATUS_SUCCESS) {
+						break;
+					}
+				}
             }
 
             if (switch_core_session_dequeue_event(session, &event) == SWITCH_STATUS_SUCCESS) {
-                switch_channel_event_set_data(channel, event);
-                switch_event_fire(&event);
+				if (args && args->input_callback) {
+					if ((status = args->input_callback(session, event, SWITCH_INPUT_TYPE_EVENT, args->buf, args->buflen)) != SWITCH_STATUS_SUCCESS) {
+						break;
+					}
+				} else {
+					switch_channel_event_set_data(channel, event);
+					switch_event_fire(&event);
+				}
             }
         }
 		



More information about the Freeswitch-svn mailing list