mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	ARI: Add support for getting/setting channel and global variables.
This allows for reading and writing of functions on channels. (closes issue ASTERISK-21868) Review: https://reviewboard.asterisk.org/r/2641/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393806 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		| @@ -36,6 +36,52 @@ | ||||
| 					] | ||||
| 				} | ||||
| 			] | ||||
| 		}, | ||||
| 		{ | ||||
| 			"path": "/asterisk/variable", | ||||
| 			"description": "Global variables", | ||||
| 			"operations": [ | ||||
| 				{ | ||||
| 					"httpMethod": "GET", | ||||
| 					"summary": "Get the value of a global variable.", | ||||
| 					"nickname": "getGlobalVar", | ||||
| 					"responseClass": "Variable", | ||||
| 					"parameters": [ | ||||
| 						{ | ||||
| 							"name": "variable", | ||||
| 							"description": "The variable to get", | ||||
| 							"paramType": "query", | ||||
| 							"required": true, | ||||
| 							"allowMultiple": false, | ||||
| 							"dataType": "string" | ||||
| 						} | ||||
| 					] | ||||
| 				}, | ||||
| 				{ | ||||
| 					"httpMethod": "POST", | ||||
| 					"summary": "Set the value of a global variable.", | ||||
| 					"nickname": "setGlobalVar", | ||||
| 					"responseClass": "void", | ||||
| 					"parameters": [ | ||||
| 						{ | ||||
| 							"name": "variable", | ||||
| 							"description": "The variable to set", | ||||
| 							"paramType": "query", | ||||
| 							"required": true, | ||||
| 							"allowMultiple": false, | ||||
| 							"dataType": "string" | ||||
| 						}, | ||||
| 						{ | ||||
| 							"name": "value", | ||||
| 							"description": "The value to set the variable to", | ||||
| 							"paramType": "query", | ||||
| 							"required": false, | ||||
| 							"allowMultiple": false, | ||||
| 							"dataType": "string" | ||||
| 						} | ||||
| 					] | ||||
| 				} | ||||
| 			] | ||||
| 		} | ||||
| 	], | ||||
| 	"models": { | ||||
| @@ -43,6 +89,16 @@ | ||||
| 			"id": "AsteriskInfo", | ||||
| 			"description": "Asterisk system information", | ||||
| 			"properties": {} | ||||
| 		}, | ||||
| 		"Variable": { | ||||
| 			"id": "Variable", | ||||
| 			"properties": { | ||||
| 				"variable": { | ||||
| 					"required": true, | ||||
| 					"type": "string", | ||||
| 					"description": "The value of the variable requested" | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
|   | ||||
| @@ -645,6 +645,88 @@ | ||||
| 					] | ||||
| 				} | ||||
| 			] | ||||
| 		}, | ||||
| 		{ | ||||
| 			"path": "/channels/{channelId}/variable", | ||||
| 			"description": "Variables on a channel", | ||||
| 			"operations": [ | ||||
| 				{ | ||||
| 					"httpMethod": "GET", | ||||
| 					"summary": "Get the value of a channel variable or function.", | ||||
| 					"nickname": "getChannelVar", | ||||
| 					"responseClass": "ChannelVariable", | ||||
| 					"parameters": [ | ||||
| 						{ | ||||
| 							"name": "channelId", | ||||
| 							"description": "Channel's id", | ||||
| 							"paramType": "path", | ||||
| 							"required": true, | ||||
| 							"allowMultiple": false, | ||||
| 							"dataType": "string" | ||||
| 						}, | ||||
| 						{ | ||||
| 							"name": "variable", | ||||
| 							"description": "The channel variable or function to get", | ||||
| 							"paramType": "query", | ||||
| 							"required": true, | ||||
| 							"allowMultiple": false, | ||||
| 							"dataType": "string" | ||||
| 						} | ||||
| 					], | ||||
| 					"errorResponses": [ | ||||
| 						{ | ||||
| 							"code": 404, | ||||
| 							"reason": "Channel not found" | ||||
| 						}, | ||||
| 						{ | ||||
| 							"code": 409, | ||||
| 							"reason": "Channel not in a Stasis application" | ||||
| 						} | ||||
| 					] | ||||
| 				}, | ||||
| 				{ | ||||
| 					"httpMethod": "POST", | ||||
| 					"summary": "Set the value of a channel variable or function.", | ||||
| 					"nickname": "setChannelVar", | ||||
| 					"responseClass": "void", | ||||
| 					"parameters": [ | ||||
| 						{ | ||||
| 							"name": "channelId", | ||||
| 							"description": "Channel's id", | ||||
| 							"paramType": "path", | ||||
| 							"required": true, | ||||
| 							"allowMultiple": false, | ||||
| 							"dataType": "string" | ||||
| 						}, | ||||
| 						{ | ||||
| 							"name": "variable", | ||||
| 							"description": "The channel variable or function to set", | ||||
| 							"paramType": "query", | ||||
| 							"required": true, | ||||
| 							"allowMultiple": false, | ||||
| 							"dataType": "string" | ||||
| 						}, | ||||
| 						{ | ||||
| 							"name": "value", | ||||
| 							"description": "The value to set the variable to", | ||||
| 							"paramType": "query", | ||||
| 							"required": false, | ||||
| 							"allowMultiple": false, | ||||
| 							"dataType": "string" | ||||
| 						} | ||||
| 					], | ||||
| 					"errorResponses": [ | ||||
| 						{ | ||||
| 							"code": 404, | ||||
| 							"reason": "Channel not found" | ||||
| 						}, | ||||
| 						{ | ||||
| 							"code": 409, | ||||
| 							"reason": "Channel not in a Stasis application" | ||||
| 						} | ||||
| 					] | ||||
| 				} | ||||
| 			] | ||||
| 		} | ||||
| 	], | ||||
| 	"models": { | ||||
| @@ -745,6 +827,16 @@ | ||||
| 					"description": "Timestamp when channel was created" | ||||
| 				} | ||||
| 			} | ||||
| 		}, | ||||
| 		"Variable": { | ||||
| 			"id": "Variable", | ||||
| 			"properties": { | ||||
| 				"variable": { | ||||
| 					"required": true, | ||||
| 					"type": "string", | ||||
| 					"description": "The value of the variable requested" | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user