]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
jump to a specific offset with the playback by appending @@<samples> to the path
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 2 Sep 2009 20:43:49 +0000 (20:43 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 2 Sep 2009 20:43:49 +0000 (20:43 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14752 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_dptools/mod_dptools.c

index 8a8f0279c7b81ee6bf07743250c241b1f76a6e48..a4a32f4cafe18c6b56744f4192a0d697f32fb923 100644 (file)
@@ -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: