0e0a822cf0874ed447cf9f18713048d2d03a62e8
[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                                 "channel_created": { "type": "ChannelCreated" },
60                                 "channel_destroyed": { "type": "ChannelDestroyed" },
61                                 "channel_snapshot": { "type": "ChannelSnapshot" },
62                                 "channel_entered_bridge": { "type": "ChannelEnteredBridge" },
63                                 "channel_left_bridge": { "type": "ChannelLeftBridge" },
64                                 "channel_state_change": { "type": "ChannelStateChange" },
65                                 "channel_dtmf_received": { "type": "ChannelDtmfReceived" },
66                                 "channel_dialplan": { "type": "ChannelDialplan" },
67                                 "channel_caller_id": { "type": "ChannelCallerId" },
68                                 "channel_userevent": { "type": "ChannelUserevent" },
69                                 "channel_hangup_request": { "type": "ChannelHangupRequest" },
70                                 "channel_varset": { "type": "ChannelVarset" },
71                                 "stasis_end": { "type": "StasisEnd" },
72                                 "stasis_start": { "type": "StasisStart" },
73                                 "playback_started": { "type": "PlaybackStarted" },
74                                 "playback_finished": { "type": "PlaybackFinished" }
75                         }
76                 },
77                 "PlaybackStarted": {
78                         "id": "PlaybackStarted",
79                         "description": "Event showing the start of a media playback operation.",
80                         "properties": {
81                                 "playback": {
82                                         "type": "Playback",
83                                         "description": "Playback control object",
84                                         "required": true
85                                 }
86                         }
87                 },
88                 "PlaybackFinished": {
89                         "id": "PlaybackFinished",
90                         "description": "Event showing the completion of a media playback operation.",
91                         "properties": {
92                                 "playback": {
93                                         "type": "Playback",
94                                         "description": "Playback control object",
95                                         "required": true
96                                 }
97                         }
98                 },
99                 "ApplicationReplaced": {
100                         "id": "ApplicationReplaced",
101                         "description": "Notification that another WebSocket has taken over for an application.",
102                         "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.",
103                         "properties": {
104                                 "application": {
105                                         "required": true,
106                                         "type": "string"
107                                 }
108                         }
109                 },
110                 "BridgeCreated": {
111                         "id": "BridgeCreated",
112                         "description": "Notification that a bridge has been created.",
113                         "properties": {
114                                 "bridge": {
115                                         "required": true,
116                                         "type": "Bridge"
117                                 }
118                         }
119                 },
120                 "BridgeDestroyed": {
121                         "id": "BridgeDestroyed",
122                         "description": "Notification that a bridge has been destroyed.",
123                         "properties": {
124                                 "bridge": {
125                                         "required": true,
126                                         "type": "Bridge"
127                                 }
128                         }
129                 },
130                 "ChannelCreated": {
131                         "id": "ChannelCreated",
132                         "description": "Notification that a channel has been created.",
133                         "properties": {
134                                 "channel": {
135                                         "required": true,
136                                         "type": "Channel"
137                                 }
138                         }
139                 },
140                 "ChannelSnapshot": {
141                         "id": "ChannelSnapshot",
142                         "description": "Some part of channel state changed.",
143                         "properties": {
144                                 "channel": {
145                                         "required": true,
146                                         "type": "Channel"
147                                 }
148                         }
149                 },
150                 "ChannelDestroyed": {
151                         "id": "ChannelDestroyed",
152                         "description": "Notification that a channel has been destroyed.",
153                         "properties": {
154                                 "cause": {
155                                         "required": true,
156                                         "description": "Integer representation of the cause of the hangup",
157                                         "type": "integer"
158                                 },
159                                 "cause_txt": {
160                                         "required": true,
161                                         "description": "Text representation of the cause of the hangup",
162                                         "type": "string"
163                                 },
164                                 "channel": {
165                                         "required": true,
166                                         "type": "Channel"
167                                 }
168                         }
169                 },
170                 "ChannelEnteredBridge": {
171                         "id": "ChannelEnteredBridge",
172                         "description": "Notification that a channel has entered a bridge.",
173                         "properties": {
174                                 "bridge": {
175                                         "required": true,
176                                         "type": "Bridge"
177                                 },
178                                 "channel": {
179                                         "type": "Channel"
180                                 }
181                         }
182                 },
183                 "ChannelLeftBridge": {
184                         "id": "ChannelLeftBridge",
185                         "description": "Notification that a channel has left a bridge.",
186                         "properties": {
187                                 "bridge": {
188                                         "required": true,
189                                         "type": "Bridge"
190                                 },
191                                 "channel": {
192                                         "required": true,
193                                         "type": "Channel"
194                                 }
195                         }
196                 },
197                 "ChannelStateChange": {
198                         "id": "ChannelStateChange",
199                         "description": "Notification of a channel's state change.",
200                         "properties": {
201                                 "channel": {
202                                         "required": true,
203                                         "type": "Channel"
204                                 }
205                         }
206                 },
207                 "ChannelDtmfReceived": {
208                         "id": "ChannelDtmfReceived",
209                         "description": "DTMF received on a channel.",
210                         "notes": "This event is sent when the DTMF ends. There is no notification about the start of DTMF",
211                         "properties": {
212                                 "digit": {
213                                         "required": true,
214                                         "type": "string",
215                                         "description": "DTMF digit received (0-9, A-E, # or *)"
216                                 },
217                                 "channel": {
218                                         "required": true,
219                                         "type": "Channel",
220                                         "description": "The channel on which DTMF was received"
221                                 }
222                         }
223                 },
224                 "ChannelDialplan": {
225                         "id": "ChannelDialplan",
226                         "description": "Channel changed location in the dialplan.",
227                         "properties": {
228                                 "application": {
229                                         "required": true,
230                                         "type": "string",
231                                         "description": "The application that the channel is currently in."
232                                 },
233                                 "application_data": {
234                                         "required": true,
235                                         "type": "string",
236                                         "description": "The data that was passed to the application when it was invoked."
237                                 },
238                                 "channel": {
239                                         "required": true,
240                                         "type": "Channel",
241                                         "description": "The channel that changed dialplan location."
242                                 }
243                         }
244                 },
245                 "ChannelCallerId": {
246                         "id": "ChannelCallerId",
247                         "description": "Channel changed Caller ID.",
248                         "properties": {
249                                 "caller_presentation": {
250                                         "required": true,
251                                         "type": "integer",
252                                         "description": "The integer representation of the Caller Presentation value."
253                                 },
254                                 "caller_presentation_txt": {
255                                         "required": true,
256                                         "type": "string",
257                                         "description": "The text representation of the Caller Presentation value."
258                                 },
259                                 "channel": {
260                                         "required": true,
261                                         "type": "Channel",
262                                         "description": "The channel that changed Caller ID."
263                                 }
264                         }
265                 },
266                 "ChannelUserevent": {
267                         "id": "ChannelUserevent",
268                         "description": "User-generated event with additional user-defined fields in the object.",
269                         "properties": {
270                                 "eventname": {
271                                         "required": true,
272                                         "type": "string",
273                                         "description": "The name of the user event."
274                                 },
275                                 "channel": {
276                                         "required": true,
277                                         "type": "Channel",
278                                         "description": "The channel that signaled the user event."
279                                 }
280                         }
281                 },
282                 "ChannelHangupRequest": {
283                         "id": "ChannelHangupRequest",
284                         "description": "A hangup was requested on the channel.",
285                         "properties": {
286                                 "cause": {
287                                         "type": "integer",
288                                         "description": "Integer representation of the cause of the hangup."
289                                 },
290                                 "soft": {
291                                         "type": "boolean",
292                                         "description": "Whether the hangup request was a soft hangup request."
293                                 },
294                                 "channel": {
295                                         "required": true,
296                                         "type": "Channel",
297                                         "description": "The channel on which the hangup was requested."
298                                 }
299                         }
300                 },
301                 "ChannelVarset": {
302                         "id": "ChannelVarset",
303                         "description": "Channel variable changed.",
304                         "properties": {
305                                 "variable": {
306                                         "required": true,
307                                         "type": "string",
308                                         "description": "The variable that changed."
309                                 },
310                                 "value": {
311                                         "required": true,
312                                         "type": "string",
313                                         "description": "The new value of the variable."
314                                 },
315                                 "channel": {
316                                         "required": true,
317                                         "type": "Channel",
318                                         "description": "The channel on which the variable was set."
319                                 }
320                         }
321                 },
322                 "StasisEnd": {
323                         "id": "StasisEnd",
324                         "description": "Notification that a channel has left a Stasis appliction.",
325                         "properties": {
326                                 "channel": {
327                                         "required": true,
328                                         "type": "Channel"
329                                 }
330                         }
331                 },
332                 "StasisStart": {
333                         "id": "StasisStart",
334                         "description": "Notification that a channel has entered a Stasis appliction.",
335                         "properties": {
336                                 "args": {
337                                         "required": true,
338                                         "type": "List[string]",
339                                         "description": "Arguments to the application"
340                                 },
341                                 "channel": {
342                                         "required": true,
343                                         "type": "Channel"
344                                 }
345                         }
346                 }
347         }
348 }