manager/ARI: Update version to 2.4.0/1.4.0; Update UPGRADE.txt
[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.4.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                         "path": "/events/user/{eventName}",
36                         "description": "Stasis application user events",
37                         "operations": [
38                                 {
39                                         "httpMethod": "POST",
40                                         "summary": "Generate a user event.",
41                                         "nickname": "userEvent",
42                                         "responseClass": "void",
43                                         "parameters": [
44                                                 {
45                                                         "name": "eventName",
46                                                         "description": "Event name",
47                                                         "paramType": "path",
48                                                         "required": true,
49                                                         "allowMultiple": false,
50                                                         "dataType": "string"
51                                                 },
52                                                 {
53                                                         "name": "application",
54                                                         "description": "The name of the application that will receive this event",
55                                                         "paramType": "query",
56                                                         "required": true,
57                                                         "allowMultiple": false,
58                                                         "dataType": "string"
59                                                 },
60                                                 {
61                                                         "name": "source",
62                                                         "description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource}, deviceState:{deviceName}",
63                                                         "paramType": "query",
64                                                         "required": false,
65                                                         "allowMultiple": true,
66                                                         "dataType": "string"
67                                                 },
68                                                 {
69                                                         "name": "variables",
70                                                         "description": "The \"variables\" key in the body object holds custom key/value pairs to add to the user event. Ex. { \"variables\": { \"key\": \"value\" } }",
71                                                         "paramType": "body",
72                                                         "required": false,
73                                                         "allowMultiple": false,
74                                                         "dataType": "containers"
75                                                 }
76                                         ],
77                                         "errorResponses": [
78                                                 {
79                                                         "code": 404,
80                                                         "reason": "Application does not exist."
81                                                 },
82                                                 {
83                                                         "code": 422,
84                                                         "reason": "Event source not found."
85                                                 },
86                                                 {
87                                                         "code": 400,
88                                                         "reason": "Invalid even tsource URI or userevent data."
89                                                 }
90                                         ]
91                                 }
92                         ]
93                 }
94         ],
95         "models": {
96                 "Message": {
97                         "id": "Message",
98                         "description": "Base type for errors and events",
99                         "discriminator": "type",
100                         "properties": {
101                                 "type": {
102                                         "type": "string",
103                                         "required": true,
104                                         "description": "Indicates the type of this message."
105                                 }
106                         },
107                         "subTypes": [
108                                 "MissingParams",
109                                 "Event"
110                         ]
111                 },
112                 "MissingParams": {
113                         "id": "MissingParams",
114                         "description": "Error event sent when required params are missing.",
115                         "properties": {
116                                 "params": {
117                                         "required": true,
118                                         "type": "List[string]",
119                                         "description": "A list of the missing parameters"
120                                 }
121                         }
122                 },
123                 "Event": {
124                         "id": "Event",
125                         "description": "Base type for asynchronous events from Asterisk.",
126                         "properties": {
127                                 "application": {
128                                         "type": "string",
129                                         "description": "Name of the application receiving the event.",
130                                         "required": true
131                                 },
132                                 "timestamp": {
133                                         "type": "Date",
134                                         "description": "Time at which this event was created.",
135                                         "required": false
136                                 }
137                         },
138                         "subTypes": [
139                                 "DeviceStateChanged",
140                                 "PlaybackStarted",
141                                 "PlaybackFinished",
142                                 "RecordingStarted",
143                                 "RecordingFinished",
144                                 "RecordingFailed",
145                                 "ApplicationReplaced",
146                                 "BridgeCreated",
147                                 "BridgeDestroyed",
148                                 "BridgeMerged",
149                                 "BridgeBlindTransfer",
150                                 "BridgeAttendedTransfer",
151                                 "ChannelCreated",
152                                 "ChannelDestroyed",
153                                 "ChannelEnteredBridge",
154                                 "ChannelLeftBridge",
155                                 "ChannelStateChange",
156                                 "ChannelDtmfReceived",
157                                 "ChannelDialplan",
158                                 "ChannelCallerId",
159                                 "ChannelUserevent",
160                                 "ChannelHangupRequest",
161                                 "ChannelVarset",
162                                 "ChannelTalkingStarted",
163                                 "ChannelTalkingFinished",
164                                 "EndpointStateChange",
165                                 "Dial",
166                                 "StasisEnd",
167                                 "StasisStart"
168                         ]
169                 },
170                 "DeviceStateChanged": {
171                         "id": "DeviceStateChanged",
172                         "description": "Notification that a device state has changed.",
173                         "properties": {
174                                 "device_state": {
175                                         "type": "DeviceState",
176                                         "description": "Device state object",
177                                         "required": true
178                                 }
179                         }
180                 },
181                 "PlaybackStarted": {
182                         "id": "PlaybackStarted",
183                         "description": "Event showing the start of a media playback operation.",
184                         "properties": {
185                                 "playback": {
186                                         "type": "Playback",
187                                         "description": "Playback control object",
188                                         "required": true
189                                 }
190                         }
191                 },
192                 "PlaybackFinished": {
193                         "id": "PlaybackFinished",
194                         "description": "Event showing the completion of a media playback operation.",
195                         "properties": {
196                                 "playback": {
197                                         "type": "Playback",
198                                         "description": "Playback control object",
199                                         "required": true
200                                 }
201                         }
202                 },
203                 "RecordingStarted": {
204                         "id": "RecordingStarted",
205                         "extends": "Event",
206                         "description": "Event showing the start of a recording operation.",
207                         "properties": {
208                                 "recording": {
209                                         "type": "LiveRecording",
210                                         "description": "Recording control object",
211                                         "required": true
212                                 }
213                         }
214                 },
215                 "RecordingFinished": {
216                         "id": "RecordingFinished",
217                         "extends": "Event",
218                         "description": "Event showing the completion of a recording operation.",
219                         "properties": {
220                                 "recording": {
221                                         "type": "LiveRecording",
222                                         "description": "Recording control object",
223                                         "required": true
224                                 }
225                         }
226                 },
227                 "RecordingFailed": {
228                         "id": "RecordingFailed",
229                         "extends": "Event",
230                         "description": "Event showing failure of a recording operation.",
231                         "properties": {
232                                 "recording": {
233                                         "type": "LiveRecording",
234                                         "description": "Recording control object",
235                                         "required": true
236                                 }
237                         }
238                 },
239                 "ApplicationReplaced": {
240                         "id": "ApplicationReplaced",
241                         "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.",
242                         "properties": {}
243                 },
244                 "BridgeCreated": {
245                         "id": "BridgeCreated",
246                         "description": "Notification that a bridge has been created.",
247                         "properties": {
248                                 "bridge": {
249                                         "required": true,
250                                         "type": "Bridge"
251                                 }
252                         }
253                 },
254                 "BridgeDestroyed": {
255                         "id": "BridgeDestroyed",
256                         "description": "Notification that a bridge has been destroyed.",
257                         "properties": {
258                                 "bridge": {
259                                         "required": true,
260                                         "type": "Bridge"
261                                 }
262                         }
263                 },
264                 "BridgeMerged": {
265                         "id": "BridgeMerged",
266                         "description": "Notification that one bridge has merged into another.",
267                         "properties": {
268                                 "bridge": {
269                                         "required": true,
270                                         "type": "Bridge"
271                                 },
272                                 "bridge_from": {
273                                         "required": true,
274                                         "type": "Bridge"
275                                 }
276                         }
277                 },
278                 "BridgeBlindTransfer": {
279                         "id": "BridgeBlindTransfer",
280                         "description": "Notification that a blind transfer has occurred.",
281                         "properties": {
282                                 "channel": {
283                                         "description": "The channel performing the blind transfer",
284                                         "required": true,
285                                         "type": "Channel"
286                                 },
287                                 "exten": {
288                                         "description": "The extension transferred to",
289                                         "required": true,
290                                         "type": "string"
291                                 },
292                                 "context": {
293                                         "description": "The context transferred to",
294                                         "required": true,
295                                         "type": "string"
296                                 },
297                                 "result": {
298                                         "description": "The result of the transfer attempt",
299                                         "required": true,
300                                         "type": "string"
301                                 },
302                                 "is_external": {
303                                         "description": "Whether the transfer was externally initiated or not",
304                                         "required": true,
305                                         "type": "boolean"
306                                 },
307                                 "bridge": {
308                                         "description": "The bridge being transferred",
309                                         "type": "Bridge"
310                                 }
311                         }
312                 },
313                 "BridgeAttendedTransfer": {
314                         "id": "BridgeAttendedTransfer",
315                         "description": "Notification that an attended transfer has occurred.",
316                         "properties": {
317                                 "transferer_first_leg": {
318                                         "description": "First leg of the transferer",
319                                         "required": true,
320                                         "type": "Channel"
321                                 },
322                                 "transferer_second_leg": {
323                                         "description": "Second leg of the transferer",
324                                         "required": true,
325                                         "type": "Channel"
326                                 },
327                                 "result": {
328                                         "description": "The result of the transfer attempt",
329                                         "required": true,
330                                         "type": "string"
331                                 },
332                                 "is_external": {
333                                         "description": "Whether the transfer was externally initiated or not",
334                                         "required": true,
335                                         "type": "boolean"
336                                 },
337                                 "transferer_first_leg_bridge": {
338                                         "description": "Bridge the transferer first leg is in",
339                                         "type": "Bridge"
340                                 },
341                                 "transferer_second_leg_bridge": {
342                                         "description": "Bridge the transferer second leg is in",
343                                         "type": "Bridge"
344                                 },
345                                 "destination_type": {
346                                         "description": "How the transfer was accomplished",
347                                         "required": true,
348                                         "type": "string"
349                                 },
350                                 "destination_bridge": {
351                                         "description": "Bridge that survived the merge result",
352                                         "type": "string"
353                                 },
354                                 "destination_application": {
355                                         "description": "Application that has been transferred into",
356                                         "type": "string"
357                                 },
358                                 "destination_link_first_leg": {
359                                         "description": "First leg of a link transfer result",
360                                         "type": "Channel"
361                                 },
362                                 "destination_link_second_leg": {
363                                         "description": "Second leg of a link transfer result",
364                                         "type": "Channel"
365                                 },
366                                 "destination_threeway_channel": {
367                                         "description": "Transferer channel that survived the threeway result",
368                                         "type": "Channel"
369                                 },
370                                 "destination_threeway_bridge": {
371                                         "description": "Bridge that survived the threeway result",
372                                         "type": "Bridge"
373                                 }
374                         }
375                 },
376                 "ChannelCreated": {
377                         "id": "ChannelCreated",
378                         "description": "Notification that a channel has been created.",
379                         "properties": {
380                                 "channel": {
381                                         "required": true,
382                                         "type": "Channel"
383                                 }
384                         }
385                 },
386                 "ChannelDestroyed": {
387                         "id": "ChannelDestroyed",
388                         "description": "Notification that a channel has been destroyed.",
389                         "properties": {
390                                 "cause": {
391                                         "required": true,
392                                         "description": "Integer representation of the cause of the hangup",
393                                         "type": "int"
394                                 },
395                                 "cause_txt": {
396                                         "required": true,
397                                         "description": "Text representation of the cause of the hangup",
398                                         "type": "string"
399                                 },
400                                 "channel": {
401                                         "required": true,
402                                         "type": "Channel"
403                                 }
404                         }
405                 },
406                 "ChannelEnteredBridge": {
407                         "id": "ChannelEnteredBridge",
408                         "description": "Notification that a channel has entered a bridge.",
409                         "properties": {
410                                 "bridge": {
411                                         "required": true,
412                                         "type": "Bridge"
413                                 },
414                                 "channel": {
415                                         "type": "Channel"
416                                 }
417                         }
418                 },
419                 "ChannelLeftBridge": {
420                         "id": "ChannelLeftBridge",
421                         "description": "Notification that a channel has left a bridge.",
422                         "properties": {
423                                 "bridge": {
424                                         "required": true,
425                                         "type": "Bridge"
426                                 },
427                                 "channel": {
428                                         "required": true,
429                                         "type": "Channel"
430                                 }
431                         }
432                 },
433                 "ChannelStateChange": {
434                         "id": "ChannelStateChange",
435                         "description": "Notification of a channel's state change.",
436                         "properties": {
437                                 "channel": {
438                                         "required": true,
439                                         "type": "Channel"
440                                 }
441                         }
442                 },
443                 "ChannelDtmfReceived": {
444                         "id": "ChannelDtmfReceived",
445                         "description": "DTMF received on a channel.\n\nThis event is sent when the DTMF ends. There is no notification about the start of DTMF",
446                         "properties": {
447                                 "digit": {
448                                         "required": true,
449                                         "type": "string",
450                                         "description": "DTMF digit received (0-9, A-E, # or *)"
451                                 },
452                                 "duration_ms": {
453                                         "required": true,
454                                         "type": "int",
455                                         "description": "Number of milliseconds DTMF was received"
456                                 },
457                                 "channel": {
458                                         "required": true,
459                                         "type": "Channel",
460                                         "description": "The channel on which DTMF was received"
461                                 }
462                         }
463                 },
464                 "ChannelDialplan": {
465                         "id": "ChannelDialplan",
466                         "description": "Channel changed location in the dialplan.",
467                         "properties": {
468                                 "channel": {
469                                         "required": true,
470                                         "type": "Channel",
471                                         "description": "The channel that changed dialplan location."
472                                 },
473                                 "dialplan_app": {
474                                         "required": true,
475                                         "type": "string",
476                                         "description": "The application about to be executed."
477                                 },
478                                 "dialplan_app_data": {
479                                         "required": true,
480                                         "type": "string",
481                                         "description": "The data to be passed to the application."
482                                 }
483                         }
484                 },
485                 "ChannelCallerId": {
486                         "id": "ChannelCallerId",
487                         "description": "Channel changed Caller ID.",
488                         "properties": {
489                                 "caller_presentation": {
490                                         "required": true,
491                                         "type": "int",
492                                         "description": "The integer representation of the Caller Presentation value."
493                                 },
494                                 "caller_presentation_txt": {
495                                         "required": true,
496                                         "type": "string",
497                                         "description": "The text representation of the Caller Presentation value."
498                                 },
499                                 "channel": {
500                                         "required": true,
501                                         "type": "Channel",
502                                         "description": "The channel that changed Caller ID."
503                                 }
504                         }
505                 },
506                 "ChannelUserevent": {
507                         "id": "ChannelUserevent",
508                         "description": "User-generated event with additional user-defined fields in the object.",
509                         "properties": {
510                                 "eventname": {
511                                         "required": true,
512                                         "type": "string",
513                                         "description": "The name of the user event."
514                                 },
515                                 "channel": {
516                                         "required": false,
517                                         "type": "Channel",
518                                         "description": "A channel that is signaled with the user event."
519                                 },
520                                 "bridge": {
521                                         "required": false,
522                                         "type": "Bridge",
523                                         "description": "A bridge that is signaled with the user event."
524                                 },
525                                 "endpoint": {
526                                         "required": false,
527                                         "type": "Endpoint",
528                                         "description": "A endpoint that is signaled with the user event."
529                                 },
530                                 "userevent": {
531                                         "required": true,
532                                         "type": "object",
533                                         "description": "Custom Userevent data"
534                                 }
535                         }
536                 },
537                 "ChannelHangupRequest": {
538                         "id": "ChannelHangupRequest",
539                         "description": "A hangup was requested on the channel.",
540                         "properties": {
541                                 "cause": {
542                                         "type": "int",
543                                         "description": "Integer representation of the cause of the hangup."
544                                 },
545                                 "soft": {
546                                         "type": "boolean",
547                                         "description": "Whether the hangup request was a soft hangup request."
548                                 },
549                                 "channel": {
550                                         "required": true,
551                                         "type": "Channel",
552                                         "description": "The channel on which the hangup was requested."
553                                 }
554                         }
555                 },
556                 "ChannelVarset": {
557                         "id": "ChannelVarset",
558                         "description": "Channel variable changed.",
559                         "properties": {
560                                 "variable": {
561                                         "required": true,
562                                         "type": "string",
563                                         "description": "The variable that changed."
564                                 },
565                                 "value": {
566                                         "required": true,
567                                         "type": "string",
568                                         "description": "The new value of the variable."
569                                 },
570                                 "channel": {
571                                         "required": false,
572                                         "type": "Channel",
573                                         "description": "The channel on which the variable was set.\n\nIf missing, the variable is a global variable."
574                                 }
575                         }
576                 },
577                 "ChannelTalkingStarted": {
578                         "id": "ChannelTalkingStarted",
579                         "description": "Talking was detected on the channel.",
580                         "properties": {
581                                 "channel": {
582                                         "required": true,
583                                         "type": "Channel",
584                                         "description": "The channel on which talking started."
585                                 }
586                         }
587                 },
588                 "ChannelTalkingFinished": {
589                         "id": "ChannelTalkingFinished",
590                         "description": "Talking is no longer detected on the channel.",
591                         "properties": {
592                                 "channel": {
593                                         "required": true,
594                                         "type": "Channel",
595                                         "description": "The channel on which talking completed."
596                                 },
597                                 "duration": {
598                                         "required": true,
599                                         "type": "int",
600                                         "description": "The length of time, in milliseconds, that talking was detected on the channel"
601                                 }
602                         }
603                 },
604                 "EndpointStateChange": {
605                         "id": "EndpointStateChange",
606                         "description": "Endpoint state changed.",
607                         "properties": {
608                                 "endpoint": {
609                                         "required": true,
610                                         "type": "Endpoint"
611                                 }
612                         }
613                 },
614                 "Dial": {
615                         "id": "Dial",
616                         "description": "Dialing state has changed.",
617                         "properties": {
618                                 "caller": {
619                                         "required": false,
620                                         "type": "Channel",
621                                         "description": "The calling channel."
622                                 },
623                                 "peer": {
624                                         "required": true,
625                                         "type": "Channel",
626                                         "description": "The dialed channel."
627                                 },
628                                 "forward": {
629                                         "required": false,
630                                         "type": "string",
631                                         "description": "Forwarding target requested by the original dialed channel."
632                                 },
633                                 "forwarded": {
634                                         "required": false,
635                                         "type": "Channel",
636                                         "description": "Channel that the caller has been forwarded to."
637                                 },
638                                 "dialstring": {
639                                         "required": false,
640                                         "type": "string",
641                                         "description": "The dial string for calling the peer channel."
642                                 },
643                                 "dialstatus": {
644                                         "required": true,
645                                         "type": "string",
646                                         "description": "Current status of the dialing attempt to the peer."
647                                 }
648                         }
649                 },
650                 "StasisEnd": {
651                         "id": "StasisEnd",
652                         "description": "Notification that a channel has left a Stasis application.",
653                         "properties": {
654                                 "channel": {
655                                         "required": true,
656                                         "type": "Channel"
657                                 }
658                         }
659                 },
660                 "StasisStart": {
661                         "id": "StasisStart",
662                         "description": "Notification that a channel has entered a Stasis application.",
663                         "properties": {
664                                 "args": {
665                                         "required": true,
666                                         "type": "List[string]",
667                                         "description": "Arguments to the application"
668                                 },
669                                 "channel": {
670                                         "required": true,
671                                         "type": "Channel"
672                                 }
673                         }
674                 }
675         }
676 }