How Do I Extract CPLAYBACKOFFSET From ARI Playback?

Home » Asterisk Users » How Do I Extract CPLAYBACKOFFSET From ARI Playback?
Asterisk Users 3 Comments

Following the playback.js ari-client example, I now need to store the current playback offsetms, either when it was skipped or hung up on. But I can’t seem to find it. I know that https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Application_ControlPlayback sets CPLAYBACKOFFSET but that variable doesn’t seem to be set by the ARI
request.

Nor is there any info in the “get playback” information request, in fact, it doesn’t seem to exist anywhere.

Internally, it must know the point at which it was paused to set the correct offsetms when it is restarted – so how can I get this?
What I want to try and avoid is stuff like starting a timer and then having to manually track all the skips back and forth etc. Thanks.

What have I tried? Reading all of this!
https://wiki.asterisk.org/wiki/display/AST/Introduction+to+ARI+and+Channels#IntroductiontoARIandChannels-channel-dump.js https://wiki.asterisk.org/wiki/display/AST/Introduction+to+ARI+and+Channels https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Playbacks+REST+API
https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Asterisk+REST+API
https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Application_ControlPlayback https://github.com/asterisk/asterisk/blob/91fc57f56bd25d9bf28d44486d9e97ada1daafa9/res/res_stasis_playback.c https://github.com/asterisk/asterisk/blob/773f424c7f7d54a8fa585deaa815cacdf1557e2b/apps/app_controlplayback.c

3 thoughts on - How Do I Extract CPLAYBACKOFFSET From ARI Playback?

  • The information is not currently exposed. ARI would have to be extended to provide it in some manner.

  • OK – thanks for clarifying. So my choices are to keep track with my own timer, OR switch back to diaplan / AGI and use controlplayback for this case?

    Now I’m getting my head round ARI I’m loving it – would just love to know where I’m going wrong with piping rtp into externalmedia (see my other post from last night)

    Thanks.

  • Yes.

    As with everything if I have anything of value to add to a post be it here or on the community forum then I’ll respond when I can.