Summary:ASTERISK-07992: [patch] extend ControlPlayback to fwd/rew file with different speeds
Reporter:Sergey Tamkovich (sergee)Labels:
Date Opened:2006-10-24 09:22:57Date Closed:2008-01-05 06:18:02.000-0600
Versions:Frequency of
Environment:Attachments:( 0) cp2.diff
( 1) cp2-branch12.diff
( 2) cp2-v2.diff
( 3) cp-r64901.diff
( 4) playback-r62670.diff
Description:When you want to listen files through asterisk, you can always use ContolPlayback. But when your files are big, it is not very comfort to use this app, because there is no choice for fwd/rew speed.

So here is new app which allows you to fwd/rew your file with multiple speeds.




this will create 3 groups of buttons:

group 1:

skip time: 1000ms
ffwd: 1
rew:  3

group 2:

skip time: 3000ms
ffwd: 4
rew:  6

group 3:

skip time: 5000ms
ffwd: 7
rew:  9

Comments:By: Sergey Tamkovich (sergee) 2006-10-25 04:23:18

Backport for branch 1.2

cp2-branch12.diff - patch for asterisk-1.2

URL: http://svn.digium.com/svn/asterisk/branches/1.2
Revision: 46117

By: Sergey Tamkovich (sergee) 2006-10-26 08:57:07

i improved this app a little bit and here is a new patch (cp2-v2.diff) it made against TRUNK revision 46307.

Main changes:

1. I rewrote all internal APIs, now all buttons are stored in a list, so we don't have any limits with quantity of parameters now.

2. It doesn't create new app anymore, it imroves standard app (ControlPlayback)

3. Usage was changed a little bit, to keep compatability with standard app, new usage:


so all additional buttons for fastforwarding/rewinding are in the end of parameter's list, number of parameters aren't limited.

Example of usage:

this will create 3 groups of buttons:

group 1:

skip time: 1000ms
ffwd: #
rew: *

group 2:

skip time: 3000ms
ffwd: 9
rew: 7

group 3:

skip time: 5000ms
ffwd: 6
rew: 4

By: BJ Weschke (bweschke) 2006-10-27 14:15:01

sergee - the latest patches looks really good. the only other thing I would want to take a closer look at now is with the changes to the internal API, are we duplicating code anywhere, and can we eliminate duplicated code inside original API functions with the stub call to your new API functions? Thanks. BJ

By: Serge Vecher (serge-v) 2006-10-27 14:44:38

also, would it be possible to add this functionality to ControlPlayback() instead of creating a new app?

By: Sergey Tamkovich (sergee) 2006-10-27 16:14:43

serge-v,  cp2-v2.diff - adds new functionality to ControlPlayback instead of creating new app.

bweschke, i'm not sure about quality of my code :) also i see 1 thing that can be improved - i use my own linked lists, i think it would be better to use builtin Macros AST_LIST... - something like that.

As for duplicating API, yes we are duplicating API cause my *_multispeed_* calls are general cases of some existing calls. In future, we can replace all standard calls like ast_waitstream_fr() with ast_waitstream_multispeed_fr(), because ast_waitstream_fr() is a custom case of ast_waitstream_multispeed_fr() (with 1 parameter in ast_playcontrols list).
Complete replacement without any "shell" calls - to keep code clean and clear.

But i think that we should do it in separate patch - not here.

By: jmls (jmls) 2006-12-10 08:05:41.000-0600

so where are we with *this* patch ?

By: Sergey Tamkovich (sergee) 2006-12-11 01:27:22.000-0600

jmls, cp2-v2.diff - adds new functionality.
After v2 patch, i didn't recieve any bugreports or requests
so i suppose this patch is ideal :))

By: vortex_0_o (vortex_0_o) 2007-01-19 09:31:38.000-0600

the patch for 1.2 is working fine for me.

would be ideal if there was user feedback that the skip has taken place (dtmf has been received)something like:

user presses key
asterisk respond with a quick double beep
skip fwd / back

By: Serge Vecher (serge-v) 2007-01-25 12:58:33.000-0600

since this is a new feature, it's preferable to get feedback on the trunk patch.

By: Sergey Tamkovich (sergee) 2007-05-02 09:56:50

Patch for current trunk (62670) uploaded.

By: Sergey Tamkovich (sergee) 2007-05-18 02:59:26

new patch uploaded.

i made changes to the code according to bweschke's advices. I changed all calloc to ast_calloc. as for AST_STANDARD_APP_ARGS(args, data); i decided not to use it yet, because  it doesn't suit very well for variable arglist IMHO.

By: BJ Weschke (bweschke) 2007-05-24 10:23:33

I'm going to open a branch on this one as I think there's some more cleanup/testing to do given that these are core functions we're talking about introducing. We can make changes and do testing from there.

By: Sergey Tamkovich (sergee) 2007-05-29 03:10:14

Great idea! looking forward to see it in http://svn.digium.com/view/asterisk/team/bweschke/

By: Sergey Tamkovich (sergee) 2007-08-03 01:17:58

bweschke, any progress in testing?
Looks nice for me, using it in production more then 2 months!

By: Sergey Tamkovich (sergee) 2008-01-04 15:51:11.000-0600

Works nice for me more then 6 month on loaded prodcuction system.

By: Sergey Tamkovich (sergee) 2008-01-04 15:58:43.000-0600

tomorrow i will update this patch against current trunk.

By: Sergey Tamkovich (sergee) 2008-01-05 02:57:54.000-0600

10 months have passed since this feature was marked as "ready for testing". But unfortunately nobody has enough time to merge it to trunk, although testers didn't report any problems. Right now current version of app_controlplayback is complately incompatable with this patch. I think it isn't worth an efforts to update this thing, So this issue can be closed.

By: Michiel van Baak (mvanbaak) 2008-01-05 06:18:01.000-0600

Closed on reporters request