From 557125664da831cd332b6bab9d3da219fd484c63 Mon Sep 17 00:00:00 2001 From: "David M. Lee" Date: Thu, 23 May 2013 20:21:16 +0000 Subject: This patch adds support for controlling a playback operation from the Asterisk REST interface. This adds the /playback/{playbackId}/control resource, which may be POSTed to to pause, unpause, reverse, forward or restart the media playback. Attempts to control a playback that is not currently playing will either return a 404 Not Found (because the playback object no longer exists) or a 409 Conflict (because the playback object is still in the queue to be played). This patch also adds skipms and offsetms parameters to the /channels/{channelId}/play resource. (closes issue ASTERISK-21587) Review: https://reviewboard.asterisk.org/r/2559 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389603 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- rest-api/api-docs/channels.json | 19 ++++++++++++++++++- rest-api/api-docs/playback.json | 25 +++++++++++++++++++------ 2 files changed, 37 insertions(+), 7 deletions(-) (limited to 'rest-api') diff --git a/rest-api/api-docs/channels.json b/rest-api/api-docs/channels.json index 3b4d4d486..cb0332414 100644 --- a/rest-api/api-docs/channels.json +++ b/rest-api/api-docs/channels.json @@ -408,11 +408,28 @@ }, { "name": "lang", - "description": "For sounds, selects language for sound", + "description": "For sounds, selects language for sound.", "paramType": "query", "required": false, "allowMultiple": false, "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of media to skip before playing.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int" + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000 } ], "errorResponses": [ diff --git a/rest-api/api-docs/playback.json b/rest-api/api-docs/playback.json index aa758781c..38ca5e1a7 100644 --- a/rest-api/api-docs/playback.json +++ b/rest-api/api-docs/playback.json @@ -73,16 +73,29 @@ "allowableValues": { "valueType": "LIST", "values": [ - "play", + "restart", "pause", - "rewind", - "fast-forward", - "speed-up", - "slow-down" + "unpause", + "reverse", + "forward" ] } } - ] + ], + "errorResponses": [ + { + "code": 400, + "reason": "The provided operation parameter was invalid" + }, + { + "code": 404, + "reason": "The playback cannot be found" + }, + { + "code": 409, + "reason": "The operation cannot be performed in the playback's current state" + } +] } ] } -- cgit v1.2.3