a9ea45c81c899461327dfc2fb1528c770d0f0485
[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.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                                 "PlaybackStarted",
80                                 "PlaybackFinished",
81                                 "ApplicationReplaced",
82                                 "BridgeCreated",
83                                 "BridgeDestroyed",
84                                 "BridgeMerged",
85                                 "ChannelCreated",
86                                 "ChannelDestroyed",
87                                 "ChannelEnteredBridge",
88                                 "ChannelLeftBridge",
89                                 "ChannelStateChange",
90                                 "ChannelDtmfReceived",
91                                 "ChannelDialplan",
92                                 "ChannelCallerId",
93                                 "ChannelUserevent",
94                                 "ChannelHangupRequest",
95                                 "ChannelVarset",
96                                 "EndpointStateChange",
97                                 "StasisEnd",
98                                 "StasisStart"
99                         ]
100                 },
101                 "PlaybackStarted": {
102                         "id": "PlaybackStarted",
103                         "description": "Event showing the start of a media playback operation.",
104                         "properties": {
105                                 "playback": {
106                                         "type": "Playback",
107                                         "description": "Playback control object",
108                                         "required": true
109                                 }
110                         }
111                 },
112                 "PlaybackFinished": {
113                         "id": "PlaybackFinished",
114                         "description": "Event showing the completion of a media playback operation.",
115                         "properties": {
116                                 "playback": {
117                                         "type": "Playback",
118                                         "description": "Playback control object",
119                                         "required": true
120                                 }
121                         }
122                 },
123                 "ApplicationReplaced": {
124                         "id": "ApplicationReplaced",
125                         "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.",
126                         "properties": {}
127                 },
128                 "BridgeCreated": {
129                         "id": "BridgeCreated",
130                         "description": "Notification that a bridge has been created.",
131                         "properties": {
132                                 "bridge": {
133                                         "required": true,
134                                         "type": "Bridge"
135                                 }
136                         }
137                 },
138                 "BridgeDestroyed": {
139                         "id": "BridgeDestroyed",
140                         "description": "Notification that a bridge has been destroyed.",
141                         "properties": {
142                                 "bridge": {
143                                         "required": true,
144                                         "type": "Bridge"
145                                 }
146                         }
147                 },
148                 "BridgeMerged": {
149                         "id": "BridgeMerged",
150                         "description": "Notification that one bridge has merged into another.",
151                         "properties": {
152                                 "bridge": {
153                                         "required": true,
154                                         "type": "Bridge"
155                                 },
156                                 "bridge_from": {
157                                         "required": true,
158                                         "type": "Bridge"
159                                 }
160                         }
161                 },
162                 "ChannelCreated": {
163                         "id": "ChannelCreated",
164                         "description": "Notification that a channel has been created.",
165                         "properties": {
166                                 "channel": {
167                                         "required": true,
168                                         "type": "Channel"
169                                 }
170                         }
171                 },
172                 "ChannelDestroyed": {
173                         "id": "ChannelDestroyed",
174                         "description": "Notification that a channel has been destroyed.",
175                         "properties": {
176                                 "cause": {
177                                         "required": true,
178                                         "description": "Integer representation of the cause of the hangup",
179                                         "type": "int"
180                                 },
181                                 "cause_txt": {
182                                         "required": true,
183                                         "description": "Text representation of the cause of the hangup",
184                                         "type": "string"
185                                 },
186                                 "channel": {
187                                         "required": true,
188                                         "type": "Channel"
189                                 }
190                         }
191                 },
192                 "ChannelEnteredBridge": {
193                         "id": "ChannelEnteredBridge",
194                         "description": "Notification that a channel has entered a bridge.",
195                         "properties": {
196                                 "bridge": {
197                                         "required": true,
198                                         "type": "Bridge"
199                                 },
200                                 "channel": {
201                                         "type": "Channel"
202                                 }
203                         }
204                 },
205                 "ChannelLeftBridge": {
206                         "id": "ChannelLeftBridge",
207                         "description": "Notification that a channel has left a bridge.",
208                         "properties": {
209                                 "bridge": {
210                                         "required": true,
211                                         "type": "Bridge"
212                                 },
213                                 "channel": {
214                                         "required": true,
215                                         "type": "Channel"
216                                 }
217                         }
218                 },
219                 "ChannelStateChange": {
220                         "id": "ChannelStateChange",
221                         "description": "Notification of a channel's state change.",
222                         "properties": {
223                                 "channel": {
224                                         "required": true,
225                                         "type": "Channel"
226                                 }
227                         }
228                 },
229                 "ChannelDtmfReceived": {
230                         "id": "ChannelDtmfReceived",
231                         "description": "DTMF received on a channel.\n\nThis event is sent when the DTMF ends. There is no notification about the start of DTMF",
232                         "properties": {
233                                 "digit": {
234                                         "required": true,
235                                         "type": "string",
236                                         "description": "DTMF digit received (0-9, A-E, # or *)"
237                                 },
238                                 "duration_ms": {
239                                         "required": true,
240                                         "type": "int",
241                                         "description": "Number of milliseconds DTMF was received"
242                                 },
243                                 "channel": {
244                                         "required": true,
245                                         "type": "Channel",
246                                         "description": "The channel on which DTMF was received"
247                                 }
248                         }
249                 },
250                 "ChannelDialplan": {
251                         "id": "ChannelDialplan",
252                         "description": "Channel changed location in the dialplan.",
253                         "properties": {
254                                 "channel": {
255                                         "required": true,
256                                         "type": "Channel",
257                                         "description": "The channel that changed dialplan location."
258                                 },
259                                 "dialplan_app": {
260                                         "required": true,
261                                         "type": "string",
262                                         "description": "The application about to be executed."
263                                 },
264                                 "dialplan_app_data": {
265                                         "required": true,
266                                         "type": "string",
267                                         "description": "The data to be passed to the application."
268                                 }
269                         }
270                 },
271                 "ChannelCallerId": {
272                         "id": "ChannelCallerId",
273                         "description": "Channel changed Caller ID.",
274                         "properties": {
275                                 "caller_presentation": {
276                                         "required": true,
277                                         "type": "int",
278                                         "description": "The integer representation of the Caller Presentation value."
279                                 },
280                                 "caller_presentation_txt": {
281                                         "required": true,
282                                         "type": "string",
283                                         "description": "The text representation of the Caller Presentation value."
284                                 },
285                                 "channel": {
286                                         "required": true,
287                                         "type": "Channel",
288                                         "description": "The channel that changed Caller ID."
289                                 }
290                         }
291                 },
292                 "ChannelUserevent": {
293                         "id": "ChannelUserevent",
294                         "description": "User-generated event with additional user-defined fields in the object.",
295                         "properties": {
296                                 "eventname": {
297                                         "required": true,
298                                         "type": "string",
299                                         "description": "The name of the user event."
300                                 },
301                                 "channel": {
302                                         "required": true,
303                                         "type": "Channel",
304                                         "description": "The channel that signaled the user event."
305                                 },
306                                 "userevent": {
307                                         "required": true,
308                                         "type": "object",
309                                         "description": "Custom Userevent data"
310                                 }
311                         }
312                 },
313                 "ChannelHangupRequest": {
314                         "id": "ChannelHangupRequest",
315                         "description": "A hangup was requested on the channel.",
316                         "properties": {
317                                 "cause": {
318                                         "type": "int",
319                                         "description": "Integer representation of the cause of the hangup."
320                                 },
321                                 "soft": {
322                                         "type": "boolean",
323                                         "description": "Whether the hangup request was a soft hangup request."
324                                 },
325                                 "channel": {
326                                         "required": true,
327                                         "type": "Channel",
328                                         "description": "The channel on which the hangup was requested."
329                                 }
330                         }
331                 },
332                 "ChannelVarset": {
333                         "id": "ChannelVarset",
334                         "description": "Channel variable changed.",
335                         "properties": {
336                                 "variable": {
337                                         "required": true,
338                                         "type": "string",
339                                         "description": "The variable that changed."
340                                 },
341                                 "value": {
342                                         "required": true,
343                                         "type": "string",
344                                         "description": "The new value of the variable."
345                                 },
346                                 "channel": {
347                                         "required": false,
348                                         "type": "Channel",
349                                         "description": "The channel on which the variable was set.\n\nIf missing, the variable is a global variable."
350                                 }
351                         }
352                 },
353                 "EndpointStateChange": {
354                         "id": "EndpointStateChange",
355                         "description": "Endpoint state changed.",
356                         "properties": {
357                                 "endpoint": {
358                                         "required": true,
359                                         "type": "Endpoint"
360                                 }
361                         }
362                 },
363                 "StasisEnd": {
364                         "id": "StasisEnd",
365                         "description": "Notification that a channel has left a Stasis appliction.",
366                         "properties": {
367                                 "channel": {
368                                         "required": true,
369                                         "type": "Channel"
370                                 }
371                         }
372                 },
373                 "StasisStart": {
374                         "id": "StasisStart",
375                         "description": "Notification that a channel has entered a Stasis appliction.",
376                         "properties": {
377                                 "args": {
378                                         "required": true,
379                                         "type": "List[string]",
380                                         "description": "Arguments to the application"
381                                 },
382                                 "channel": {
383                                         "required": true,
384                                         "type": "Channel"
385                                 }
386                         }
387                 }
388         }
389 }