mirror of
https://github.com/asterisk/asterisk.git
synced 2026-07-23 16:05:30 -07:00
ARI: Added paths to get and set multiple channel variables.
Two new paths exist for ARI to get and set multiple channel variables at the same time. This is done via GET and POST like the single get and set variable equivalents. Leading and trailing whitespace will be stripped from the variable names for both paths. When setting variables, the values will be read as-is, whitespace included. GET takes in a single string with comma-separated values, while POST takes in a dictionary of key value pairs. The code follows the same paths as when setting multiple variables when originating a channel via ARI. UserNote: Added new ARI paths for getting and setting multiple channel variables at a time. For GET, this takes in a single string of comma-separated variable names, while POST takes in a dictionary of key value pairs. The behavior is the same as passing in variables when originating a channel.
This commit is contained in:
@@ -757,6 +757,17 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"Variables": {
|
||||
"id": "Variables",
|
||||
"description": "A dictionary of channel variables",
|
||||
"properties": {
|
||||
"variables": {
|
||||
"required": true,
|
||||
"type": "object",
|
||||
"description": "A dictionary of channel variables"
|
||||
}
|
||||
}
|
||||
},
|
||||
"ConfigTuple": {
|
||||
"id": "ConfigTuple",
|
||||
"description": "A key/value pair that makes up part of a configuration object.",
|
||||
|
||||
@@ -1620,6 +1620,99 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "/channels/{channelId}/variables",
|
||||
"description": "Multiple variables on a channel",
|
||||
"operations": [
|
||||
{
|
||||
"httpMethod": "GET",
|
||||
"since": [
|
||||
"20.20.0",
|
||||
"22.10.0",
|
||||
"23.4.0"
|
||||
],
|
||||
"summary": "Get the value of multiple channel variables or functions.",
|
||||
"nickname": "getChannelVars",
|
||||
"responseClass": "Variables",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "channelId",
|
||||
"description": "Channel's id",
|
||||
"paramType": "path",
|
||||
"required": true,
|
||||
"allowMultiple": false,
|
||||
"dataType": "string"
|
||||
},
|
||||
{
|
||||
"name": "variables",
|
||||
"description": "The channel variables or functions to get",
|
||||
"paramType": "query",
|
||||
"required": true,
|
||||
"allowMultiple": true,
|
||||
"dataType": "string"
|
||||
}
|
||||
],
|
||||
"errorResponses": [
|
||||
{
|
||||
"code": 400,
|
||||
"reason": "Missing variables parameter."
|
||||
},
|
||||
{
|
||||
"code": 404,
|
||||
"reason": "Channel or variable not found"
|
||||
},
|
||||
{
|
||||
"code": 409,
|
||||
"reason": "Channel not in a Stasis application"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"httpMethod": "POST",
|
||||
"since": [
|
||||
"20.20.0",
|
||||
"22.10.0",
|
||||
"23.4.0"
|
||||
],
|
||||
"summary": "Set the values of multiple channel variables or functions.",
|
||||
"nickname": "setChannelVars",
|
||||
"responseClass": "void",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "channelId",
|
||||
"description": "Channel's id",
|
||||
"paramType": "path",
|
||||
"required": true,
|
||||
"allowMultiple": false,
|
||||
"dataType": "string"
|
||||
},
|
||||
{
|
||||
"name": "variables",
|
||||
"description": "The \"variables\" key in the body object holds variable key/value pairs to set on the channel. Ex. { \"variables\": { \"CALLERID(name)\": \"Alice\" } }",
|
||||
"paramType": "body",
|
||||
"required": false,
|
||||
"dataType": "containers",
|
||||
"allowMultiple": false
|
||||
}
|
||||
],
|
||||
"errorResponses": [
|
||||
{
|
||||
"code": 400,
|
||||
"reason": "Missing variables parameter."
|
||||
},
|
||||
{
|
||||
"code": 404,
|
||||
"reason": "Channel not found"
|
||||
},
|
||||
{
|
||||
"code": 409,
|
||||
"reason": "Channel not in a Stasis application"
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "/channels/{channelId}/snoop",
|
||||
"description": "Snoop (spy/whisper) on a channel",
|
||||
|
||||
Reference in New Issue
Block a user