[asterisk-dev] [Asterisk 0011377]: added a return variable to app_controlplayback that reports the key used to stop playback.

Jason Parker jparker at digium.com
Wed Dec 12 10:54:25 CST 2007


Johan Wilfer wrote:
> Hi,
> Qwell submitted this patch from me to trunk. To summarize the feature 
> app_controlplayback now
> reports the key used to stop playback. This allows the user to have 
> multiple stop keys and do all
> kind of fancy logic in the dialplan. I for example have one key (*) that 
> plays an instruction how to
> use the keypad.
> 
> Together with this patch I suggested that the original behavior to use * 
> and # as fast forward / rewind
> is changed. Qwell said that this should be discussed separately so here 
> we go :)
> 
> My suggestion is to simply default to no forward / rewind key. Because 
> if you would like to
> use your own logic in the dialplan and don't want to use the forward / 
> rewind you still have to provide
> two keys for this along with 0 as skip argument to neutralize this default.
> 
> Maybe the current default doesn't make sense anyway, and should be 
> changed. As stated on voip-info.org:
> "Note that as the *** key is on the left and the *#* button is on the 
> right of a  telephone keypad, it may make
> more sense to swap the default buttons: use *** for rewind and *#* for 
> forward."
> 
> Comments?
> Could we remove these defaults?
> /Johan
> 

I might as well throw in my $2.50, since my comment prompted this. :)

I'm a bit torn.  On one hand, I fully agree that forcing defaults is bad and
in your case, unwelcome.

On the other hand, I don't know if it would be a good idea to change the
defaults, as that would be an unexpected change in behavior (however, it would
only go in trunk, and can thus be documented in UPGRADE.txt)

Perhaps what would make sense, is some mixture of both.  If you just do
ControlPlayback(filename), I think * and # should be ffwd and rew (I also
agree that they are backwards...).  However, if you do
ControlPlayback(filename,,,,), I think maybe it could set them to NULL.  The
only problem I can see with this method, is that it would be an unexpected
change, if you only INTENDED to change skipms (or whatever is after ffwd and rew).

Another thought I had, was that in your case, you're wanting to set every key
to be a stop key.  What if we left the default behavior, except in the case
where stopkey has a key that would normally be a default (ffwd and rew)?  For
instance: ControlPlayback(filename,123456789*0).  In this case, * would be
ONLY a stop key, and # would continue to rewind.  If you were to put # into
stopkeys, then it would no longer act as rew.


I think I like the last method the best.  Thoughts?

-- 
Jason Parker
Digium



More information about the asterisk-dev mailing list