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