b841485b387a649e8eec8bff962e66b40c9a6ce7
[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": "1.0.0",
6         "swaggerVersion": "1.2",
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                                         "upgrade": "websocket",
17                                         "websocketProtocol": "ari",
18                                         "summary": "WebSocket connection for events.",
19                                         "nickname": "eventWebsocket",
20                                         "responseClass": "Message",
21                                         "parameters": [
22                                                 {
23                                                         "name": "app",
24                                                         "description": "Applications to subscribe to.",
25                                                         "paramType": "query",
26                                                         "required": true,
27                                                         "allowMultiple": true,
28                                                         "dataType": "string"
29                                                 }
30                                         ]
31                                 }
32                         ]
33                 }
34         ],
35         "models": {
36                 "Message": {
37                         "id": "Message",
38                         "description": "Base type for errors and events",
39                         "discriminator": "type",
40                         "properties": {
41                                 "type": {
42                                         "type": "string",
43                                         "required": true,
44                                         "description": "Indicates the type of this message."
45                                 }
46                         },
47                         "subTypes": [
48                                 "MissingParams",
49                                 "Event"
50                         ]
51                 },
52                 "MissingParams": {
53                         "id": "MissingParams",
54                         "description": "Error event sent when required params are missing.",
55                         "properties": {
56                                 "params": {
57                                         "required": true,
58                                         "type": "List[string]",
59                                         "description": "A list of the missing parameters"
60                                 }
61                         }
62                 },
63                 "Event": {
64                         "id": "Event",
65                         "description": "Base type for asynchronous events from Asterisk.",
66                         "properties": {
67                                 "application": {
68                                         "type": "string",
69                                         "description": "Name of the application receiving the event.",
70                                         "required": true
71                                 },
72                                 "timestamp": {
73                                         "type": "Date",
74                                         "description": "Time at which this event was created.",
75                                         "required": false
76                                 }
77                         },
78                         "subTypes": [
79                                 "DeviceStateChanged",
80                                 "PlaybackStarted",
81                                 "PlaybackFinished",
82                                 "RecordingStarted",
83                                 "RecordingFinished",
84                                 "RecordingFailed",
85                                 "ApplicationReplaced",
86                                 "BridgeCreated",
87                                 "BridgeDestroyed",
88                                 "BridgeMerged",
89                                 "ChannelCreated",
90                                 "ChannelDestroyed",
91                                 "ChannelEnteredBridge",
92                                 "ChannelLeftBridge",
93                                 "ChannelStateChange",
94                                 "ChannelDtmfReceived",
95                                 "ChannelDialplan",
96                                 "ChannelCallerId",
97                                 "ChannelUserevent",
98                                 "ChannelHangupRequest",
99                                 "ChannelVarset",
100                                 "EndpointStateChange",
101                                 "Dial",
102                                 "StasisEnd",
103                                 "StasisStart"
104                         ]
105                 },
106                 "DeviceStateChanged": {
107                         "id": "DeviceStateChanged",
108                         "description": "Notification that a device state has changed.",
109                         "properties": {
110                                 "device_state": {
111                                         "type": "DeviceState",
112                                         "description": "Device state object",
113                                         "required": true
114                                 }
115                         }
116                 },
117                 "PlaybackStarted": {
118                         "id": "PlaybackStarted",
119                         "description": "Event showing the start of a media playback operation.",
120                         "properties": {
121                                 "playback": {
122                                         "type": "Playback",
123                                         "description": "Playback control object",
124                                         "required": true
125                                 }
126                         }
127                 },
128                 "PlaybackFinished": {
129                         "id": "PlaybackFinished",
130                         "description": "Event showing the completion of a media playback operation.",
131                         "properties": {
132                                 "playback": {
133                                         "type": "Playback",
134                                         "description": "Playback control object",
135                                         "required": true
136                                 }
137                         }
138                 },
139                 "RecordingStarted": {
140                         "id": "RecordingStarted",
141                         "extends": "Event",
142                         "description": "Event showing the start of a recording operation.",
143                         "properties": {
144                                 "recording": {
145                                         "type": "LiveRecording",
146                                         "description": "Recording control object",
147                                         "required": true
148                                 }
149                         }
150                 },
151                 "RecordingFinished": {
152                         "id": "RecordingFinished",
153                         "extends": "Event",
154                         "description": "Event showing the completion of a recording operation.",
155                         "properties": {
156                                 "recording": {
157                                         "type": "LiveRecording",
158                                         "description": "Recording control object",
159                                         "required": true
160                                 }
161                         }
162                 },
163                 "RecordingFailed": {
164                         "id": "RecordingFailed",
165                         "extends": "Event",
166                         "description": "Event showing failure of a recording operation.",
167                         "properties": {
168                                 "recording": {
169                                         "type": "LiveRecording",
170                                         "description": "Recording control object",
171                                         "required": true
172                                 }
173                         }
174                 },
175                 "ApplicationReplaced": {
176                         "id": "ApplicationReplaced",
177                         "description": "Notification that another WebSocket has taken over for an application.\n\nAn 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.",
178                         "properties": {}
179                 },
180                 "BridgeCreated": {
181                         "id": "BridgeCreated",
182                         "description": "Notification that a bridge has been created.",
183                         "properties": {
184                                 "bridge": {
185                                         "required": true,
186                                         "type": "Bridge"
187                                 }
188                         }
189                 },
190                 "BridgeDestroyed": {
191                         "id": "BridgeDestroyed",
192                         "description": "Notification that a bridge has been destroyed.",
193                         "properties": {
194                                 "bridge": {
195                                         "required": true,
196                                         "type": "Bridge"
197                                 }
198                         }
199                 },
200                 "BridgeMerged": {
201                         "id": "BridgeMerged",
202                         "description": "Notification that one bridge has merged into another.",
203                         "properties": {
204                                 "bridge": {
205                                         "required": true,
206                                         "type": "Bridge"
207                                 },
208                                 "bridge_from": {
209                                         "required": true,
210                                         "type": "Bridge"
211                                 }
212                         }
213                 },
214                 "ChannelCreated": {
215                         "id": "ChannelCreated",
216                         "description": "Notification that a channel has been created.",
217                         "properties": {
218                                 "channel": {
219                                         "required": true,
220                                         "type": "Channel"
221                                 }
222                         }
223                 },
224                 "ChannelDestroyed": {
225                         "id": "ChannelDestroyed",
226                         "description": "Notification that a channel has been destroyed.",
227                         "properties": {
228                                 "cause": {
229                                         "required": true,
230                                         "description": "Integer representation of the cause of the hangup",
231                                         "type": "int"
232                                 },
233                                 "cause_txt": {
234                                         "required": true,
235                                         "description": "Text representation of the cause of the hangup",
236                                         "type": "string"
237                                 },
238                                 "channel": {
239                                         "required": true,
240                                         "type": "Channel"
241                                 }
242                         }
243                 },
244                 "ChannelEnteredBridge": {
245                         "id": "ChannelEnteredBridge",
246                         "description": "Notification that a channel has entered a bridge.",
247                         "properties": {
248                                 "bridge": {
249                                         "required": true,
250                                         "type": "Bridge"
251                                 },
252                                 "channel": {
253                                         "type": "Channel"
254                                 }
255                         }
256                 },
257                 "ChannelLeftBridge": {
258                         "id": "ChannelLeftBridge",
259                         "description": "Notification that a channel has left a bridge.",
260                         "properties": {
261                                 "bridge": {
262                                         "required": true,
263                                         "type": "Bridge"
264                                 },
265                                 "channel": {
266                                         "required": true,
267                                         "type": "Channel"
268                                 }
269                         }
270                 },
271                 "ChannelStateChange": {
272                         "id": "ChannelStateChange",
273                         "description": "Notification of a channel's state change.",
274                         "properties": {
275                                 "channel": {
276                                         "required": true,
277                                         "type": "Channel"
278                                 }
279                         }
280                 },
281                 "ChannelDtmfReceived": {
282                         "id": "ChannelDtmfReceived",
283                         "description": "DTMF received on a channel.\n\nThis event is sent when the DTMF ends. There is no notification about the start of DTMF",
284                         "properties": {
285                                 "digit": {
286                                         "required": true,
287                                         "type": "string",
288                                         "description": "DTMF digit received (0-9, A-E, # or *)"
289                                 },
290                                 "duration_ms": {
291                                         "required": true,
292                                         "type": "int",
293                                         "description": "Number of milliseconds DTMF was received"
294                                 },
295                                 "channel": {
296                                         "required": true,
297                                         "type": "Channel",
298                                         "description": "The channel on which DTMF was received"
299                                 }
300                         }
301                 },
302                 "ChannelDialplan": {
303                         "id": "ChannelDialplan",
304                         "description": "Channel changed location in the dialplan.",
305                         "properties": {
306                                 "channel": {
307                                         "required": true,
308                                         "type": "Channel",
309                                         "description": "The channel that changed dialplan location."
310                                 },
311                                 "dialplan_app": {
312                                         "required": true,
313                                         "type": "string",
314                                         "description": "The application about to be executed."
315                                 },
316                                 "dialplan_app_data": {
317                                         "required": true,
318                                         "type": "string",
319                                         "description": "The data to be passed to the application."
320                                 }
321                         }
322                 },
323                 "ChannelCallerId": {
324                         "id": "ChannelCallerId",
325                         "description": "Channel changed Caller ID.",
326                         "properties": {
327                                 "caller_presentation": {
328                                         "required": true,
329                                         "type": "int",
330                                         "description": "The integer representation of the Caller Presentation value."
331                                 },
332                                 "caller_presentation_txt": {
333                                         "required": true,
334                                         "type": "string",
335                                         "description": "The text representation of the Caller Presentation value."
336                                 },
337                                 "channel": {
338                                         "required": true,
339                                         "type": "Channel",
340                                         "description": "The channel that changed Caller ID."
341                                 }
342                         }
343                 },
344                 "ChannelUserevent": {
345                         "id": "ChannelUserevent",
346                         "description": "User-generated event with additional user-defined fields in the object.",
347                         "properties": {
348                                 "eventname": {
349                                         "required": true,
350                                         "type": "string",
351                                         "description": "The name of the user event."
352                                 },
353                                 "channel": {
354                                         "required": true,
355                                         "type": "Channel",
356                                         "description": "The channel that signaled the user event."
357                                 },
358                                 "userevent": {
359                                         "required": true,
360                                         "type": "object",
361                                         "description": "Custom Userevent data"
362                                 }
363                         }
364                 },
365                 "ChannelHangupRequest": {
366                         "id": "ChannelHangupRequest",
367                         "description": "A hangup was requested on the channel.",
368                         "properties": {
369                                 "cause": {
370                                         "type": "int",
371                                         "description": "Integer representation of the cause of the hangup."
372                                 },
373                                 "soft": {
374                                         "type": "boolean",
375                                         "description": "Whether the hangup request was a soft hangup request."
376                                 },
377                                 "channel": {
378                                         "required": true,
379                                         "type": "Channel",
380                                         "description": "The channel on which the hangup was requested."
381                                 }
382                         }
383                 },
384                 "ChannelVarset": {
385                         "id": "ChannelVarset",
386                         "description": "Channel variable changed.",
387                         "properties": {
388                                 "variable": {
389                                         "required": true,
390                                         "type": "string",
391                                         "description": "The variable that changed."
392                                 },
393                                 "value": {
394                                         "required": true,
395                                         "type": "string",
396                                         "description": "The new value of the variable."
397                                 },
398                                 "channel": {
399                                         "required": false,
400                                         "type": "Channel",
401                                         "description": "The channel on which the variable was set.\n\nIf missing, the variable is a global variable."
402                                 }
403                         }
404                 },
405                 "EndpointStateChange": {
406                         "id": "EndpointStateChange",
407                         "description": "Endpoint state changed.",
408                         "properties": {
409                                 "endpoint": {
410                                         "required": true,
411                                         "type": "Endpoint"
412                                 }
413                         }
414                 },
415                 "Dial": {
416                         "id": "Dial",
417                         "description": "Dialing state has changed.",
418                         "properties": {
419                                 "caller": {
420                                         "required": false,
421                                         "type": "Channel",
422                                         "description": "The calling channel."
423                                 },
424                                 "peer": {
425                                         "required": true,
426                                         "type": "Channel",
427                                         "description": "The dialed channel."
428                                 },
429                                 "forward": {
430                                         "required": false,
431                                         "type": "string",
432                                         "description": "Forwarding target requested by the original dialed channel."
433                                 },
434                                 "forwarded": {
435                                         "required": false,
436                                         "type": "Channel",
437                                         "description": "Channel that the caller has been forwarded to."
438                                 },
439                                 "dialstring": {
440                                         "required": false,
441                                         "type": "string",
442                                         "description": "The dial string for calling the peer channel."
443                                 },
444                                 "dialstatus": {
445                                         "required": true,
446                                         "type": "string",
447                                         "description": "Current status of the dialing attempt to the peer."
448                                 }
449                         }
450                 },
451                 "StasisEnd": {
452                         "id": "StasisEnd",
453                         "description": "Notification that a channel has left a Stasis application.",
454                         "properties": {
455                                 "channel": {
456                                         "required": true,
457                                         "type": "Channel"
458                                 }
459                         }
460                 },
461                 "StasisStart": {
462                         "id": "StasisStart",
463                         "description": "Notification that a channel has entered a Stasis application.",
464                         "properties": {
465                                 "args": {
466                                         "required": true,
467                                         "type": "List[string]",
468                                         "description": "Arguments to the application"
469                                 },
470                                 "channel": {
471                                         "required": true,
472                                         "type": "Channel"
473                                 }
474                         }
475                 }
476         }
477 }