Summary:ASTERISK-10888: added a return variable to app_controlplayback that reports the key used to stop playback.
Reporter:Johan Wilfer (johan)Labels:
Date Opened:2007-11-26 09:08:47.000-0600Date Closed:2007-12-11 15:17:08.000-0600
Versions:Frequency of
Environment:Attachments:( 0) patch-appcontrolplayback.txt
Description:Previously there have been patches to app_controlplayback that added features like multiple skip speeds on different buttons. This patch will allow these features to be designed in the users dialplan insted.

When the user stops the playback with one of his stop keys the variable CPLAYBACKSTOPKEY is set to indicate which key was used.

By calling app_controlplayback with ControlPlayback(ss-noservice,,,,0123456789*#) as an extreme example you can do all handling of skipping in the dialplan.


I've also removed the standard * and # as forward / rewind. This is to let app_controlplayback be used without skip's at all as shown in example above.
However, this isn't crucial to the patch and could be ignored.

To test out this varible you can use the following code (ael):

context default {
       _.X => {
               while(true) {
                       Noop(CPLAYBACKSTATUS ${CPLAYBACKSTATUS});
                       Noop(CPLAYBACKOFFSET ${CPLAYBACKOFFSET});
                       Noop(CPLAYBACKSTOPKEY: ${CPLAYBACKSTOPKEY});
Comments:By: Johan Wilfer (johan) 2007-11-27 07:20:58.000-0600

Also, the usage of this isn't limited to different skip speeds. For example I use * (star) to read the instructions how to use the key pad. Because both the stop key and position in the file is reported to the dialplan it is easy to start playing the recoring again after the instruction has been played.

At first this patch were written for 1.4 and I've used it in 2-3 months in production (together with the patch that provided the o-option and reported the position) I could provide this patch as well however.

By: Digium Subversion (svnbot) 2007-12-11 15:15:17.000-0600

Repository: asterisk
Revision: 92401

U   trunk/apps/app_controlplayback.c

r92401 | qwell | 2007-12-11 15:15:16 -0600 (Tue, 11 Dec 2007) | 4 lines

Add variable to show which key was pressed to stop playback.

Issue ASTERISK-10888, initial patch by johan.



By: Jason Parker (jparker) 2007-12-11 15:17:07.000-0600

I elected to only set the variable when the status is USERSTOPPED.

I also elected not to change the fwd and rev defaults here.  That should be opened as a separate bug, and we can discuss the merits of that there.