From 3fd795ae71d7d72f920945c4f09908181bc08e5b Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 2 Sep 2009 20:43:49 +0000 Subject: [PATCH] jump to a specific offset with the playback by appending @@ to the path git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14752 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/applications/mod_dptools/mod_dptools.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c index 8a8f0279c7..a4a32f4caf 100644 --- a/src/mod/applications/mod_dptools/mod_dptools.c +++ b/src/mod/applications/mod_dptools/mod_dptools.c @@ -1859,12 +1859,28 @@ SWITCH_STANDARD_APP(playback_function) 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: