diff options
Diffstat (limited to 'rest-api')
-rw-r--r-- | rest-api/api-docs/asterisk.json | 1 | ||||
-rw-r--r-- | rest-api/api-docs/bridges.json | 52 | ||||
-rw-r--r-- | rest-api/api-docs/channels.json | 114 | ||||
-rw-r--r-- | rest-api/api-docs/endpoints.json | 20 | ||||
-rw-r--r-- | rest-api/api-docs/events.json | 108 | ||||
-rw-r--r-- | rest-api/api-docs/playback.json | 32 | ||||
-rw-r--r-- | rest-api/api-docs/recordings.json | 25 | ||||
-rw-r--r-- | rest-api/api-docs/sounds.json | 2 |
8 files changed, 188 insertions, 166 deletions
diff --git a/rest-api/api-docs/asterisk.json b/rest-api/api-docs/asterisk.json index ef6c7b864..8ee88e439 100644 --- a/rest-api/api-docs/asterisk.json +++ b/rest-api/api-docs/asterisk.json @@ -41,6 +41,7 @@ "models": { "AsteriskInfo": { "id": "AsteriskInfo", + "description": "Asterisk system information", "properties": {} } } diff --git a/rest-api/api-docs/bridges.json b/rest-api/api-docs/bridges.json index 5b0cf6298..87d5b3d4f 100644 --- a/rest-api/api-docs/bridges.json +++ b/rest-api/api-docs/bridges.json @@ -31,8 +31,8 @@ "required": false, "allowMultiple": false, "dataType": "string", - "allowedValues": { - "type": "LIST", + "allowableValues": { + "valueType": "LIST", "values": [ "mixing", "holding" @@ -61,6 +61,12 @@ "allowMultiple": false, "dataType": "string" } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + } ] }, { @@ -78,6 +84,12 @@ "allowMultiple": false, "dataType": "string" } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + } ] } ] @@ -108,6 +120,20 @@ "allowMultiple": true, "dataType": "string" } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application" + }, + { + "code": 422, + "reason": "Channel not found, or not in Stasis application" + } ] } ] @@ -231,19 +257,35 @@ "models": { "Bridge": { "id": "Bridge", + "description": "The merging of media from one or more channels.\n\nEveryone on the bridge receives the same audio.", "properties": { - "bridgeType": { + "id": { + "type": "string", + "description": "Unique identifier for this bridge", + "required": true + }, + "technology": { + "type": "string", + "description": "Name of the current bridging technology", + "required": true + }, + "bridge_type": { "type": "string", "description": "Type of bridge technology", "required": true, - "allowedValues": { - "type": "LIST", + "allowableValues": { + "valueType": "LIST", "values": [ "mixing", "holding" ] } }, + "bridge_class": { + "type": "string", + "description": "Bridging class", + "required": true + }, "channels": { "type": "List[string]", "description": "Id's of channels participating in this bridge", diff --git a/rest-api/api-docs/channels.json b/rest-api/api-docs/channels.json index 623cb17bb..f013ef641 100644 --- a/rest-api/api-docs/channels.json +++ b/rest-api/api-docs/channels.json @@ -286,6 +286,10 @@ { "code": 404, "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" } ] } @@ -616,11 +620,7 @@ }, { "code": 409, - "reason": "Channel is not in a Stasis application." - }, - { - "code": 409, - "reason": "The channel is currently bridged with other channels." + "reason": "Channel is not in a Stasis application, or the channel is currently bridged with other channels." } ] } @@ -630,10 +630,12 @@ "models": { "Dialed": { "id": "Dialed", + "description": "Dialed channel information.", "properties": {} }, "DialplanCEP": { "id": "DialplanCEP", + "description": "Dialplan location (context/extension/priority)", "properties": { "context": { "required": true, @@ -654,6 +656,7 @@ }, "CallerID": { "id": "CallerID", + "description": "Caller identification", "properties": { "name": { "required": true, @@ -667,11 +670,12 @@ }, "Channel": { "id": "Channel", + "description": "A specific communication connection between Asterisk and an Endpoint.", "properties": { - "uniqueid": { + "id": { "required": true, "type": "string", - "description": "Unique identifier of the channel" + "description": "Unique identifier of the channel.\n\nThis is the same as the Uniqueid field in AMI." }, "name": { "required": true, @@ -680,99 +684,47 @@ }, "state": { "required": true, - "type": "string" - }, - "accountcode": { - "required": true, - "type": "string" - }, - "peeraccount": { - "required": true, - "type": "string" - }, - "userfield": { - "required": true, - "type": "string" + "type": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "Down", + "Rsrved", + "OffHook", + "Dialing", + "Ring", + "Ringing", + "Up", + "Busy", + "Dialing Offhook", + "Pre-ring", + "Unknown" + ] + } }, - "linkedid": { + "caller": { "required": true, - "type": "string" + "type": "CallerID" }, - "parkinglot": { + "connected": { "required": true, - "type": "string" + "type": "CallerID" }, - "hangupsource": { + "accountcode": { "required": true, "type": "string" }, - "appl": { - "required": true, - "type": "string", - "description": "Currently executing dialplan application" - }, - "data": { - "required": true, - "type": "string", - "description": "Arguments passed to appl" - }, "dialplan": { "required": true, "type": "DialplanCEP", "description": "Current location in the dialplan" }, - "caller": { - "required": true, - "type": "CallerID" - }, - "connected": { - "required": true, - "type": "CallerID" - }, "creationtime": { "required": true, "type": "Date", "description": "Timestamp when channel was created" } } - }, - "Playback": { - "id": "Playback", - "description": "Object representing the playback of media to a channel", - "properties": { - "id": { - "type": "string", - "description": "ID for this playback operation", - "required": true - }, - "media_uri": { - "type": "string", - "description": "URI for the media to play back.", - "required": true - }, - "target_uri": { - "type": "string", - "description": "URI for the channel or bridge to play the media on", - "required": true - }, - "language": { - "type": "string", - "description": "For media types that support multiple languages, the language requested for playback." - }, - "state": { - "type": "string", - "description": "Current state of the playback operation.", - "required": true, - "allowableValues": { - "valueType": "LIST", - "values": [ - "queued", - "playing", - "complete" - ] - } - } - } } } } diff --git a/rest-api/api-docs/endpoints.json b/rest-api/api-docs/endpoints.json index d3d77d84a..9d0ff1840 100644 --- a/rest-api/api-docs/endpoints.json +++ b/rest-api/api-docs/endpoints.json @@ -69,7 +69,7 @@ "models": { "Endpoint": { "id": "Endpoint", - "description": "A snapshot of an endpoint. Unlike most resources, which have a single unique identifier, an endpoint is uniquely identified by the technology/resource pair.", + "description": "An external device that may offer/accept calls to/from Asterisk.\n\nUnlike most resources, which have a single unique identifier, an endpoint is uniquely identified by the technology/resource pair.", "properties": { "technology": { "type": "string", @@ -80,6 +80,24 @@ "type": "string", "description": "Identifier of the endpoint, specific to the given technology.", "required": true + }, + "state": { + "type": "string", + "description": "Endpoint's state", + "required": false, + "allowableValues": { + "valueType": "LIST", + "values": [ + "unknown", + "offline", + "online" + ] + } + }, + "channel_ids": { + "type": "List[string]", + "description": "Id's of channels associated with this endpoint", + "required": true } } } diff --git a/rest-api/api-docs/events.json b/rest-api/api-docs/events.json index 56a05e4ee..79908eff7 100644 --- a/rest-api/api-docs/events.json +++ b/rest-api/api-docs/events.json @@ -3,7 +3,7 @@ "_author": "David M. Lee, II <dlee@digium.com>", "_svn_revision": "$Revision$", "apiVersion": "0.0.1", - "swaggerVersion": "1.1", + "swaggerVersion": "1.3", "basePath": "http://localhost:8088/stasis", "resourcePath": "/api-docs/events.{format}", "apis": [ @@ -35,37 +35,29 @@ "models": { "Event": { "id": "Event", - "description": "Asynchronous events from Asterisk. The non-required fields of this object are mutually exclusive.", + "description": "Base type for asynchronous events from Asterisk.", + "discriminator": "type", "properties": { + "type": { + "type": "string", + "required": true, + "description": "Indicates the type of this event." + }, "application": { "type": "string", "description": "Name of the application receiving the event.", "required": true }, - "application_replaced": { "type": "ApplicationReplaced" }, - "bridge_created": { "type": "BridgeCreated" }, - "bridge_destroyed": { "type": "BridgeDestroyed" }, - "bridge_merged": { "type": "BridgeMerged" }, - "channel_created": { "type": "ChannelCreated" }, - "channel_destroyed": { "type": "ChannelDestroyed" }, - "channel_snapshot": { "type": "ChannelSnapshot" }, - "channel_entered_bridge": { "type": "ChannelEnteredBridge" }, - "channel_left_bridge": { "type": "ChannelLeftBridge" }, - "channel_state_change": { "type": "ChannelStateChange" }, - "channel_dtmf_received": { "type": "ChannelDtmfReceived" }, - "channel_dialplan": { "type": "ChannelDialplan" }, - "channel_caller_id": { "type": "ChannelCallerId" }, - "channel_userevent": { "type": "ChannelUserevent" }, - "channel_hangup_request": { "type": "ChannelHangupRequest" }, - "channel_varset": { "type": "ChannelVarset" }, - "stasis_end": { "type": "StasisEnd" }, - "stasis_start": { "type": "StasisStart" }, - "playback_started": { "type": "PlaybackStarted" }, - "playback_finished": { "type": "PlaybackFinished" } + "timestamp": { + "type": "Date", + "description": "Time at which this event was created.", + "required": false + } } }, "PlaybackStarted": { "id": "PlaybackStarted", + "extends": "Event", "description": "Event showing the start of a media playback operation.", "properties": { "playback": { @@ -77,6 +69,7 @@ }, "PlaybackFinished": { "id": "PlaybackFinished", + "extends": "Event", "description": "Event showing the completion of a media playback operation.", "properties": { "playback": { @@ -88,17 +81,13 @@ }, "ApplicationReplaced": { "id": "ApplicationReplaced", - "description": "Notification that another WebSocket has taken over for an application.", - "notes": "An application may only be subscribed to by a single WebSocket at a time. If multiple WebSockets attempt to subscribe to the same application, the newer WebSocket wins, and the older one receives this event.", - "properties": { - "application": { - "required": true, - "type": "string" - } - } + "extends": "Event", + "description": "Notification that another WebSocket has taken over for an application.\n\nAn application may only be subscribed to by a single WebSocket at a time. If multiple WebSockets attempt to subscribe to the same application, the newer WebSocket wins, and the older one receives this event.", + "properties": {} }, "BridgeCreated": { "id": "BridgeCreated", + "extends": "Event", "description": "Notification that a bridge has been created.", "properties": { "bridge": { @@ -109,6 +98,7 @@ }, "BridgeDestroyed": { "id": "BridgeDestroyed", + "extends": "Event", "description": "Notification that a bridge has been destroyed.", "properties": { "bridge": { @@ -119,6 +109,7 @@ }, "BridgeMerged": { "id": "BridgeMerged", + "extends": "Event", "description": "Notification that one bridge has merged into another.", "properties": { "bridge": { @@ -133,6 +124,7 @@ }, "ChannelCreated": { "id": "ChannelCreated", + "extends": "Event", "description": "Notification that a channel has been created.", "properties": { "channel": { @@ -141,24 +133,15 @@ } } }, - "ChannelSnapshot": { - "id": "ChannelSnapshot", - "description": "Some part of channel state changed.", - "properties": { - "channel": { - "required": true, - "type": "Channel" - } - } - }, "ChannelDestroyed": { "id": "ChannelDestroyed", + "extends": "Event", "description": "Notification that a channel has been destroyed.", "properties": { "cause": { "required": true, "description": "Integer representation of the cause of the hangup", - "type": "integer" + "type": "int" }, "cause_txt": { "required": true, @@ -173,6 +156,7 @@ }, "ChannelEnteredBridge": { "id": "ChannelEnteredBridge", + "extends": "Event", "description": "Notification that a channel has entered a bridge.", "properties": { "bridge": { @@ -186,6 +170,7 @@ }, "ChannelLeftBridge": { "id": "ChannelLeftBridge", + "extends": "Event", "description": "Notification that a channel has left a bridge.", "properties": { "bridge": { @@ -200,6 +185,7 @@ }, "ChannelStateChange": { "id": "ChannelStateChange", + "extends": "Event", "description": "Notification of a channel's state change.", "properties": { "channel": { @@ -210,14 +196,19 @@ }, "ChannelDtmfReceived": { "id": "ChannelDtmfReceived", - "description": "DTMF received on a channel.", - "notes": "This event is sent when the DTMF ends. There is no notification about the start of DTMF", + "extends": "Event", + "description": "DTMF received on a channel.\n\nThis event is sent when the DTMF ends. There is no notification about the start of DTMF", "properties": { "digit": { "required": true, "type": "string", "description": "DTMF digit received (0-9, A-E, # or *)" }, + "duration_ms": { + "required": true, + "type": "int", + "description": "Number of milliseconds DTMF was received" + }, "channel": { "required": true, "type": "Channel", @@ -227,32 +218,34 @@ }, "ChannelDialplan": { "id": "ChannelDialplan", + "extends": "Event", "description": "Channel changed location in the dialplan.", "properties": { - "application": { + "channel": { "required": true, - "type": "string", - "description": "The application that the channel is currently in." + "type": "Channel", + "description": "The channel that changed dialplan location." }, - "application_data": { + "dialplan_app": { "required": true, "type": "string", - "description": "The data that was passed to the application when it was invoked." + "description": "The application about to be executed." }, - "channel": { + "dialplan_app_data": { "required": true, - "type": "Channel", - "description": "The channel that changed dialplan location." + "type": "string", + "description": "The data to be passed to the application." } } }, "ChannelCallerId": { "id": "ChannelCallerId", + "extends": "Event", "description": "Channel changed Caller ID.", "properties": { "caller_presentation": { "required": true, - "type": "integer", + "type": "int", "description": "The integer representation of the Caller Presentation value." }, "caller_presentation_txt": { @@ -269,6 +262,7 @@ }, "ChannelUserevent": { "id": "ChannelUserevent", + "extends": "Event", "description": "User-generated event with additional user-defined fields in the object.", "properties": { "eventname": { @@ -285,10 +279,11 @@ }, "ChannelHangupRequest": { "id": "ChannelHangupRequest", + "extends": "Event", "description": "A hangup was requested on the channel.", "properties": { "cause": { - "type": "integer", + "type": "int", "description": "Integer representation of the cause of the hangup." }, "soft": { @@ -304,6 +299,7 @@ }, "ChannelVarset": { "id": "ChannelVarset", + "extends": "Event", "description": "Channel variable changed.", "properties": { "variable": { @@ -317,14 +313,15 @@ "description": "The new value of the variable." }, "channel": { - "required": true, + "required": false, "type": "Channel", - "description": "The channel on which the variable was set." + "description": "The channel on which the variable was set.\n\nIf missing, the variable is a global variable." } } }, "StasisEnd": { "id": "StasisEnd", + "extends": "Event", "description": "Notification that a channel has left a Stasis appliction.", "properties": { "channel": { @@ -335,6 +332,7 @@ }, "StasisStart": { "id": "StasisStart", + "extends": "Event", "description": "Notification that a channel has entered a Stasis appliction.", "properties": { "args": { diff --git a/rest-api/api-docs/playback.json b/rest-api/api-docs/playback.json index 38ca5e1a7..884c0db26 100644 --- a/rest-api/api-docs/playback.json +++ b/rest-api/api-docs/playback.json @@ -103,11 +103,39 @@ "models": { "Playback": { "id": "Playback", + "description": "Object representing the playback of media to a channel", "properties": { "id": { + "type": "string", + "description": "ID for this playback operation", + "required": true + }, + "media_uri": { + "type": "string", + "description": "URI for the media to play back.", + "required": true + }, + "target_uri": { + "type": "string", + "description": "URI for the channel or bridge to play the media on", + "required": true + }, + "language": { + "type": "string", + "description": "For media types that support multiple languages, the language requested for playback." + }, + "state": { + "type": "string", + "description": "Current state of the playback operation.", "required": true, - "description": "Playback's identifier.", - "type": "string" + "allowableValues": { + "valueType": "LIST", + "values": [ + "queued", + "playing", + "complete" + ] + } } } } diff --git a/rest-api/api-docs/recordings.json b/rest-api/api-docs/recordings.json index 2f5f92a08..ce11d17c2 100644 --- a/rest-api/api-docs/recordings.json +++ b/rest-api/api-docs/recordings.json @@ -8,18 +8,6 @@ "resourcePath": "/api-docs/recordings.{format}", "apis": [ { - "path": "/recordings", - "description": "Recordings", - "operations": [ - { - "httpMethod": "GET", - "summary": "List all recordings.", - "nickname": "getRecordings", - "responseClass": "List[Recording]" - } - ] - }, - { "path": "/recordings/stored", "description": "Recordings", "operations": [ @@ -226,17 +214,9 @@ } ], "models": { - "Recording": { - "id": "Recording", - "properties": { - "id": { - "required": true, - "type": "string" - } - } - }, "StoredRecording": { "id": "StoredRecording", + "description": "A past recording that may be played back.", "properties": { "id": { "required": true, @@ -246,7 +226,7 @@ "required": true, "type": "List[string]" }, - "durationSeconds": { + "duration_seconds": { "required": false, "type": "int" }, @@ -259,6 +239,7 @@ }, "LiveRecording": { "id": "LiveRecording", + "description": "A recording that is in progress", "properties": { "id": { "required": true, diff --git a/rest-api/api-docs/sounds.json b/rest-api/api-docs/sounds.json index 06d84ea7e..103738c45 100644 --- a/rest-api/api-docs/sounds.json +++ b/rest-api/api-docs/sounds.json @@ -60,6 +60,7 @@ "models": { "FormatLangPair": { "id": "FormatLangPair", + "description": "Identifies the format and language of a sound file", "properties": { "language": { "required": true, @@ -73,6 +74,7 @@ }, "Sound": { "id": "Sound", + "description": "A media file that may be played back.", "properties": { "id": { "required": true, |