Stasis-HTTP: Flesh out bridge-related capabilities
[asterisk/asterisk.git] / rest-api / api-docs / events.json
1 {
2         "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.",
3         "_author": "David M. Lee, II <dlee@digium.com>",
4         "_svn_revision": "$Revision$",
5         "apiVersion": "0.0.1",
6         "swaggerVersion": "1.1",
7         "basePath": "http://localhost:8088/stasis",
8         "resourcePath": "/api-docs/events.{format}",
9         "apis": [
10                 {
11                         "path": "/events",
12                         "description": "Events from Asterisk to applications",
13                         "operations": [
14                                 {
15                                         "httpMethod": "GET",
16                                         "summary": "WebSocket connection for events.",
17                                         "nickname": "eventWebsocket",
18                                         "responseClass": "Event",
19                                         "parameters": [
20                                                 {
21                                                         "name": "app",
22                                                         "description": "Comma seperated list of applications to subscribe to.",
23                                                         "paramType": "query",
24                                                         "required": true,
25                                                         "allowMultiple": true,
26                                                         "dataType": "string"
27                                                 },
28                                                 {
29                                                         "name": "Upgrade",
30                                                         "description": "RFC6455 header for upgrading a connection to a websocket.",
31                                                         "paramType": "header",
32                                                         "required": true,
33                                                         "dataType": "string",
34                                                         "allowableValues": {
35                                                                 "valueType": "LIST",
36                                                                 "values": [
37                                                                         "websocket"
38                                                                 ]
39                                                         }
40                                                 }
41                                         ]
42                                 }
43                         ]
44                 }
45         ],
46         "models": {
47                 "Event": {
48                         "id": "Event",
49                         "description": "Asynchronous events from Asterisk. The non-required fields of this object are mutually exclusive.",
50                         "properties": {
51                                 "application": {
52                                         "type": "string",
53                                         "description": "Name of the application receiving the event.",
54                                         "required": true
55                                 },
56                                 "application_replaced": { "type": "ApplicationReplaced" },
57                                 "bridge_created": { "type": "BridgeCreated" },
58                                 "bridge_destroyed": { "type": "BridgeDestroyed" },
59                                 "bridge_merged": { "type": "BridgeMerged" },
60                                 "channel_created": { "type": "ChannelCreated" },
61                                 "channel_destroyed": { "type": "ChannelDestroyed" },
62                                 "channel_snapshot": { "type": "ChannelSnapshot" },
63                                 "channel_entered_bridge": { "type": "ChannelEnteredBridge" },
64                                 "channel_left_bridge": { "type": "ChannelLeftBridge" },
65                                 "channel_state_change": { "type": "ChannelStateChange" },
66                                 "channel_dtmf_received": { "type": "ChannelDtmfReceived" },
67                                 "channel_dialplan": { "type": "ChannelDialplan" },
68                                 "channel_caller_id": { "type": "ChannelCallerId" },
69                                 "channel_userevent": { "type": "ChannelUserevent" },
70                                 "channel_hangup_request": { "type": "ChannelHangupRequest" },
71                                 "channel_varset": { "type": "ChannelVarset" },
72                                 "stasis_end": { "type": "StasisEnd" },
73                                 "stasis_start": { "type": "StasisStart" },
74                                 "playback_started": { "type": "PlaybackStarted" },
75                                 "playback_finished": { "type": "PlaybackFinished" }
76                         }
77                 },
78                 "PlaybackStarted": {
79                         "id": "PlaybackStarted",
80                         "description": "Event showing the start of a media playback operation.",
81                         "properties": {
82                                 "playback": {
83                                         "type": "Playback",
84                                         "description": "Playback control object",
85                                         "required": true
86                                 }
87                         }
88                 },
89                 "PlaybackFinished": {
90                         "id": "PlaybackFinished",
91                         "description": "Event showing the completion of a media playback operation.",
92                         "properties": {
93                                 "playback": {
94                                         "type": "Playback",
95                                         "description": "Playback control object",
96                                         "required": true
97                                 }
98                         }
99                 },
100                 "ApplicationReplaced": {
101                         "id": "ApplicationReplaced",
102                         "description": "Notification that another WebSocket has taken over for an application.",
103                         "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.",
104                         "properties": {
105                                 "application": {
106                                         "required": true,
107                                         "type": "string"
108                                 }
109                         }
110                 },
111                 "BridgeCreated": {
112                         "id": "BridgeCreated",
113                         "description": "Notification that a bridge has been created.",
114                         "properties": {
115                                 "bridge": {
116                                         "required": true,
117                                         "type": "Bridge"
118                                 }
119                         }
120                 },
121                 "BridgeDestroyed": {
122                         "id": "BridgeDestroyed",
123                         "description": "Notification that a bridge has been destroyed.",
124                         "properties": {
125                                 "bridge": {
126                                         "required": true,
127                                         "type": "Bridge"
128                                 }
129                         }
130                 },
131                 "BridgeMerged": {
132                         "id": "BridgeMerged",
133                         "description": "Notification that one bridge has merged into another.",
134                         "properties": {
135                                 "bridge": {
136                                         "required": true,
137                                         "type": "Bridge"
138                                 },
139                                 "bridge_from": {
140                                         "required": true,
141                                         "type": "Bridge"
142                                 }
143                         }
144                 },
145                 "ChannelCreated": {
146                         "id": "ChannelCreated",
147                         "description": "Notification that a channel has been created.",
148                         "properties": {
149                                 "channel": {
150                                         "required": true,
151                                         "type": "Channel"
152                                 }
153                         }
154                 },
155                 "ChannelSnapshot": {
156                         "id": "ChannelSnapshot",
157                         "description": "Some part of channel state changed.",
158                         "properties": {
159                                 "channel": {
160                                         "required": true,
161                                         "type": "Channel"
162                                 }
163                         }
164                 },
165                 "ChannelDestroyed": {
166                         "id": "ChannelDestroyed",
167                         "description": "Notification that a channel has been destroyed.",
168                         "properties": {
169                                 "cause": {
170                                         "required": true,
171                                         "description": "Integer representation of the cause of the hangup",
172                                         "type": "integer"
173                                 },
174                                 "cause_txt": {
175                                         "required": true,
176                                         "description": "Text representation of the cause of the hangup",
177                                         "type": "string"
178                                 },
179                                 "channel": {
180                                         "required": true,
181                                         "type": "Channel"
182                                 }
183                         }
184                 },
185                 "ChannelEnteredBridge": {
186                         "id": "ChannelEnteredBridge",
187                         "description": "Notification that a channel has entered a bridge.",
188                         "properties": {
189                                 "bridge": {
190                                         "required": true,
191                                         "type": "Bridge"
192                                 },
193                                 "channel": {
194                                         "type": "Channel"
195                                 }
196                         }
197                 },
198                 "ChannelLeftBridge": {
199                         "id": "ChannelLeftBridge",
200                         "description": "Notification that a channel has left a bridge.",
201                         "properties": {
202                                 "bridge": {
203                                         "required": true,
204                                         "type": "Bridge"
205                                 },
206                                 "channel": {
207                                         "required": true,
208                                         "type": "Channel"
209                                 }
210                         }
211                 },
212                 "ChannelStateChange": {
213                         "id": "ChannelStateChange",
214                         "description": "Notification of a channel's state change.",
215                         "properties": {
216                                 "channel": {
217                                         "required": true,
218                                         "type": "Channel"
219                                 }
220                         }
221                 },
222                 "ChannelDtmfReceived": {
223                         "id": "ChannelDtmfReceived",
224                         "description": "DTMF received on a channel.",
225                         "notes": "This event is sent when the DTMF ends. There is no notification about the start of DTMF",
226                         "properties": {
227                                 "digit": {
228                                         "required": true,
229                                         "type": "string",
230                                         "description": "DTMF digit received (0-9, A-E, # or *)"
231                                 },
232                                 "channel": {
233                                         "required": true,
234                                         "type": "Channel",
235                                         "description": "The channel on which DTMF was received"
236                                 }
237                         }
238                 },
239                 "ChannelDialplan": {
240                         "id": "ChannelDialplan",
241                         "description": "Channel changed location in the dialplan.",
242                         "properties": {
243                                 "application": {
244                                         "required": true,
245                                         "type": "string",
246                                         "description": "The application that the channel is currently in."
247                                 },
248                                 "application_data": {
249                                         "required": true,
250                                         "type": "string",
251                                         "description": "The data that was passed to the application when it was invoked."
252                                 },
253                                 "channel": {
254                                         "required": true,
255                                         "type": "Channel",
256                                         "description": "The channel that changed dialplan location."
257                                 }
258                         }
259                 },
260                 "ChannelCallerId": {
261                         "id": "ChannelCallerId",
262                         "description": "Channel changed Caller ID.",
263                         "properties": {
264                                 "caller_presentation": {
265                                         "required": true,
266                                         "type": "integer",
267                                         "description": "The integer representation of the Caller Presentation value."
268                                 },
269                                 "caller_presentation_txt": {
270                                         "required": true,
271                                         "type": "string",
272                                         "description": "The text representation of the Caller Presentation value."
273                                 },
274                                 "channel": {
275                                         "required": true,
276                                         "type": "Channel",
277                                         "description": "The channel that changed Caller ID."
278                                 }
279                         }
280                 },
281                 "ChannelUserevent": {
282                         "id": "ChannelUserevent",
283                         "description": "User-generated event with additional user-defined fields in the object.",
284                         "properties": {
285                                 "eventname": {
286                                         "required": true,
287                                         "type": "string",
288                                         "description": "The name of the user event."
289                                 },
290                                 "channel": {
291                                         "required": true,
292                                         "type": "Channel",
293                                         "description": "The channel that signaled the user event."
294                                 }
295                         }
296                 },
297                 "ChannelHangupRequest": {
298                         "id": "ChannelHangupRequest",
299                         "description": "A hangup was requested on the channel.",
300                         "properties": {
301                                 "cause": {
302                                         "type": "integer",
303                                         "description": "Integer representation of the cause of the hangup."
304                                 },
305                                 "soft": {
306                                         "type": "boolean",
307                                         "description": "Whether the hangup request was a soft hangup request."
308                                 },
309                                 "channel": {
310                                         "required": true,
311                                         "type": "Channel",
312                                         "description": "The channel on which the hangup was requested."
313                                 }
314                         }
315                 },
316                 "ChannelVarset": {
317                         "id": "ChannelVarset",
318                         "description": "Channel variable changed.",
319                         "properties": {
320                                 "variable": {
321                                         "required": true,
322                                         "type": "string",
323                                         "description": "The variable that changed."
324                                 },
325                                 "value": {
326                                         "required": true,
327                                         "type": "string",
328                                         "description": "The new value of the variable."
329                                 },
330                                 "channel": {
331                                         "required": true,
332                                         "type": "Channel",
333                                         "description": "The channel on which the variable was set."
334                                 }
335                         }
336                 },
337                 "StasisEnd": {
338                         "id": "StasisEnd",
339                         "description": "Notification that a channel has left a Stasis appliction.",
340                         "properties": {
341                                 "channel": {
342                                         "required": true,
343                                         "type": "Channel"
344                                 }
345                         }
346                 },
347                 "StasisStart": {
348                         "id": "StasisStart",
349                         "description": "Notification that a channel has entered a Stasis appliction.",
350                         "properties": {
351                                 "args": {
352                                         "required": true,
353                                         "type": "List[string]",
354                                         "description": "Arguments to the application"
355                                 },
356                                 "channel": {
357                                         "required": true,
358                                         "type": "Channel"
359                                 }
360                         }
361                 }
362         }
363 }