Revision
14752
Author
anthm
Date
2009-09-02 15:43:49 -0500 (Wed, 02 Sep 2009)

Log Message

jump to a specific offset with the playback by appending @@<samples> to the path

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c (14751 => 14752)


--- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	2009-09-02 20:38:51 UTC (rev 14751)
+++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	2009-09-02 20:43:49 UTC (rev 14752)
@@ -1859,12 +1859,28 @@
 	switch_input_args_t args = { 0 };
 	switch_channel_t *channel = switch_core_session_get_channel(session);
 	switch_status_t status = SWITCH_STATUS_SUCCESS;
+	switch_file_handle_t fh = { 0 };
+	char *p;
+	const char *file = NULL;
+	
+	if (data) {
+		file = switch_core_session_strdup(session, data);
+		if ((p = strchr(file, '@')) && *(p+1) == '@') {
+			*p = '\0';
+			p += 2;
+			if (p && *p) {
+				fh.samples = atoi(p);
+			}
+		}
+	} else {
+		file = data;
+	}
 
 	args.input_callback = on_dtmf;
 
 	switch_channel_set_variable(channel, SWITCH_PLAYBACK_TERMINATOR_USED, "" );
 
-	status = switch_ivr_play_file(session, NULL, data, &args);
+	status = switch_ivr_play_file(session, &fh, file, &args);
 
 	switch (status) {
 	case SWITCH_STATUS_SUCCESS: