ari: User better nicknames for ARI operations
[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 all active channels in Asterisk.",
17                                         "nickname": "list",
18                                         "responseClass": "List[Channel]"
19                                 },
20                                 {
21                                         "httpMethod": "POST",
22                                         "summary": "Create a new channel (originate).",
23                                         "notes": "The new channel is created immediately and a snapshot of it returned. If a Stasis application is provided it will be automatically subscribed to the originated channel for further events and updates.",
24                                         "nickname": "originate",
25                                         "responseClass": "Channel",
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 that is subscribed to the originated channel, and passed 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": "get",
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": "hangup",
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                                                         "name": "reason",
144                                                         "description": "Reason for hanging up the channel",
145                                                         "paramType": "query",
146                                                         "required": false,
147                                                         "allowMultiple": false,
148                                                         "dataType": "string",
149                                                         "defalutValue": "normal",
150                                                         "allowableValues": {
151                                                                 "valueType": "LIST",
152                                                                 "values": [
153                                                                         "normal",
154                                                                         "busy",
155                                                                         "congestion"
156                                                                 ]
157                                                         }
158                                                 }
159                                         ],
160                                         "errorResponses": [
161                                                 {
162                                                         "code": 400,
163                                                         "reason": "Invalid reason for hangup provided"
164                                                 },
165                                                 {
166                                                         "code": 404,
167                                                         "reason": "Channel not found"
168                                                 }
169                                         ]
170                                 }
171                         ]
172                 },
173                 {
174                         "path": "/channels/{channelId}/continue",
175                         "description": "Exit application; continue execution in the dialplan",
176                         "operations": [
177                                 {
178                                         "httpMethod": "POST",
179                                         "summary": "Exit application; continue execution in the dialplan.",
180                                         "nickname": "continueInDialplan",
181                                         "responseClass": "void",
182                                         "parameters": [
183                                                 {
184                                                         "name": "channelId",
185                                                         "description": "Channel's id",
186                                                         "paramType": "path",
187                                                         "required": true,
188                                                         "allowMultiple": false,
189                                                         "dataType": "string"
190                                                 },
191                                                 {
192                                                         "name": "context",
193                                                         "description": "The context to continue to.",
194                                                         "paramType": "query",
195                                                         "required": false,
196                                                         "allowMultiple": false,
197                                                         "dataType": "string"
198                                                 },
199                                                 {
200                                                         "name": "extension",
201                                                         "description": "The extension to continue to.",
202                                                         "paramType": "query",
203                                                         "required": false,
204                                                         "allowMultiple": false,
205                                                         "dataType": "string"
206                                                 },
207                                                 {
208                                                         "name": "priority",
209                                                         "description": "The priority to continue to.",
210                                                         "paramType": "query",
211                                                         "required": false,
212                                                         "allowMultiple": false,
213                                                         "dataType": "int"
214                                                 }
215                                         ],
216                                         "errorResponses": [
217                                                 {
218                                                         "code": 404,
219                                                         "reason": "Channel not found"
220                                                 },
221                                                 {
222                                                         "code": 409,
223                                                         "reason": "Channel not in a Stasis application"
224                                                 }
225                                         ]
226                                 }
227                         ]
228                 },
229                 {
230                         "path": "/channels/{channelId}/answer",
231                         "description": "Answer a channel",
232                         "operations": [
233                                 {
234                                         "httpMethod": "POST",
235                                         "summary": "Answer a channel.",
236                                         "nickname": "answer",
237                                         "responseClass": "void",
238                                         "parameters": [
239                                                 {
240                                                         "name": "channelId",
241                                                         "description": "Channel's id",
242                                                         "paramType": "path",
243                                                         "required": true,
244                                                         "allowMultiple": false,
245                                                         "dataType": "string"
246                                                 }
247                                         ],
248                                         "errorResponses": [
249                                                 {
250                                                         "code": 404,
251                                                         "reason": "Channel not found"
252                                                 },
253                                                 {
254                                                         "code": 409,
255                                                         "reason": "Channel not in a Stasis application"
256                                                 }
257                                         ]
258                                 }
259                         ]
260                 },
261                 {
262                         "path": "/channels/{channelId}/ring",
263                         "description": "Send a ringing indication to a channel",
264                         "operations": [
265                                 {
266                                         "httpMethod": "POST",
267                                         "summary": "Indicate ringing to a channel.",
268                                         "nickname": "ring",
269                                         "responseClass": "void",
270                                         "parameters": [
271                                                 {
272                                                         "name": "channelId",
273                                                         "description": "Channel's id",
274                                                         "paramType": "path",
275                                                         "required": true,
276                                                         "allowMultiple": false,
277                                                         "dataType": "string"
278                                                 }
279                                         ],
280                                         "errorResponses": [
281                                                 {
282                                                         "code": 404,
283                                                         "reason": "Channel not found"
284                                                 },
285                                                 {
286                                                         "code": 409,
287                                                         "reason": "Channel not in a Stasis application"
288                                                 }
289                                         ]
290                                 }
291                         ]
292                 },
293                 {
294                         "path": "/channels/{channelId}/dtmf",
295                         "description": "Send DTMF to a channel",
296                         "operations": [
297                                 {
298                                         "httpMethod": "POST",
299                                         "summary": "Send provided DTMF to a given channel.",
300                                         "nickname": "sendDTMF",
301                                         "responseClass": "void",
302                                         "parameters": [
303                                                 {
304                                                         "name": "channelId",
305                                                         "description": "Channel's id",
306                                                         "paramType": "path",
307                                                         "required": true,
308                                                         "allowMultiple": false,
309                                                         "dataType": "string"
310                                                 },
311                                                 {
312                                                         "name": "dtmf",
313                                                         "description": "DTMF To send.",
314                                                         "paramType": "query",
315                                                         "required": false,
316                                                         "allowMultiple": false,
317                                                         "dataType": "string"
318                                                 },
319                                                 {
320                                                         "name": "before",
321                                                         "description": "Amount of time to wait before DTMF digits (specified in milliseconds) start.",
322                                                         "paramType": "query",
323                                                         "required": false,
324                                                         "allowMultiple": false,
325                                                         "dataType": "int",
326                                                         "defaultValue": 0
327                                                 },
328                                                 {
329                                                         "name": "between",
330                                                         "description": "Amount of time in between DTMF digits (specified in milliseconds).",
331                                                         "paramType": "query",
332                                                         "required": false,
333                                                         "allowMultiple": false,
334                                                         "dataType": "int",
335                                                         "defaultValue": 100
336                                                 },
337                                                 {
338                                                         "name": "duration",
339                                                         "description": "Length of each DTMF digit (specified in milliseconds).",
340                                                         "paramType": "query",
341                                                         "required": false,
342                                                         "allowMultiple": false,
343                                                         "dataType": "int",
344                                                         "defaultValue": 100
345                                                 },
346                                                 {
347                                                         "name": "after",
348                                                         "description": "Amount of time to wait after DTMF digits (specified in milliseconds) end.",
349                                                         "paramType": "query",
350                                                         "required": false,
351                                                         "allowMultiple": false,
352                                                         "dataType": "int",
353                                                         "defaultValue": 0
354                                                 }
355                                         ],
356                                         "errorResponses": [
357                                                 {
358                                                         "code": 400,
359                                                         "reason": "DTMF is required"
360                                                 },
361                                                 {
362                                                         "code": 404,
363                                                         "reason": "Channel not found"
364                                                 },
365                                                 {
366                                                         "code": 409,
367                                                         "reason": "Channel not in a Stasis application"
368                                                 }
369                                         ]
370                                 }
371                         ]
372                 },
373                 {
374                         "path": "/channels/{channelId}/mute",
375                         "description": "Mute a channel",
376                         "operations": [
377                                 {
378                                         "httpMethod": "POST",
379                                         "summary": "Mute a channel.",
380                                         "nickname": "mute",
381                                         "responseClass": "void",
382                                         "parameters": [
383                                                 {
384                                                         "name": "channelId",
385                                                         "description": "Channel's id",
386                                                         "paramType": "path",
387                                                         "required": true,
388                                                         "allowMultiple": false,
389                                                         "dataType": "string"
390                                                 },
391                                                 {
392                                                         "name": "direction",
393                                                         "description": "Direction in which to mute audio",
394                                                         "paramType": "query",
395                                                         "required": false,
396                                                         "allowMultiple": false,
397                                                         "dataType": "string",
398                                                         "defaultValue": "both",
399                                                         "allowableValues": {
400                                                                 "valueType": "LIST",
401                                                                 "values": [
402                                                                         "both",
403                                                                         "in",
404                                                                         "out"
405                                                                 ]
406                                                         }
407                                                 }
408                                         ],
409                                         "errorResponses": [
410                                                 {
411                                                         "code": 404,
412                                                         "reason": "Channel not found"
413                                                 },
414                                                 {
415                                                         "code": 409,
416                                                         "reason": "Channel not in a Stasis application"
417                                                 }
418                                         ]
419                                 },
420                                 {
421                                         "httpMethod": "DELETE",
422                                         "summary": "Unmute a channel.",
423                                         "nickname": "unmute",
424                                         "responseClass": "void",
425                                         "parameters": [
426                                                 {
427                                                         "name": "channelId",
428                                                         "description": "Channel's id",
429                                                         "paramType": "path",
430                                                         "required": true,
431                                                         "allowMultiple": false,
432                                                         "dataType": "string"
433                                                 },
434                                                 {
435                                                         "name": "direction",
436                                                         "description": "Direction in which to unmute audio",
437                                                         "paramType": "query",
438                                                         "required": false,
439                                                         "allowMultiple": false,
440                                                         "dataType": "string",
441                                                         "defaultValue": "both",
442                                                         "allowableValues": {
443                                                                 "valueType": "LIST",
444                                                                 "values": [
445                                                                         "both",
446                                                                         "in",
447                                                                         "out"
448                                                                 ]
449                                                         }
450                                                 }
451                                         ],
452                                         "errorResponses": [
453                                                 {
454                                                         "code": 404,
455                                                         "reason": "Channel not found"
456                                                 },
457                                                 {
458                                                         "code": 409,
459                                                         "reason": "Channel not in a Stasis application"
460                                                 }
461                                         ]
462                                 }
463                         ]
464                 },
465                 {
466                         "path": "/channels/{channelId}/hold",
467                         "description": "Put a channel on hold",
468                         "operations": [
469                                 {
470                                         "httpMethod": "POST",
471                                         "summary": "Hold a channel.",
472                                         "nickname": "hold",
473                                         "responseClass": "void",
474                                         "parameters": [
475                                                 {
476                                                         "name": "channelId",
477                                                         "description": "Channel's id",
478                                                         "paramType": "path",
479                                                         "required": true,
480                                                         "allowMultiple": false,
481                                                         "dataType": "string"
482                                                 }
483                                         ],
484                                         "errorResponses": [
485                                                 {
486                                                         "code": 404,
487                                                         "reason": "Channel not found"
488                                                 },
489                                                 {
490                                                         "code": 409,
491                                                         "reason": "Channel not in a Stasis application"
492                                                 }
493                                         ]
494                                 },
495                                 {
496                                         "httpMethod": "DELETE",
497                                         "summary": "Remove a channel from hold.",
498                                         "nickname": "unhold",
499                                         "responseClass": "void",
500                                         "parameters": [
501                                                 {
502                                                         "name": "channelId",
503                                                         "description": "Channel's id",
504                                                         "paramType": "path",
505                                                         "required": true,
506                                                         "allowMultiple": false,
507                                                         "dataType": "string"
508                                                 }
509                                         ],
510                                         "errorResponses": [
511                                                 {
512                                                         "code": 404,
513                                                         "reason": "Channel not found"
514                                                 },
515                                                 {
516                                                         "code": 409,
517                                                         "reason": "Channel not in a Stasis application"
518                                                 }
519                                         ]
520                                 }
521                         ]
522                 },
523                 {
524                         "path": "/channels/{channelId}/moh",
525                         "description": "Play music on hold to a channel",
526                         "operations": [
527                                 {
528                                         "httpMethod": "POST",
529                                         "summary": "Play music on hold to a channel.",
530                                         "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.",
531                                         "nickname": "startMoh",
532                                         "responseClass": "void",
533                                         "parameters": [
534                                                 {
535                                                         "name": "channelId",
536                                                         "description": "Channel's id",
537                                                         "paramType": "path",
538                                                         "required": true,
539                                                         "allowMultiple": false,
540                                                         "dataType": "string"
541                                                 },
542                                                 {
543                                                         "name": "mohClass",
544                                                         "description": "Music on hold class to use",
545                                                         "paramType": "query",
546                                                         "required": false,
547                                                         "allowMultiple": false,
548                                                         "dataType": "string"
549                                                 }
550                                         ],
551                                         "errorResponses": [
552                                                 {
553                                                         "code": 404,
554                                                         "reason": "Channel not found"
555                                                 },
556                                                 {
557                                                         "code": 409,
558                                                         "reason": "Channel not in a Stasis application"
559                                                 }
560                                         ]
561                                 },
562                                 {
563                                         "httpMethod": "DELETE",
564                                         "summary": "Stop playing music on hold to a channel.",
565                                         "nickname": "stopMoh",
566                                         "responseClass": "void",
567                                         "parameters": [
568                                                 {
569                                                         "name": "channelId",
570                                                         "description": "Channel's id",
571                                                         "paramType": "path",
572                                                         "required": true,
573                                                         "allowMultiple": false,
574                                                         "dataType": "string"
575                                                 }
576                                         ],
577                                         "errorResponses": [
578                                                 {
579                                                         "code": 404,
580                                                         "reason": "Channel not found"
581                                                 },
582                                                 {
583                                                         "code": 409,
584                                                         "reason": "Channel not in a Stasis application"
585                                                 }
586                                         ]
587                                 }
588                         ]
589                 },
590                 {
591                         "path": "/channels/{channelId}/play",
592                         "description": "Play media to a channel",
593                         "operations": [
594                                 {
595                                         "httpMethod": "POST",
596                                         "summary": "Start playback of media.",
597                                         "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.)",
598                                         "nickname": "play",
599                                         "responseClass": "Playback",
600                                         "parameters": [
601                                                 {
602                                                         "name": "channelId",
603                                                         "description": "Channel's id",
604                                                         "paramType": "path",
605                                                         "required": true,
606                                                         "allowMultiple": false,
607                                                         "dataType": "string"
608                                                 },
609                                                 {
610                                                         "name": "media",
611                                                         "description": "Media's URI to play.",
612                                                         "paramType": "query",
613                                                         "required": true,
614                                                         "allowMultiple": false,
615                                                         "dataType": "string"
616                                                 },
617                                                 {
618                                                         "name": "lang",
619                                                         "description": "For sounds, selects language for sound.",
620                                                         "paramType": "query",
621                                                         "required": false,
622                                                         "allowMultiple": false,
623                                                         "dataType": "string"
624                                                 },
625                                                 {
626                                                         "name": "offsetms",
627                                                         "description": "Number of media to skip before playing.",
628                                                         "paramType": "query",
629                                                         "required": false,
630                                                         "allowMultiple": false,
631                                                         "dataType": "int"
632                                                 },
633                                                 {
634                                                         "name": "skipms",
635                                                         "description": "Number of milliseconds to skip for forward/reverse operations.",
636                                                         "paramType": "query",
637                                                         "required": false,
638                                                         "allowMultiple": false,
639                                                         "dataType": "int",
640                                                         "defaultValue": 3000
641                                                 }
642                                         ],
643                                         "errorResponses": [
644                                                 {
645                                                         "code": 404,
646                                                         "reason": "Channel not found"
647                                                 },
648                                                 {
649                                                         "code": 409,
650                                                         "reason": "Channel not in a Stasis application"
651                                                 }
652                                         ]
653                                 }
654                         ]
655                 },
656                 {
657                         "path": "/channels/{channelId}/record",
658                         "description": "Record audio from a channel",
659                         "operations": [
660                                 {
661                                         "httpMethod": "POST",
662                                         "summary": "Start a recording.",
663                                         "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.",
664                                         "nickname": "record",
665                                         "responseClass": "LiveRecording",
666                                         "parameters": [
667                                                 {
668                                                         "name": "channelId",
669                                                         "description": "Channel's id",
670                                                         "paramType": "path",
671                                                         "required": true,
672                                                         "allowMultiple": false,
673                                                         "dataType": "string"
674                                                 },
675                                                 {
676                                                         "name": "name",
677                                                         "description": "Recording's filename",
678                                                         "paramType": "query",
679                                                         "required": true,
680                                                         "allowMultiple": false,
681                                                         "dataType": "string"
682                                                 },
683                                                 {
684                                                         "name": "format",
685                                                         "description": "Format to encode audio in",
686                                                         "paramType": "query",
687                                                         "required": true,
688                                                         "allowMultiple": false,
689                                                         "dataType": "string"
690                                                 },
691                                                 {
692                                                         "name": "maxDurationSeconds",
693                                                         "description": "Maximum duration of the recording, in seconds. 0 for no limit",
694                                                         "paramType": "query",
695                                                         "required": false,
696                                                         "allowMultiple": false,
697                                                         "dataType": "int",
698                                                         "defaultValue": 0,
699                                                         "allowableValues": {
700                                                                 "valueType": "RANGE",
701                                                                 "min": 0
702                                                         }
703                                                 },
704                                                 {
705                                                         "name": "maxSilenceSeconds",
706                                                         "description": "Maximum duration of silence, in seconds. 0 for no limit",
707                                                         "paramType": "query",
708                                                         "required": false,
709                                                         "allowMultiple": false,
710                                                         "dataType": "int",
711                                                         "defaultValue": 0,
712                                                         "allowableValues": {
713                                                                 "valueType": "RANGE",
714                                                                 "min": 0
715                                                         }
716                                                 },
717                                                 {
718                                                         "name": "ifExists",
719                                                         "description": "Action to take if a recording with the same name already exists.",
720                                                         "paramType": "query",
721                                                         "required": false,
722                                                         "allowMultiple": false,
723                                                         "dataType": "string",
724                                                         "defaultValue": "fail",
725                                                         "allowableValues": {
726                                                                 "valueType": "LIST",
727                                                                 "values": [
728                                                                         "fail",
729                                                                         "overwrite",
730                                                                         "append"
731                                                                 ]
732                                                         }
733                                                 },
734                                                 {
735                                                         "name": "beep",
736                                                         "description": "Play beep when recording begins",
737                                                         "paramType": "query",
738                                                         "required": false,
739                                                         "allowMultiple": false,
740                                                         "dataType": "boolean",
741                                                         "defaultValue": false
742                                                 },
743                                                 {
744                                                         "name": "terminateOn",
745                                                         "description": "DTMF input to terminate recording",
746                                                         "paramType": "query",
747                                                         "required": false,
748                                                         "allowMultiple": false,
749                                                         "dataType": "string",
750                                                         "defaultValue": "none",
751                                                         "allowableValues": {
752                                                                 "valueType": "LIST",
753                                                                 "values": [
754                                                                         "none",
755                                                                         "any",
756                                                                         "*",
757                                                                         "#"
758                                                                 ]
759                                                         }
760                                                 }
761                                         ],
762                                         "errorResponses": [
763                                                 {
764                                                         "code": 400,
765                                                         "reason": "Invalid parameters"
766                                                 },
767                                                 {
768                                                         "code": 404,
769                                                         "reason": "Channel not found"
770                                                 },
771                                                 {
772                                                         "code": 409,
773                                                         "reason": "Channel is not in a Stasis application; the channel is currently bridged with other hcannels; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail"
774                                                 },
775                                                 {
776                                                         "code": 422,
777                                                         "reason": "The format specified is unknown on this system"
778                                                 }
779                                         ]
780                                 }
781                         ]
782                 },
783                 {
784                         "path": "/channels/{channelId}/variable",
785                         "description": "Variables on a channel",
786                         "operations": [
787                                 {
788                                         "httpMethod": "GET",
789                                         "summary": "Get the value of a channel variable or function.",
790                                         "nickname": "getChannelVar",
791                                         "responseClass": "Variable",
792                                         "parameters": [
793                                                 {
794                                                         "name": "channelId",
795                                                         "description": "Channel's id",
796                                                         "paramType": "path",
797                                                         "required": true,
798                                                         "allowMultiple": false,
799                                                         "dataType": "string"
800                                                 },
801                                                 {
802                                                         "name": "variable",
803                                                         "description": "The channel variable or function to get",
804                                                         "paramType": "query",
805                                                         "required": true,
806                                                         "allowMultiple": false,
807                                                         "dataType": "string"
808                                                 }
809                                         ],
810                                         "errorResponses": [
811                                                 {
812                                                         "code": 400,
813                                                         "reason": "Missing variable parameter."
814                                                 },
815                                                 {
816                                                         "code": 404,
817                                                         "reason": "Channel not found"
818                                                 },
819                                                 {
820                                                         "code": 409,
821                                                         "reason": "Channel not in a Stasis application"
822                                                 }
823                                         ]
824                                 },
825                                 {
826                                         "httpMethod": "POST",
827                                         "summary": "Set the value of a channel variable or function.",
828                                         "nickname": "setChannelVar",
829                                         "responseClass": "void",
830                                         "parameters": [
831                                                 {
832                                                         "name": "channelId",
833                                                         "description": "Channel's id",
834                                                         "paramType": "path",
835                                                         "required": true,
836                                                         "allowMultiple": false,
837                                                         "dataType": "string"
838                                                 },
839                                                 {
840                                                         "name": "variable",
841                                                         "description": "The channel variable or function to set",
842                                                         "paramType": "query",
843                                                         "required": true,
844                                                         "allowMultiple": false,
845                                                         "dataType": "string"
846                                                 },
847                                                 {
848                                                         "name": "value",
849                                                         "description": "The value to set the variable to",
850                                                         "paramType": "query",
851                                                         "required": false,
852                                                         "allowMultiple": false,
853                                                         "dataType": "string"
854                                                 }
855                                         ],
856                                         "errorResponses": [
857                                                 {
858                                                         "code": 400,
859                                                         "reason": "Missing variable parameter."
860                                                 },
861                                                 {
862                                                         "code": 404,
863                                                         "reason": "Channel not found"
864                                                 },
865                                                 {
866                                                         "code": 409,
867                                                         "reason": "Channel not in a Stasis application"
868                                                 }
869                                         ]
870                                 }
871                         ]
872                 }
873         ],
874         "models": {
875                 "Dialed": {
876                         "id": "Dialed",
877                         "description": "Dialed channel information.",
878                         "properties": {}
879                 },
880                 "DialplanCEP": {
881                         "id": "DialplanCEP",
882                         "description": "Dialplan location (context/extension/priority)",
883                         "properties": {
884                                 "context": {
885                                         "required": true,
886                                         "type": "string",
887                                         "description": "Context in the dialplan"
888                                 },
889                                 "exten": {
890                                         "required": true,
891                                         "type": "string",
892                                         "description": "Extension in the dialplan"
893                                 },
894                                 "priority": {
895                                         "required": true,
896                                         "type": "long",
897                                         "description": "Priority in the dialplan"
898                                 }
899                         }
900                 },
901                 "CallerID": {
902                         "id": "CallerID",
903                         "description": "Caller identification",
904                         "properties": {
905                                 "name": {
906                                         "required": true,
907                                         "type": "string"
908                                 },
909                                 "number": {
910                                         "required": true,
911                                         "type": "string"
912                                 }
913                         }
914                 },
915                 "Channel": {
916                         "id": "Channel",
917                         "description": "A specific communication connection between Asterisk and an Endpoint.",
918                         "properties": {
919                                 "id": {
920                                         "required": true,
921                                         "type": "string",
922                                         "description": "Unique identifier of the channel.\n\nThis is the same as the Uniqueid field in AMI."
923                                 },
924                                 "name": {
925                                         "required": true,
926                                         "type": "string",
927                                         "description": "Name of the channel (i.e. SIP/foo-0000a7e3)"
928                                 },
929                                 "state": {
930                                         "required": true,
931                                         "type": "string",
932                                         "allowableValues": {
933                                                 "valueType": "LIST",
934                                                 "values": [
935                                                         "Down",
936                                                         "Rsrved",
937                                                         "OffHook",
938                                                         "Dialing",
939                                                         "Ring",
940                                                         "Ringing",
941                                                         "Up",
942                                                         "Busy",
943                                                         "Dialing Offhook",
944                                                         "Pre-ring",
945                                                         "Unknown"
946                                                 ]
947                                         }
948                                 },
949                                 "caller": {
950                                         "required": true,
951                                         "type": "CallerID"
952                                 },
953                                 "connected": {
954                                         "required": true,
955                                         "type": "CallerID"
956                                 },
957                                 "accountcode": {
958                                         "required": true,
959                                         "type": "string"
960                                 },
961                                 "dialplan": {
962                                         "required": true,
963                                         "type": "DialplanCEP",
964                                         "description": "Current location in the dialplan"
965                                 },
966                                 "creationtime": {
967                                         "required": true,
968                                         "type": "Date",
969                                         "description": "Timestamp when channel was created"
970                                 }
971                         }
972                 }
973         }
974 }