Multiple revisions 400508,400842-400843,400848
[asterisk/asterisk.git] / rest-api / api-docs / channels.json
1 {
2         "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.",
3         "_author": "David M. Lee, II <dlee@digium.com>",
4         "_svn_revision": "$Revision$",
5         "apiVersion": "0.0.1",
6         "swaggerVersion": "1.1",
7         "basePath": "http://localhost:8088/stasis",
8         "resourcePath": "/api-docs/channels.{format}",
9         "apis": [
10                 {
11                         "path": "/channels",
12                         "description": "Active channels",
13                         "operations": [
14                                 {
15                                         "httpMethod": "GET",
16                                         "summary": "List active channels.",
17                                         "nickname": "getChannels",
18                                         "responseClass": "List[Channel]"
19                                 },
20                                 {
21                                         "httpMethod": "POST",
22                                         "summary": "Create a new channel (originate).",
23                                         "notes": "The new channel is not created until the dialed party picks up. Not wanting to block this request indefinitely, this request returns immediately with a 204 No Content. When the channel is created, a StasisStart event is sent with the provided app and appArgs. In the event of a failure (timeout, busy, etc.), an OriginationFailed event is sent.",
24                                         "nickname": "originate",
25                                         "responseClass": "void",
26                                         "parameters": [
27                                                 {
28                                                         "name": "endpoint",
29                                                         "description": "Endpoint to call.",
30                                                         "paramType": "query",
31                                                         "required": true,
32                                                         "allowMultiple": false,
33                                                         "dataType": "string"
34                                                 },
35                                                 {
36                                                         "name": "extension",
37                                                         "description": "The extension to dial after the endpoint answers",
38                                                         "paramType": "query",
39                                                         "required": false,
40                                                         "allowMultiple": false,
41                                                         "dataType": "string"
42                                                 },
43                                                 {
44                                                         "name": "context",
45                                                         "description": "The context to dial after the endpoint answers. If omitted, uses 'default'",
46                                                         "paramType": "query",
47                                                         "required": false,
48                                                         "allowMultiple": false,
49                                                         "dataType": "string"
50                                                 },
51                                                 {
52                                                         "name": "priority",
53                                                         "description": "The priority to dial after the endpoint answers. If omitted, uses 1",
54                                                         "paramType": "query",
55                                                         "required": false,
56                                                         "allowMultiple": false,
57                                                         "dataType": "long"
58                                                 },
59                                                 {
60                                                         "name": "app",
61                                                         "description": "The application name to pass to the Stasis application.",
62                                                         "paramType": "query",
63                                                         "required": false,
64                                                         "allowMultiple": false,
65                                                         "dataType": "string"
66                                                 },
67                                                 {
68                                                         "name": "appArgs",
69                                                         "description": "The application arguments to pass to the Stasis application.",
70                                                         "paramType": "query",
71                                                         "required": false,
72                                                         "allowMultiple": false,
73                                                         "dataType": "string"
74                                                 },
75                                                 {
76                                                         "name": "callerId",
77                                                         "description": "CallerID to use when dialing the endpoint or extension.",
78                                                         "paramType": "query",
79                                                         "required": false,
80                                                         "allowMultiple": false,
81                                                         "dataType": "string"
82                                                 },
83                                                 {
84                                                         "name": "timeout",
85                                                         "description": "Timeout (in seconds) before giving up dialing, or -1 for no timeout.",
86                                                         "paramType": "query",
87                                                         "required": false,
88                                                         "allowMultiple": false,
89                                                         "dataType": "int",
90                                                         "defaultValue": 30
91                                                 }
92                                         ],
93                                         "errorResponses": [
94                                                 {
95                                                         "code": 400,
96                                                         "reason": "Invalid parameters for originating a channel."
97                                                 }
98                                         ]
99                                 }
100                         ]
101                 },
102                 {
103                         "path": "/channels/{channelId}",
104                         "description": "Active channel",
105                         "operations": [
106                                 {
107                                         "httpMethod": "GET",
108                                         "summary": "Channel details.",
109                                         "nickname": "getChannel",
110                                         "responseClass": "Channel",
111                                         "parameters": [
112                                                 {
113                                                         "name": "channelId",
114                                                         "description": "Channel's id",
115                                                         "paramType": "path",
116                                                         "required": true,
117                                                         "allowMultiple": false,
118                                                         "dataType": "string"
119                                                 }
120                                         ],
121                                         "errorResponses": [
122                                                 {
123                                                         "code": 404,
124                                                         "reason": "Channel not found"
125                                                 }
126                                         ]
127                                 },
128                                 {
129                                         "httpMethod": "DELETE",
130                                         "summary": "Delete (i.e. hangup) a channel.",
131                                         "nickname": "deleteChannel",
132                                         "responseClass": "void",
133                                         "parameters": [
134                                                 {
135                                                         "name": "channelId",
136                                                         "description": "Channel's id",
137                                                         "paramType": "path",
138                                                         "required": true,
139                                                         "allowMultiple": false,
140                                                         "dataType": "string"
141                                                 }
142                                         ],
143                                         "errorResponses": [
144                                                 {
145                                                         "code": 404,
146                                                         "reason": "Channel not found"
147                                                 }
148                                         ]
149                                 }
150                         ]
151                 },
152                 {
153                         "path": "/channels/{channelId}/dial",
154                         "description": "Create a new channel (originate) and bridge to this channel",
155                         "operations": [
156                                 {
157                                         "httpMethod": "POST",
158                                         "summary": "Create a new channel (originate) and bridge to this channel.",
159                                         "nickname": "dial",
160                                         "responseClass": "Dialed",
161                                         "parameters": [
162                                                 {
163                                                         "name": "channelId",
164                                                         "description": "Channel's id",
165                                                         "paramType": "path",
166                                                         "required": true,
167                                                         "allowMultiple": false,
168                                                         "dataType": "string"
169                                                 },
170                                                 {
171                                                         "name": "endpoint",
172                                                         "description": "Endpoint to call. If not specified, dial is routed via dialplan",
173                                                         "paramType": "query",
174                                                         "required": false,
175                                                         "allowMultiple": false,
176                                                         "dataType": "string"
177                                                 },
178                                                 {
179                                                         "name": "extension",
180                                                         "description": "Extension to dial",
181                                                         "paramType": "query",
182                                                         "required": false,
183                                                         "allowMultiple": false,
184                                                         "dataType": "string"
185                                                 },
186                                                 {
187                                                         "name": "context",
188                                                         "description": "When routing via dialplan, the context use. If omitted, uses 'default'",
189                                                         "paramType": "query",
190                                                         "required": false,
191                                                         "allowMultiple": false,
192                                                         "dataType": "string"
193                                                 },
194                                                 {
195                                                         "name": "timeout",
196                                                         "description": "Timeout (in seconds) before giving up dialing, or -1 for no timeout.",
197                                                         "paramType": "query",
198                                                         "required": false,
199                                                         "allowMultiple": false,
200                                                         "dataType": "int",
201                                                         "defaultValue": 30
202                                                 }
203                                         ],
204                                         "errorResponses": [
205                                                 {
206                                                         "code": 404,
207                                                         "reason": "Channel not found"
208                                                 },
209                                                 {
210                                                         "code": 409,
211                                                         "reason": "Channel not in a Stasis application"
212                                                 }
213                                         ]
214                                 }
215                         ]
216                 },
217                 {
218                         "path": "/channels/{channelId}/continue",
219                         "description": "Exit application; continue execution in the dialplan",
220                         "operations": [
221                                 {
222                                         "httpMethod": "POST",
223                                         "summary": "Exit application; continue execution in the dialplan.",
224                                         "nickname": "continueInDialplan",
225                                         "responseClass": "void",
226                                         "parameters": [
227                                                 {
228                                                         "name": "channelId",
229                                                         "description": "Channel's id",
230                                                         "paramType": "path",
231                                                         "required": true,
232                                                         "allowMultiple": false,
233                                                         "dataType": "string"
234                                                 },
235                                                 {
236                                                         "name": "context",
237                                                         "description": "The context to continue to.",
238                                                         "paramType": "query",
239                                                         "required": false,
240                                                         "allowMultiple": false,
241                                                         "dataType": "string"
242                                                 },
243                                                 {
244                                                         "name": "extension",
245                                                         "description": "The extension to continue to.",
246                                                         "paramType": "query",
247                                                         "required": false,
248                                                         "allowMultiple": false,
249                                                         "dataType": "string"
250                                                 },
251                                                 {
252                                                         "name": "priority",
253                                                         "description": "The priority to continue to.",
254                                                         "paramType": "query",
255                                                         "required": false,
256                                                         "allowMultiple": false,
257                                                         "dataType": "int"
258                                                 }
259                                         ],
260                                         "errorResponses": [
261                                                 {
262                                                         "code": 404,
263                                                         "reason": "Channel not found"
264                                                 },
265                                                 {
266                                                         "code": 409,
267                                                         "reason": "Channel not in a Stasis application"
268                                                 }
269                                         ]
270                                 }
271                         ]
272                 },
273                 {
274                         "path": "/channels/{channelId}/answer",
275                         "description": "Answer a channel",
276                         "operations": [
277                                 {
278                                         "httpMethod": "POST",
279                                         "summary": "Answer a channel.",
280                                         "nickname": "answerChannel",
281                                         "responseClass": "void",
282                                         "parameters": [
283                                                 {
284                                                         "name": "channelId",
285                                                         "description": "Channel's id",
286                                                         "paramType": "path",
287                                                         "required": true,
288                                                         "allowMultiple": false,
289                                                         "dataType": "string"
290                                                 }
291                                         ],
292                                         "errorResponses": [
293                                                 {
294                                                         "code": 404,
295                                                         "reason": "Channel not found"
296                                                 },
297                                                 {
298                                                         "code": 409,
299                                                         "reason": "Channel not in a Stasis application"
300                                                 }
301                                         ]
302                                 }
303                         ]
304                 },
305                 {
306                         "path": "/channels/{channelId}/mute",
307                         "description": "Mute a channel",
308                         "operations": [
309                                 {
310                                         "httpMethod": "POST",
311                                         "summary": "Mute a channel.",
312                                         "nickname": "muteChannel",
313                                         "responseClass": "void",
314                                         "parameters": [
315                                                 {
316                                                         "name": "channelId",
317                                                         "description": "Channel's id",
318                                                         "paramType": "path",
319                                                         "required": true,
320                                                         "allowMultiple": false,
321                                                         "dataType": "string"
322                                                 },
323                                                 {
324                                                         "name": "direction",
325                                                         "description": "Direction in which to mute audio",
326                                                         "paramType": "query",
327                                                         "required": false,
328                                                         "allowMultiple": false,
329                                                         "dataType": "string",
330                                                         "defaultValue": "both",
331                                                         "allowableValues": {
332                                                                 "valueType": "LIST",
333                                                                 "values": [
334                                                                         "both",
335                                                                         "in",
336                                                                         "out"
337                                                                 ]
338                                                         }
339                                                 }
340                                         ],
341                                         "errorResponses": [
342                                                 {
343                                                         "code": 404,
344                                                         "reason": "Channel not found"
345                                                 },
346                                                 {
347                                                         "code": 409,
348                                                         "reason": "Channel not in a Stasis application"
349                                                 }
350                                         ]
351                                 }
352                         ]
353                 },
354                 {
355                         "path": "/channels/{channelId}/unmute",
356                         "description": "Unmute a channel",
357                         "operations": [
358                                 {
359                                         "httpMethod": "POST",
360                                         "summary": "Unmute a channel.",
361                                         "nickname": "unmuteChannel",
362                                         "responseClass": "void",
363                                         "parameters": [
364                                                 {
365                                                         "name": "channelId",
366                                                         "description": "Channel's id",
367                                                         "paramType": "path",
368                                                         "required": true,
369                                                         "allowMultiple": false,
370                                                         "dataType": "string"
371                                                 },
372                                                 {
373                                                         "name": "direction",
374                                                         "description": "Direction in which to unmute audio",
375                                                         "paramType": "query",
376                                                         "required": false,
377                                                         "allowMultiple": false,
378                                                         "dataType": "string",
379                                                         "defaultValue": "both",
380                                                         "allowableValues": {
381                                                                 "valueType": "LIST",
382                                                                 "values": [
383                                                                         "both",
384                                                                         "in",
385                                                                         "out"
386                                                                 ]
387                                                         }
388                                                 }
389                                         ],
390                                         "errorResponses": [
391                                                 {
392                                                         "code": 404,
393                                                         "reason": "Channel not found"
394                                                 },
395                                                 {
396                                                         "code": 409,
397                                                         "reason": "Channel not in a Stasis application"
398                                                 }
399                                         ]
400                                 }
401                         ]
402                 },
403                 {
404                         "path": "/channels/{channelId}/hold",
405                         "description": "Put a channel on hold",
406                         "operations": [
407                                 {
408                                         "httpMethod": "POST",
409                                         "summary": "Hold a channel.",
410                                         "nickname": "holdChannel",
411                                         "responseClass": "void",
412                                         "parameters": [
413                                                 {
414                                                         "name": "channelId",
415                                                         "description": "Channel's id",
416                                                         "paramType": "path",
417                                                         "required": true,
418                                                         "allowMultiple": false,
419                                                         "dataType": "string"
420                                                 }
421                                         ],
422                                         "errorResponses": [
423                                                 {
424                                                         "code": 404,
425                                                         "reason": "Channel not found"
426                                                 },
427                                                 {
428                                                         "code": 409,
429                                                         "reason": "Channel not in a Stasis application"
430                                                 }
431                                         ]
432                                 }
433                         ]
434                 },
435                 {
436                         "path": "/channels/{channelId}/unhold",
437                         "description": "Remove a channel from hold",
438                         "operations": [
439                                 {
440                                         "httpMethod": "POST",
441                                         "summary": "Remove a channel from hold.",
442                                         "nickname": "unholdChannel",
443                                         "responseClass": "void",
444                                         "parameters": [
445                                                 {
446                                                         "name": "channelId",
447                                                         "description": "Channel's id",
448                                                         "paramType": "path",
449                                                         "required": true,
450                                                         "allowMultiple": false,
451                                                         "dataType": "string"
452                                                 }
453                                         ],
454                                         "errorResponses": [
455                                                 {
456                                                         "code": 404,
457                                                         "reason": "Channel not found"
458                                                 },
459                                                 {
460                                                         "code": 409,
461                                                         "reason": "Channel not in a Stasis application"
462                                                 }
463                                         ]
464                                 }
465                         ]
466                 },
467                 {
468                         "path": "/channels/{channelId}/mohstart",
469                         "description": "Play music on hold to a channel",
470                         "operations": [
471                                 {
472                                         "httpMethod": "POST",
473                                         "summary": "Play music on hold to a channel.",
474                                         "notes": "Using media operations such as playOnChannel on a channel playing MOH in this manner will suspend MOH without resuming automatically. If continuing music on hold is desired, the stasis application must reinitiate music on hold.",
475                                         "nickname": "mohStartChannel",
476                                         "responseClass": "void",
477                                         "parameters": [
478                                                 {
479                                                         "name": "channelId",
480                                                         "description": "Channel's id",
481                                                         "paramType": "path",
482                                                         "required": true,
483                                                         "allowMultiple": false,
484                                                         "dataType": "string"
485                                                 },
486                                                 {
487                                                         "name": "mohClass",
488                                                         "description": "Music on hold class to use",
489                                                         "paramType": "query",
490                                                         "required": false,
491                                                         "allowMultiple": false,
492                                                         "dataType": "string"
493                                                 }
494                                         ],
495                                         "errorResponses": [
496                                                 {
497                                                         "code": 404,
498                                                         "reason": "Channel not found"
499                                                 },
500                                                 {
501                                                         "code": 409,
502                                                         "reason": "Channel not in a Stasis application"
503                                                 }
504                                         ]
505                                 }
506                         ]
507                 },
508                 {
509                         "path": "/channels/{channelId}/mohstop",
510                         "description": "Stop playing music on hold to a channel",
511                         "operations": [
512                                 {
513                                         "httpMethod": "POST",
514                                         "summary": "Stop playing music on hold to a channel.",
515                                         "nickname": "mohStopChannel",
516                                         "responseClass": "void",
517                                         "parameters": [
518                                                 {
519                                                         "name": "channelId",
520                                                         "description": "Channel's id",
521                                                         "paramType": "path",
522                                                         "required": true,
523                                                         "allowMultiple": false,
524                                                         "dataType": "string"
525                                                 }
526                                         ],
527                                         "errorResponses": [
528                                                 {
529                                                         "code": 404,
530                                                         "reason": "Channel not found"
531                                                 },
532                                                 {
533                                                         "code": 409,
534                                                         "reason": "Channel not in a Stasis application"
535                                                 }
536                                         ]
537                                 }
538                         ]
539                 },
540                 {
541                         "path": "/channels/{channelId}/play",
542                         "description": "Play media to a channel",
543                         "operations": [
544                                 {
545                                         "httpMethod": "POST",
546                                         "summary": "Start playback of media.",
547                                         "notes": "The media URI may be any of a number of URI's. Currently sound: and recording: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)",
548                                         "nickname": "playOnChannel",
549                                         "responseClass": "Playback",
550                                         "parameters": [
551                                                 {
552                                                         "name": "channelId",
553                                                         "description": "Channel's id",
554                                                         "paramType": "path",
555                                                         "required": true,
556                                                         "allowMultiple": false,
557                                                         "dataType": "string"
558                                                 },
559                                                 {
560                                                         "name": "media",
561                                                         "description": "Media's URI to play.",
562                                                         "paramType": "query",
563                                                         "required": true,
564                                                         "allowMultiple": false,
565                                                         "dataType": "string"
566                                                 },
567                                                 {
568                                                         "name": "lang",
569                                                         "description": "For sounds, selects language for sound.",
570                                                         "paramType": "query",
571                                                         "required": false,
572                                                         "allowMultiple": false,
573                                                         "dataType": "string"
574                                                 },
575                                                 {
576                                                         "name": "offsetms",
577                                                         "description": "Number of media to skip before playing.",
578                                                         "paramType": "query",
579                                                         "required": false,
580                                                         "allowMultiple": false,
581                                                         "dataType": "int"
582                                                 },
583                                                 {
584                                                         "name": "skipms",
585                                                         "description": "Number of milliseconds to skip for forward/reverse operations.",
586                                                         "paramType": "query",
587                                                         "required": false,
588                                                         "allowMultiple": false,
589                                                         "dataType": "int",
590                                                         "defaultValue": 3000
591                                                 }
592                                         ],
593                                         "errorResponses": [
594                                                 {
595                                                         "code": 404,
596                                                         "reason": "Channel not found"
597                                                 },
598                                                 {
599                                                         "code": 409,
600                                                         "reason": "Channel not in a Stasis application"
601                                                 }
602                                         ]
603                                 }
604                         ]
605                 },
606                 {
607                         "path": "/channels/{channelId}/record",
608                         "description": "Record audio from a channel",
609                         "operations": [
610                                 {
611                                         "httpMethod": "POST",
612                                         "summary": "Start a recording.",
613                                         "notes": "Record audio from a channel. Note that this will not capture audio sent to the channel. The bridge itself has a record feature if that's what you want.",
614                                         "nickname": "recordChannel",
615                                         "responseClass": "LiveRecording",
616                                         "parameters": [
617                                                 {
618                                                         "name": "channelId",
619                                                         "description": "Channel's id",
620                                                         "paramType": "path",
621                                                         "required": true,
622                                                         "allowMultiple": false,
623                                                         "dataType": "string"
624                                                 },
625                                                 {
626                                                         "name": "name",
627                                                         "description": "Recording's filename",
628                                                         "paramType": "query",
629                                                         "required": true,
630                                                         "allowMultiple": false,
631                                                         "dataType": "string"
632                                                 },
633                                                 {
634                                                         "name": "format",
635                                                         "description": "Format to encode audio in",
636                                                         "paramType": "query",
637                                                         "required": true,
638                                                         "allowMultiple": false,
639                                                         "dataType": "string"
640                                                 },
641                                                 {
642                                                         "name": "maxDurationSeconds",
643                                                         "description": "Maximum duration of the recording, in seconds. 0 for no limit",
644                                                         "paramType": "query",
645                                                         "required": false,
646                                                         "allowMultiple": false,
647                                                         "dataType": "int",
648                                                         "defaultValue": 0,
649                                                         "allowableValues": {
650                                                                 "valueType": "RANGE",
651                                                                 "min": 0
652                                                         }
653                                                 },
654                                                 {
655                                                         "name": "maxSilenceSeconds",
656                                                         "description": "Maximum duration of silence, in seconds. 0 for no limit",
657                                                         "paramType": "query",
658                                                         "required": false,
659                                                         "allowMultiple": false,
660                                                         "dataType": "int",
661                                                         "defaultValue": 0,
662                                                         "allowableValues": {
663                                                                 "valueType": "RANGE",
664                                                                 "min": 0
665                                                         }
666                                                 },
667                                                 {
668                                                         "name": "ifExists",
669                                                         "description": "Action to take if a recording with the same name already exists.",
670                                                         "paramType": "query",
671                                                         "required": false,
672                                                         "allowMultiple": false,
673                                                         "dataType": "string",
674                                                         "defaultValue": "fail",
675                                                         "allowableValues": {
676                                                                 "valueType": "LIST",
677                                                                 "values": [
678                                                                         "fail",
679                                                                         "overwrite",
680                                                                         "append"
681                                                                 ]
682                                                         }
683                                                 },
684                                                 {
685                                                         "name": "beep",
686                                                         "description": "Play beep when recording begins",
687                                                         "paramType": "query",
688                                                         "required": false,
689                                                         "allowMultiple": false,
690                                                         "dataType": "boolean",
691                                                         "defaultValue": false
692                                                 },
693                                                 {
694                                                         "name": "terminateOn",
695                                                         "description": "DTMF input to terminate recording",
696                                                         "paramType": "query",
697                                                         "required": false,
698                                                         "allowMultiple": false,
699                                                         "dataType": "string",
700                                                         "defaultValue": "none",
701                                                         "allowableValues": {
702                                                                 "valueType": "LIST",
703                                                                 "values": [
704                                                                         "none",
705                                                                         "any",
706                                                                         "*",
707                                                                         "#"
708                                                                 ]
709                                                         }
710                                                 }
711                                         ],
712                                         "errorResponses": [
713                                                 {
714                                                         "code": 400,
715                                                         "reason": "Invalid parameters"
716                                                 },
717                                                 {
718                                                         "code": 404,
719                                                         "reason": "Channel not found"
720                                                 },
721                                                 {
722                                                         "code": 409,
723                                                         "reason": "Channel is not in a Stasis application; the channel is currently bridged with other channels; A recording with the same name is currently in progress."
724                                                 }
725                                         ]
726                                 }
727                         ]
728                 },
729                 {
730                         "path": "/channels/{channelId}/variable",
731                         "description": "Variables on a channel",
732                         "operations": [
733                                 {
734                                         "httpMethod": "GET",
735                                         "summary": "Get the value of a channel variable or function.",
736                                         "nickname": "getChannelVar",
737                                         "responseClass": "Variable",
738                                         "parameters": [
739                                                 {
740                                                         "name": "channelId",
741                                                         "description": "Channel's id",
742                                                         "paramType": "path",
743                                                         "required": true,
744                                                         "allowMultiple": false,
745                                                         "dataType": "string"
746                                                 },
747                                                 {
748                                                         "name": "variable",
749                                                         "description": "The channel variable or function to get",
750                                                         "paramType": "query",
751                                                         "required": true,
752                                                         "allowMultiple": false,
753                                                         "dataType": "string"
754                                                 }
755                                         ],
756                                         "errorResponses": [
757                                                 {
758                                                         "code": 400,
759                                                         "reason": "Missing variable parameter."
760                                                 },
761                                                 {
762                                                         "code": 404,
763                                                         "reason": "Channel not found"
764                                                 },
765                                                 {
766                                                         "code": 409,
767                                                         "reason": "Channel not in a Stasis application"
768                                                 }
769                                         ]
770                                 },
771                                 {
772                                         "httpMethod": "POST",
773                                         "summary": "Set the value of a channel variable or function.",
774                                         "nickname": "setChannelVar",
775                                         "responseClass": "void",
776                                         "parameters": [
777                                                 {
778                                                         "name": "channelId",
779                                                         "description": "Channel's id",
780                                                         "paramType": "path",
781                                                         "required": true,
782                                                         "allowMultiple": false,
783                                                         "dataType": "string"
784                                                 },
785                                                 {
786                                                         "name": "variable",
787                                                         "description": "The channel variable or function to set",
788                                                         "paramType": "query",
789                                                         "required": true,
790                                                         "allowMultiple": false,
791                                                         "dataType": "string"
792                                                 },
793                                                 {
794                                                         "name": "value",
795                                                         "description": "The value to set the variable to",
796                                                         "paramType": "query",
797                                                         "required": false,
798                                                         "allowMultiple": false,
799                                                         "dataType": "string"
800                                                 }
801                                         ],
802                                         "errorResponses": [
803                                                 {
804                                                         "code": 400,
805                                                         "reason": "Missing variable parameter."
806                                                 },
807                                                 {
808                                                         "code": 404,
809                                                         "reason": "Channel not found"
810                                                 },
811                                                 {
812                                                         "code": 409,
813                                                         "reason": "Channel not in a Stasis application"
814                                                 }
815                                         ]
816                                 }
817                         ]
818                 }
819         ],
820         "models": {
821                 "Dialed": {
822                         "id": "Dialed",
823                         "description": "Dialed channel information.",
824                         "properties": {}
825                 },
826                 "DialplanCEP": {
827                         "id": "DialplanCEP",
828                         "description": "Dialplan location (context/extension/priority)",
829                         "properties": {
830                                 "context": {
831                                         "required": true,
832                                         "type": "string",
833                                         "description": "Context in the dialplan"
834                                 },
835                                 "exten": {
836                                         "required": true,
837                                         "type": "string",
838                                         "description": "Extension in the dialplan"
839                                 },
840                                 "priority": {
841                                         "required": true,
842                                         "type": "long",
843                                         "description": "Priority in the dialplan"
844                                 }
845                         }
846                 },
847                 "CallerID": {
848                         "id": "CallerID",
849                         "description": "Caller identification",
850                         "properties": {
851                                 "name": {
852                                         "required": true,
853                                         "type": "string"
854                                 },
855                                 "number": {
856                                         "required": true,
857                                         "type": "string"
858                                 }
859                         }
860                 },
861                 "Channel": {
862                         "id": "Channel",
863                         "description": "A specific communication connection between Asterisk and an Endpoint.",
864                         "properties": {
865                                 "id": {
866                                         "required": true,
867                                         "type": "string",
868                                         "description": "Unique identifier of the channel.\n\nThis is the same as the Uniqueid field in AMI."
869                                 },
870                                 "name": {
871                                         "required": true,
872                                         "type": "string",
873                                         "description": "Name of the channel (i.e. SIP/foo-0000a7e3)"
874                                 },
875                                 "state": {
876                                         "required": true,
877                                         "type": "string",
878                                         "allowableValues": {
879                                                 "valueType": "LIST",
880                                                 "values": [
881                                                         "Down",
882                                                         "Rsrved",
883                                                         "OffHook",
884                                                         "Dialing",
885                                                         "Ring",
886                                                         "Ringing",
887                                                         "Up",
888                                                         "Busy",
889                                                         "Dialing Offhook",
890                                                         "Pre-ring",
891                                                         "Unknown"
892                                                 ]
893                                         }
894                                 },
895                                 "caller": {
896                                         "required": true,
897                                         "type": "CallerID"
898                                 },
899                                 "connected": {
900                                         "required": true,
901                                         "type": "CallerID"
902                                 },
903                                 "accountcode": {
904                                         "required": true,
905                                         "type": "string"
906                                 },
907                                 "dialplan": {
908                                         "required": true,
909                                         "type": "DialplanCEP",
910                                         "description": "Current location in the dialplan"
911                                 },
912                                 "creationtime": {
913                                         "required": true,
914                                         "type": "Date",
915                                         "description": "Timestamp when channel was created"
916                                 }
917                         }
918                 }
919         }
920 }