Summary:ASTERISK-07457: [patch][post 1.4] ControlPlayback option to start at an offset and report the offset where playback stopped.
Reporter:John Williams (sharkey)Labels:
Date Opened:2006-08-03 12:37:49Date Closed:2007-07-11 19:59:25
Versions:Frequency of
Environment:Attachments:( 0) controlplayback-offset-trunk.patch
Description:We are playing back a long sound file (phone training or recorded conference call) to users.  We want to know how much of the file they listened to for reporting, and be able to restart where they left off if they hang up and call back.


The attached patch adds an "o#" option to ControlPlayback to indicate where playback should start (# in ms).  Negative # is offset from the end.  And "o-1" is a cleaner alternative to the ugly "filename:end" hack I saw in the code.

When playback stops it sets channel variable CPLAYBACKOFFSET to indicate where it stopped (in ms).  It is set to -1 to indicated end-of-file.

Here is a small extensions.conf snippit for testing.  Supply your own LongSoundFile.
exten => s,1,answer
exten => s,2,wait,1
exten => s,3,ControlPlayback(LongSoundFile,4000,3,1,*,2,,o-1)
exten => s,4,saydigits,${CPLAYBACKOFFSET}
exten => s,5,read,offset
exten => s,6,ControlPlayback(LongSoundFile,4000,3,1,*,2,,o${offset})
exten => s,7,saydigits,${CPLAYBACKOFFSET}
exten => s,8,wait,1
exten => s,9,hangup

I also have the patch for the 1.2 branch, if needed.

If it is preferable, I can resubmit as a new application.
Comments:By: Serge Vecher (serge-v) 2006-09-06 10:39:35

disclaimer needs to be filed in order for review to take place here.

By: John Williams (sharkey) 2006-09-08 14:37:53

I just faxed in my disclaimer.
Please also update Issue # 7827 to show the disclaimer is on file.

By: vortex_0_o (vortex_0_o) 2006-09-11 10:48:55

this is handy sharkey! :)

Just wish there was also a version that has multiple skip levels - something like:

By: jmls (jmls) 2007-02-11 03:40:34.000-0600

ping. housekeeping.

By: Russell Bryant (russell) 2007-06-08 16:02:39

This patch has been committed with some slight modifications to trunk in revision 68502.  Thanks!