[SOLVED] Bookmarking ControlPlayBack (second try)

Hi,

EDIT: I forgot that I already asked about this here (Bookmarking ControlPlayBack). Other than using local channels does my idea below of having an option to set the stop option to multiple numbers (e.g. exploded by say a - or some other character) sound sound?

I am using control PlayBack and we have a customer that wants to be able to book mark from ControlPlayBack. I want the caller to press X to just exit the file and Y to exit and do some bookmark magic. Looking at the docs for app ControlPlayBack there is a variable called CPLAYBACKSTOPKEY which would tell me the button they pressed to exit the file PlayBack however the STOP option for App ControlPlayBack takes only one single number. I was thinking of using features.conf to add an option so they can press an alt key that would then set a variable to let us know to bookmark and then send the DTMF to the channel that would then stop the PlayBack. We would then look at CPLAYBACKSTOPKEY to figure out if they pressed X or Y and only bookmark if they press Y. It seems it would be easier to modify control_streamfile and explode “const char *stop,” say based on - so we can have multiple keys to stop. Does that make sense or is it better to to do it via features.conf?

Unless I am misunderstanding… This should work.

exten => s,n(play),ControlPlayback(custom/${audioFileName},,,,183,,,)
exten => s,n,GotoIf($["${CPLAYBACKSTOPKEY}" = "1"]?drop)
exten => s,n,GotoIf($["${CPLAYBACKSTOPKEY}" = "3"]?exit)
exten => s,n,Gosubif($["${CPLAYBACKSTOPKEY}" = "8"]?playback-set-bookmark,s,1(${CPLAYBACKOFFSET})) 
1 Like

Thank you very much, that worked like a charm. The documentation gave the impression that only one digit could be used.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.