summaryrefslogtreecommitdiff
path: root/rest-api
diff options
context:
space:
mode:
authorDavid M. Lee <dlee@digium.com>2013-07-03 17:58:45 +0000
committerDavid M. Lee <dlee@digium.com>2013-07-03 17:58:45 +0000
commita75fd32212c35b41143442bd757387fad636177a (patch)
tree461033acf36f4596d8fc9800a1195e12207b3ea2 /rest-api
parentc4adaf91067559dd5aa90577e181693abade0602 (diff)
ARI - channel recording support
This patch is the first step in adding recording support to the Asterisk REST Interface. Recordings are stored in /var/spool/recording. Since recordings may be destructive (overwriting existing files), the API rejects attempts to escape the recording directory (avoiding issues if someone attempts to record to ../../lib/sounds/greeting, for example). (closes issue ASTERISK-21594) (closes issue ASTERISK-21581) Review: https://reviewboard.asterisk.org/r/2612/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393550 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'rest-api')
-rw-r--r--rest-api/api-docs/channels.json34
-rw-r--r--rest-api/api-docs/recordings.json52
2 files changed, 54 insertions, 32 deletions
diff --git a/rest-api/api-docs/channels.json b/rest-api/api-docs/channels.json
index f013ef641..9900db739 100644
--- a/rest-api/api-docs/channels.json
+++ b/rest-api/api-docs/channels.json
@@ -565,7 +565,11 @@
"required": false,
"allowMultiple": false,
"dataType": "int",
- "defaultValue": 0
+ "defaultValue": 0,
+ "allowableValues": {
+ "valueType": "RANGE",
+ "min": 0
+ }
},
{
"name": "maxSilenceSeconds",
@@ -574,16 +578,28 @@
"required": false,
"allowMultiple": false,
"dataType": "int",
- "defaultValue": 0
+ "defaultValue": 0,
+ "allowableValues": {
+ "valueType": "RANGE",
+ "min": 0
+ }
},
{
- "name": "append",
- "description": "If true, and recording already exists, append to recording",
+ "name": "ifExists",
+ "description": "Action to take if a recording with the same name already exists.",
"paramType": "query",
"required": false,
"allowMultiple": false,
- "dataType": "boolean",
- "defaultValue": false
+ "dataType": "string",
+ "defaultValue": "fail",
+ "allowableValues": {
+ "valueType": "LIST",
+ "values": [
+ "fail",
+ "overwrite",
+ "append"
+ ]
+ }
},
{
"name": "beep",
@@ -615,12 +631,16 @@
],
"errorResponses": [
{
+ "code": 400,
+ "reason": "Invalid parameters"
+ },
+ {
"code": 404,
"reason": "Channel not found"
},
{
"code": 409,
- "reason": "Channel is not in a Stasis application, or the channel is currently bridged with other channels."
+ "reason": "Channel is not in a Stasis application; the channel is currently bridged with other channels; A recording with the same name is currently in progress."
}
]
}
diff --git a/rest-api/api-docs/recordings.json b/rest-api/api-docs/recordings.json
index ce11d17c2..9efdc7bb3 100644
--- a/rest-api/api-docs/recordings.json
+++ b/rest-api/api-docs/recordings.json
@@ -20,7 +20,7 @@
]
},
{
- "path": "/recordings/stored/{recordingId}",
+ "path": "/recordings/stored/{recordingName}",
"description": "Individual recording",
"operations": [
{
@@ -30,8 +30,8 @@
"responseClass": "StoredRecording",
"parameters": [
{
- "name": "recordingId",
- "description": "Recording's id",
+ "name": "recordingName",
+ "description": "The name of the recording",
"paramType": "path",
"required": true,
"allowMultiple": false,
@@ -46,8 +46,8 @@
"responseClass": "void",
"parameters": [
{
- "name": "recordingId",
- "description": "Recording's id",
+ "name": "recordingName",
+ "description": "The name of the recording",
"paramType": "path",
"required": true,
"allowMultiple": false,
@@ -70,7 +70,7 @@
]
},
{
- "path": "/recordings/live/{recordingId}",
+ "path": "/recordings/live/{recordingName}",
"description": "A recording that is in progress",
"operations": [
{
@@ -80,8 +80,8 @@
"responseClass": "LiveRecording",
"parameters": [
{
- "name": "recordingId",
- "description": "Recording's id",
+ "name": "recordingName",
+ "description": "The name of the recording",
"paramType": "path",
"required": true,
"allowMultiple": false,
@@ -96,8 +96,8 @@
"responseClass": "void",
"parameters": [
{
- "name": "recordingId",
- "description": "Recording's id",
+ "name": "recordingName",
+ "description": "The name of the recording",
"paramType": "path",
"required": true,
"allowMultiple": false,
@@ -108,7 +108,7 @@
]
},
{
- "path": "/recordings/live/{recordingId}/stop",
+ "path": "/recordings/live/{recordingName}/stop",
"operations": [
{
"httpMethod": "POST",
@@ -117,8 +117,8 @@
"responseClass": "void",
"parameters": [
{
- "name": "recordingId",
- "description": "Recording's id",
+ "name": "recordingName",
+ "description": "The name of the recording",
"paramType": "path",
"required": true,
"allowMultiple": false,
@@ -129,17 +129,18 @@
]
},
{
- "path": "/recordings/live/{recordingId}/pause",
+ "path": "/recordings/live/{recordingName}/pause",
"operations": [
{
"httpMethod": "POST",
"summary": "Pause a live recording.",
+ "notes": "Pausing a recording suspends silence detection, which will be restarted when the recording is unpaused.",
"nickname": "pauseRecording",
"responseClass": "void",
"parameters": [
{
- "name": "recordingId",
- "description": "Recording's id",
+ "name": "recordingName",
+ "description": "The name of the recording",
"paramType": "path",
"required": true,
"allowMultiple": false,
@@ -150,7 +151,7 @@
]
},
{
- "path": "/recordings/live/{recordingId}/unpause",
+ "path": "/recordings/live/{recordingName}/unpause",
"operations": [
{
"httpMethod": "POST",
@@ -159,8 +160,8 @@
"responseClass": "void",
"parameters": [
{
- "name": "recordingId",
- "description": "Recording's id",
+ "name": "recordingName",
+ "description": "The name of the recording",
"paramType": "path",
"required": true,
"allowMultiple": false,
@@ -171,17 +172,18 @@
]
},
{
- "path": "/recordings/live/{recordingId}/mute",
+ "path": "/recordings/live/{recordingName}/mute",
"operations": [
{
"httpMethod": "POST",
"summary": "Mute a live recording.",
+ "notes": "Muting a recording suspends silence detection, which will be restarted when the recording is unmuted.",
"nickname": "muteRecording",
"responseClass": "void",
"parameters": [
{
- "name": "recordingId",
- "description": "Recording's id",
+ "name": "recordingName",
+ "description": "The name of the recording",
"paramType": "path",
"required": true,
"allowMultiple": false,
@@ -192,7 +194,7 @@
]
},
{
- "path": "/recordings/live/{recordingId}/unmute",
+ "path": "/recordings/live/{recordingName}/unmute",
"operations": [
{
"httpMethod": "POST",
@@ -201,8 +203,8 @@
"responseClass": "void",
"parameters": [
{
- "name": "recordingId",
- "description": "Recording's id",
+ "name": "recordingName",
+ "description": "The name of the recording",
"paramType": "path",
"required": true,
"allowMultiple": false,