res_ari_channels: Add ring operation, dtmf operation, hangup reasons, and tweak early...
[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": "getChannels",
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": "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                                                         "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": "answerChannel",
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": "ringChannel",
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": "sendDTMFChannel",
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": "muteChannel",
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                 },
422                 {
423                         "path": "/channels/{channelId}/unmute",
424                         "description": "Unmute a channel",
425                         "operations": [
426                                 {
427                                         "httpMethod": "POST",
428                                         "summary": "Unmute a channel.",
429                                         "nickname": "unmuteChannel",
430                                         "responseClass": "void",
431                                         "parameters": [
432                                                 {
433                                                         "name": "channelId",
434                                                         "description": "Channel's id",
435                                                         "paramType": "path",
436                                                         "required": true,
437                                                         "allowMultiple": false,
438                                                         "dataType": "string"
439                                                 },
440                                                 {
441                                                         "name": "direction",
442                                                         "description": "Direction in which to unmute audio",
443                                                         "paramType": "query",
444                                                         "required": false,
445                                                         "allowMultiple": false,
446                                                         "dataType": "string",
447                                                         "defaultValue": "both",
448                                                         "allowableValues": {
449                                                                 "valueType": "LIST",
450                                                                 "values": [
451                                                                         "both",
452                                                                         "in",
453                                                                         "out"
454                                                                 ]
455                                                         }
456                                                 }
457                                         ],
458                                         "errorResponses": [
459                                                 {
460                                                         "code": 404,
461                                                         "reason": "Channel not found"
462                                                 },
463                                                 {
464                                                         "code": 409,
465                                                         "reason": "Channel not in a Stasis application"
466                                                 }
467                                         ]
468                                 }
469                         ]
470                 },
471                 {
472                         "path": "/channels/{channelId}/hold",
473                         "description": "Put a channel on hold",
474                         "operations": [
475                                 {
476                                         "httpMethod": "POST",
477                                         "summary": "Hold a channel.",
478                                         "nickname": "holdChannel",
479                                         "responseClass": "void",
480                                         "parameters": [
481                                                 {
482                                                         "name": "channelId",
483                                                         "description": "Channel's id",
484                                                         "paramType": "path",
485                                                         "required": true,
486                                                         "allowMultiple": false,
487                                                         "dataType": "string"
488                                                 }
489                                         ],
490                                         "errorResponses": [
491                                                 {
492                                                         "code": 404,
493                                                         "reason": "Channel not found"
494                                                 },
495                                                 {
496                                                         "code": 409,
497                                                         "reason": "Channel not in a Stasis application"
498                                                 }
499                                         ]
500                                 }
501                         ]
502                 },
503                 {
504                         "path": "/channels/{channelId}/hold",
505                         "description": "Remove a channel from hold",
506                         "operations": [
507                                 {
508                                         "httpMethod": "DELETE",
509                                         "summary": "Remove a channel from hold.",
510                                         "nickname": "unholdChannel",
511                                         "responseClass": "void",
512                                         "parameters": [
513                                                 {
514                                                         "name": "channelId",
515                                                         "description": "Channel's id",
516                                                         "paramType": "path",
517                                                         "required": true,
518                                                         "allowMultiple": false,
519                                                         "dataType": "string"
520                                                 }
521                                         ],
522                                         "errorResponses": [
523                                                 {
524                                                         "code": 404,
525                                                         "reason": "Channel not found"
526                                                 },
527                                                 {
528                                                         "code": 409,
529                                                         "reason": "Channel not in a Stasis application"
530                                                 }
531                                         ]
532                                 }
533                         ]
534                 },
535                 {
536                         "path": "/channels/{channelId}/moh",
537                         "description": "Play music on hold to a channel",
538                         "operations": [
539                                 {
540                                         "httpMethod": "POST",
541                                         "summary": "Play music on hold to a channel.",
542                                         "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.",
543                                         "nickname": "mohStartChannel",
544                                         "responseClass": "void",
545                                         "parameters": [
546                                                 {
547                                                         "name": "channelId",
548                                                         "description": "Channel's id",
549                                                         "paramType": "path",
550                                                         "required": true,
551                                                         "allowMultiple": false,
552                                                         "dataType": "string"
553                                                 },
554                                                 {
555                                                         "name": "mohClass",
556                                                         "description": "Music on hold class to use",
557                                                         "paramType": "query",
558                                                         "required": false,
559                                                         "allowMultiple": false,
560                                                         "dataType": "string"
561                                                 }
562                                         ],
563                                         "errorResponses": [
564                                                 {
565                                                         "code": 404,
566                                                         "reason": "Channel not found"
567                                                 },
568                                                 {
569                                                         "code": 409,
570                                                         "reason": "Channel not in a Stasis application"
571                                                 }
572                                         ]
573                                 }
574                         ]
575                 },
576                 {
577                         "path": "/channels/{channelId}/moh",
578                         "description": "Stop playing music on hold to a channel",
579                         "operations": [
580                                 {
581                                         "httpMethod": "DELETE",
582                                         "summary": "Stop playing music on hold to a channel.",
583                                         "nickname": "mohStopChannel",
584                                         "responseClass": "void",
585                                         "parameters": [
586                                                 {
587                                                         "name": "channelId",
588                                                         "description": "Channel's id",
589                                                         "paramType": "path",
590                                                         "required": true,
591                                                         "allowMultiple": false,
592                                                         "dataType": "string"
593                                                 }
594                                         ],
595                                         "errorResponses": [
596                                                 {
597                                                         "code": 404,
598                                                         "reason": "Channel not found"
599                                                 },
600                                                 {
601                                                         "code": 409,
602                                                         "reason": "Channel not in a Stasis application"
603                                                 }
604                                         ]
605                                 }
606                         ]
607                 },
608                 {
609                         "path": "/channels/{channelId}/play",
610                         "description": "Play media to a channel",
611                         "operations": [
612                                 {
613                                         "httpMethod": "POST",
614                                         "summary": "Start playback of media.",
615                                         "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.)",
616                                         "nickname": "playOnChannel",
617                                         "responseClass": "Playback",
618                                         "parameters": [
619                                                 {
620                                                         "name": "channelId",
621                                                         "description": "Channel's id",
622                                                         "paramType": "path",
623                                                         "required": true,
624                                                         "allowMultiple": false,
625                                                         "dataType": "string"
626                                                 },
627                                                 {
628                                                         "name": "media",
629                                                         "description": "Media's URI to play.",
630                                                         "paramType": "query",
631                                                         "required": true,
632                                                         "allowMultiple": false,
633                                                         "dataType": "string"
634                                                 },
635                                                 {
636                                                         "name": "lang",
637                                                         "description": "For sounds, selects language for sound.",
638                                                         "paramType": "query",
639                                                         "required": false,
640                                                         "allowMultiple": false,
641                                                         "dataType": "string"
642                                                 },
643                                                 {
644                                                         "name": "offsetms",
645                                                         "description": "Number of media to skip before playing.",
646                                                         "paramType": "query",
647                                                         "required": false,
648                                                         "allowMultiple": false,
649                                                         "dataType": "int"
650                                                 },
651                                                 {
652                                                         "name": "skipms",
653                                                         "description": "Number of milliseconds to skip for forward/reverse operations.",
654                                                         "paramType": "query",
655                                                         "required": false,
656                                                         "allowMultiple": false,
657                                                         "dataType": "int",
658                                                         "defaultValue": 3000
659                                                 }
660                                         ],
661                                         "errorResponses": [
662                                                 {
663                                                         "code": 404,
664                                                         "reason": "Channel not found"
665                                                 },
666                                                 {
667                                                         "code": 409,
668                                                         "reason": "Channel not in a Stasis application"
669                                                 }
670                                         ]
671                                 }
672                         ]
673                 },
674                 {
675                         "path": "/channels/{channelId}/record",
676                         "description": "Record audio from a channel",
677                         "operations": [
678                                 {
679                                         "httpMethod": "POST",
680                                         "summary": "Start a recording.",
681                                         "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.",
682                                         "nickname": "recordChannel",
683                                         "responseClass": "LiveRecording",
684                                         "parameters": [
685                                                 {
686                                                         "name": "channelId",
687                                                         "description": "Channel's id",
688                                                         "paramType": "path",
689                                                         "required": true,
690                                                         "allowMultiple": false,
691                                                         "dataType": "string"
692                                                 },
693                                                 {
694                                                         "name": "name",
695                                                         "description": "Recording's filename",
696                                                         "paramType": "query",
697                                                         "required": true,
698                                                         "allowMultiple": false,
699                                                         "dataType": "string"
700                                                 },
701                                                 {
702                                                         "name": "format",
703                                                         "description": "Format to encode audio in",
704                                                         "paramType": "query",
705                                                         "required": true,
706                                                         "allowMultiple": false,
707                                                         "dataType": "string"
708                                                 },
709                                                 {
710                                                         "name": "maxDurationSeconds",
711                                                         "description": "Maximum duration of the recording, in seconds. 0 for no limit",
712                                                         "paramType": "query",
713                                                         "required": false,
714                                                         "allowMultiple": false,
715                                                         "dataType": "int",
716                                                         "defaultValue": 0,
717                                                         "allowableValues": {
718                                                                 "valueType": "RANGE",
719                                                                 "min": 0
720                                                         }
721                                                 },
722                                                 {
723                                                         "name": "maxSilenceSeconds",
724                                                         "description": "Maximum duration of silence, in seconds. 0 for no limit",
725                                                         "paramType": "query",
726                                                         "required": false,
727                                                         "allowMultiple": false,
728                                                         "dataType": "int",
729                                                         "defaultValue": 0,
730                                                         "allowableValues": {
731                                                                 "valueType": "RANGE",
732                                                                 "min": 0
733                                                         }
734                                                 },
735                                                 {
736                                                         "name": "ifExists",
737                                                         "description": "Action to take if a recording with the same name already exists.",
738                                                         "paramType": "query",
739                                                         "required": false,
740                                                         "allowMultiple": false,
741                                                         "dataType": "string",
742                                                         "defaultValue": "fail",
743                                                         "allowableValues": {
744                                                                 "valueType": "LIST",
745                                                                 "values": [
746                                                                         "fail",
747                                                                         "overwrite",
748                                                                         "append"
749                                                                 ]
750                                                         }
751                                                 },
752                                                 {
753                                                         "name": "beep",
754                                                         "description": "Play beep when recording begins",
755                                                         "paramType": "query",
756                                                         "required": false,
757                                                         "allowMultiple": false,
758                                                         "dataType": "boolean",
759                                                         "defaultValue": false
760                                                 },
761                                                 {
762                                                         "name": "terminateOn",
763                                                         "description": "DTMF input to terminate recording",
764                                                         "paramType": "query",
765                                                         "required": false,
766                                                         "allowMultiple": false,
767                                                         "dataType": "string",
768                                                         "defaultValue": "none",
769                                                         "allowableValues": {
770                                                                 "valueType": "LIST",
771                                                                 "values": [
772                                                                         "none",
773                                                                         "any",
774                                                                         "*",
775                                                                         "#"
776                                                                 ]
777                                                         }
778                                                 }
779                                         ],
780                                         "errorResponses": [
781                                                 {
782                                                         "code": 400,
783                                                         "reason": "Invalid parameters"
784                                                 },
785                                                 {
786                                                         "code": 404,
787                                                         "reason": "Channel not found"
788                                                 },
789                                                 {
790                                                         "code": 409,
791                                                         "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"
792                                                 },
793                                                 {
794                                                         "code": 422,
795                                                         "reason": "The format specified is unknown on this system"
796                                                 }
797                                         ]
798                                 }
799                         ]
800                 },
801                 {
802                         "path": "/channels/{channelId}/variable",
803                         "description": "Variables on a channel",
804                         "operations": [
805                                 {
806                                         "httpMethod": "GET",
807                                         "summary": "Get the value of a channel variable or function.",
808                                         "nickname": "getChannelVar",
809                                         "responseClass": "Variable",
810                                         "parameters": [
811                                                 {
812                                                         "name": "channelId",
813                                                         "description": "Channel's id",
814                                                         "paramType": "path",
815                                                         "required": true,
816                                                         "allowMultiple": false,
817                                                         "dataType": "string"
818                                                 },
819                                                 {
820                                                         "name": "variable",
821                                                         "description": "The channel variable or function to get",
822                                                         "paramType": "query",
823                                                         "required": true,
824                                                         "allowMultiple": false,
825                                                         "dataType": "string"
826                                                 }
827                                         ],
828                                         "errorResponses": [
829                                                 {
830                                                         "code": 400,
831                                                         "reason": "Missing variable parameter."
832                                                 },
833                                                 {
834                                                         "code": 404,
835                                                         "reason": "Channel not found"
836                                                 },
837                                                 {
838                                                         "code": 409,
839                                                         "reason": "Channel not in a Stasis application"
840                                                 }
841                                         ]
842                                 },
843                                 {
844                                         "httpMethod": "POST",
845                                         "summary": "Set the value of a channel variable or function.",
846                                         "nickname": "setChannelVar",
847                                         "responseClass": "void",
848                                         "parameters": [
849                                                 {
850                                                         "name": "channelId",
851                                                         "description": "Channel's id",
852                                                         "paramType": "path",
853                                                         "required": true,
854                                                         "allowMultiple": false,
855                                                         "dataType": "string"
856                                                 },
857                                                 {
858                                                         "name": "variable",
859                                                         "description": "The channel variable or function to set",
860                                                         "paramType": "query",
861                                                         "required": true,
862                                                         "allowMultiple": false,
863                                                         "dataType": "string"
864                                                 },
865                                                 {
866                                                         "name": "value",
867                                                         "description": "The value to set the variable to",
868                                                         "paramType": "query",
869                                                         "required": false,
870                                                         "allowMultiple": false,
871                                                         "dataType": "string"
872                                                 }
873                                         ],
874                                         "errorResponses": [
875                                                 {
876                                                         "code": 400,
877                                                         "reason": "Missing variable parameter."
878                                                 },
879                                                 {
880                                                         "code": 404,
881                                                         "reason": "Channel not found"
882                                                 },
883                                                 {
884                                                         "code": 409,
885                                                         "reason": "Channel not in a Stasis application"
886                                                 }
887                                         ]
888                                 }
889                         ]
890                 }
891         ],
892         "models": {
893                 "Dialed": {
894                         "id": "Dialed",
895                         "description": "Dialed channel information.",
896                         "properties": {}
897                 },
898                 "DialplanCEP": {
899                         "id": "DialplanCEP",
900                         "description": "Dialplan location (context/extension/priority)",
901                         "properties": {
902                                 "context": {
903                                         "required": true,
904                                         "type": "string",
905                                         "description": "Context in the dialplan"
906                                 },
907                                 "exten": {
908                                         "required": true,
909                                         "type": "string",
910                                         "description": "Extension in the dialplan"
911                                 },
912                                 "priority": {
913                                         "required": true,
914                                         "type": "long",
915                                         "description": "Priority in the dialplan"
916                                 }
917                         }
918                 },
919                 "CallerID": {
920                         "id": "CallerID",
921                         "description": "Caller identification",
922                         "properties": {
923                                 "name": {
924                                         "required": true,
925                                         "type": "string"
926                                 },
927                                 "number": {
928                                         "required": true,
929                                         "type": "string"
930                                 }
931                         }
932                 },
933                 "Channel": {
934                         "id": "Channel",
935                         "description": "A specific communication connection between Asterisk and an Endpoint.",
936                         "properties": {
937                                 "id": {
938                                         "required": true,
939                                         "type": "string",
940                                         "description": "Unique identifier of the channel.\n\nThis is the same as the Uniqueid field in AMI."
941                                 },
942                                 "name": {
943                                         "required": true,
944                                         "type": "string",
945                                         "description": "Name of the channel (i.e. SIP/foo-0000a7e3)"
946                                 },
947                                 "state": {
948                                         "required": true,
949                                         "type": "string",
950                                         "allowableValues": {
951                                                 "valueType": "LIST",
952                                                 "values": [
953                                                         "Down",
954                                                         "Rsrved",
955                                                         "OffHook",
956                                                         "Dialing",
957                                                         "Ring",
958                                                         "Ringing",
959                                                         "Up",
960                                                         "Busy",
961                                                         "Dialing Offhook",
962                                                         "Pre-ring",
963                                                         "Unknown"
964                                                 ]
965                                         }
966                                 },
967                                 "caller": {
968                                         "required": true,
969                                         "type": "CallerID"
970                                 },
971                                 "connected": {
972                                         "required": true,
973                                         "type": "CallerID"
974                                 },
975                                 "accountcode": {
976                                         "required": true,
977                                         "type": "string"
978                                 },
979                                 "dialplan": {
980                                         "required": true,
981                                         "type": "DialplanCEP",
982                                         "description": "Current location in the dialplan"
983                                 },
984                                 "creationtime": {
985                                         "required": true,
986                                         "type": "Date",
987                                         "description": "Timestamp when channel was created"
988                                 }
989                         }
990                 }
991         }
992 }