mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 04:30:28 +00:00
ARI: Add ability to raise arbitrary User Events
User events can now be generated from ARI. Events can be signalled with arbitrary json variables, and include one or more of channel, bridge, or endpoint snapshots. An application must be specified which will receive the event message (other applications can subscribe to it). The message will also be delivered via AMI provided a channel is attached. Dialplan generated user event messages are still transmitted via the channel, and will only be received by a stasis application they are attached to or if the channel is subscribed to. This change also introduces the multi object blob mechanism used to send multiple snapshot types in a single message. The dialplan app UserEvent was also changed to use multi object blob, and a new stasis message type created to handle them. ASTERISK-22697 #close Review: https://reviewboard.asterisk.org/r/3494/ ........ Merged revisions 414405 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414406 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -30,6 +30,66 @@
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "/events/user/{eventName}",
|
||||
"description": "Stasis application user events",
|
||||
"operations": [
|
||||
{
|
||||
"httpMethod": "POST",
|
||||
"summary": "Generate a user event.",
|
||||
"nickname": "userEvent",
|
||||
"responseClass": "void",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "eventName",
|
||||
"description": "Event name",
|
||||
"paramType": "path",
|
||||
"required": true,
|
||||
"allowMultiple": false,
|
||||
"dataType": "string"
|
||||
},
|
||||
{
|
||||
"name": "application",
|
||||
"description": "The name of the application that will receive this event",
|
||||
"paramType": "query",
|
||||
"required": true,
|
||||
"allowMultiple": false,
|
||||
"dataType": "string"
|
||||
},
|
||||
{
|
||||
"name": "source",
|
||||
"description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource}, deviceState:{deviceName}",
|
||||
"paramType": "query",
|
||||
"required": false,
|
||||
"allowMultiple": true,
|
||||
"dataType": "string"
|
||||
},
|
||||
{
|
||||
"name": "variables",
|
||||
"description": "custom key/value pairs added to the user event",
|
||||
"paramType": "body",
|
||||
"required": false,
|
||||
"allowMultiple": false,
|
||||
"dataType": "containers"
|
||||
}
|
||||
],
|
||||
"errorResponses": [
|
||||
{
|
||||
"code": 404,
|
||||
"reason": "Application does not exist."
|
||||
},
|
||||
{
|
||||
"code": 422,
|
||||
"reason": "Event source not found."
|
||||
},
|
||||
{
|
||||
"code": 400,
|
||||
"reason": "Invalid even tsource URI or userevent data."
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"models": {
|
||||
@@ -451,9 +511,19 @@
|
||||
"description": "The name of the user event."
|
||||
},
|
||||
"channel": {
|
||||
"required": true,
|
||||
"required": false,
|
||||
"type": "Channel",
|
||||
"description": "The channel that signaled the user event."
|
||||
"description": "A channel that is signaled with the user event."
|
||||
},
|
||||
"bridge": {
|
||||
"required": false,
|
||||
"type": "Bridge",
|
||||
"description": "A bridge that is signaled with the user event."
|
||||
},
|
||||
"endpoint": {
|
||||
"required": false,
|
||||
"type": "Endpoint",
|
||||
"description": "A endpoint that is signaled with the user event."
|
||||
},
|
||||
"userevent": {
|
||||
"required": true,
|
||||
|
Reference in New Issue
Block a user