res_ari_channels: Add the ability to stop locally generated ringing on a channel.
[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                                         "httpMethod": "DELETE",
293                                         "summary": "Stop ringing indication on a channel if locally generated.",
294                                         "nickname": "ringStop",
295                                         "responseClass": "void",
296                                         "parameters": [
297                                                 {
298                                                         "name": "channelId",
299                                                         "description": "Channel's id",
300                                                         "paramType": "path",
301                                                         "required": true,
302                                                         "allowMultiple": false,
303                                                         "dataType": "string"
304                                                 }
305                                         ],
306                                         "errorResponses": [
307                                                 {
308                                                         "code": 404,
309                                                         "reason": "Channel not found"
310                                                 },
311                                                 {
312                                                         "code": 409,
313                                                         "reason": "Channel not in a Stasis application"
314                                                 }
315                                         ]
316                                 }
317                         ]
318                 },
319                 {
320                         "path": "/channels/{channelId}/dtmf",
321                         "description": "Send DTMF to a channel",
322                         "operations": [
323                                 {
324                                         "httpMethod": "POST",
325                                         "summary": "Send provided DTMF to a given channel.",
326                                         "nickname": "sendDTMF",
327                                         "responseClass": "void",
328                                         "parameters": [
329                                                 {
330                                                         "name": "channelId",
331                                                         "description": "Channel's id",
332                                                         "paramType": "path",
333                                                         "required": true,
334                                                         "allowMultiple": false,
335                                                         "dataType": "string"
336                                                 },
337                                                 {
338                                                         "name": "dtmf",
339                                                         "description": "DTMF To send.",
340                                                         "paramType": "query",
341                                                         "required": false,
342                                                         "allowMultiple": false,
343                                                         "dataType": "string"
344                                                 },
345                                                 {
346                                                         "name": "before",
347                                                         "description": "Amount of time to wait before DTMF digits (specified in milliseconds) start.",
348                                                         "paramType": "query",
349                                                         "required": false,
350                                                         "allowMultiple": false,
351                                                         "dataType": "int",
352                                                         "defaultValue": 0
353                                                 },
354                                                 {
355                                                         "name": "between",
356                                                         "description": "Amount of time in between DTMF digits (specified in milliseconds).",
357                                                         "paramType": "query",
358                                                         "required": false,
359                                                         "allowMultiple": false,
360                                                         "dataType": "int",
361                                                         "defaultValue": 100
362                                                 },
363                                                 {
364                                                         "name": "duration",
365                                                         "description": "Length of each DTMF digit (specified in milliseconds).",
366                                                         "paramType": "query",
367                                                         "required": false,
368                                                         "allowMultiple": false,
369                                                         "dataType": "int",
370                                                         "defaultValue": 100
371                                                 },
372                                                 {
373                                                         "name": "after",
374                                                         "description": "Amount of time to wait after DTMF digits (specified in milliseconds) end.",
375                                                         "paramType": "query",
376                                                         "required": false,
377                                                         "allowMultiple": false,
378                                                         "dataType": "int",
379                                                         "defaultValue": 0
380                                                 }
381                                         ],
382                                         "errorResponses": [
383                                                 {
384                                                         "code": 400,
385                                                         "reason": "DTMF is required"
386                                                 },
387                                                 {
388                                                         "code": 404,
389                                                         "reason": "Channel not found"
390                                                 },
391                                                 {
392                                                         "code": 409,
393                                                         "reason": "Channel not in a Stasis application"
394                                                 }
395                                         ]
396                                 }
397                         ]
398                 },
399                 {
400                         "path": "/channels/{channelId}/mute",
401                         "description": "Mute a channel",
402                         "operations": [
403                                 {
404                                         "httpMethod": "POST",
405                                         "summary": "Mute a channel.",
406                                         "nickname": "mute",
407                                         "responseClass": "void",
408                                         "parameters": [
409                                                 {
410                                                         "name": "channelId",
411                                                         "description": "Channel's id",
412                                                         "paramType": "path",
413                                                         "required": true,
414                                                         "allowMultiple": false,
415                                                         "dataType": "string"
416                                                 },
417                                                 {
418                                                         "name": "direction",
419                                                         "description": "Direction in which to mute audio",
420                                                         "paramType": "query",
421                                                         "required": false,
422                                                         "allowMultiple": false,
423                                                         "dataType": "string",
424                                                         "defaultValue": "both",
425                                                         "allowableValues": {
426                                                                 "valueType": "LIST",
427                                                                 "values": [
428                                                                         "both",
429                                                                         "in",
430                                                                         "out"
431                                                                 ]
432                                                         }
433                                                 }
434                                         ],
435                                         "errorResponses": [
436                                                 {
437                                                         "code": 404,
438                                                         "reason": "Channel not found"
439                                                 },
440                                                 {
441                                                         "code": 409,
442                                                         "reason": "Channel not in a Stasis application"
443                                                 }
444                                         ]
445                                 },
446                                 {
447                                         "httpMethod": "DELETE",
448                                         "summary": "Unmute a channel.",
449                                         "nickname": "unmute",
450                                         "responseClass": "void",
451                                         "parameters": [
452                                                 {
453                                                         "name": "channelId",
454                                                         "description": "Channel's id",
455                                                         "paramType": "path",
456                                                         "required": true,
457                                                         "allowMultiple": false,
458                                                         "dataType": "string"
459                                                 },
460                                                 {
461                                                         "name": "direction",
462                                                         "description": "Direction in which to unmute audio",
463                                                         "paramType": "query",
464                                                         "required": false,
465                                                         "allowMultiple": false,
466                                                         "dataType": "string",
467                                                         "defaultValue": "both",
468                                                         "allowableValues": {
469                                                                 "valueType": "LIST",
470                                                                 "values": [
471                                                                         "both",
472                                                                         "in",
473                                                                         "out"
474                                                                 ]
475                                                         }
476                                                 }
477                                         ],
478                                         "errorResponses": [
479                                                 {
480                                                         "code": 404,
481                                                         "reason": "Channel not found"
482                                                 },
483                                                 {
484                                                         "code": 409,
485                                                         "reason": "Channel not in a Stasis application"
486                                                 }
487                                         ]
488                                 }
489                         ]
490                 },
491                 {
492                         "path": "/channels/{channelId}/hold",
493                         "description": "Put a channel on hold",
494                         "operations": [
495                                 {
496                                         "httpMethod": "POST",
497                                         "summary": "Hold a channel.",
498                                         "nickname": "hold",
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                                         "httpMethod": "DELETE",
523                                         "summary": "Remove a channel from hold.",
524                                         "nickname": "unhold",
525                                         "responseClass": "void",
526                                         "parameters": [
527                                                 {
528                                                         "name": "channelId",
529                                                         "description": "Channel's id",
530                                                         "paramType": "path",
531                                                         "required": true,
532                                                         "allowMultiple": false,
533                                                         "dataType": "string"
534                                                 }
535                                         ],
536                                         "errorResponses": [
537                                                 {
538                                                         "code": 404,
539                                                         "reason": "Channel not found"
540                                                 },
541                                                 {
542                                                         "code": 409,
543                                                         "reason": "Channel not in a Stasis application"
544                                                 }
545                                         ]
546                                 }
547                         ]
548                 },
549                 {
550                         "path": "/channels/{channelId}/moh",
551                         "description": "Play music on hold to a channel",
552                         "operations": [
553                                 {
554                                         "httpMethod": "POST",
555                                         "summary": "Play music on hold to a channel.",
556                                         "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.",
557                                         "nickname": "startMoh",
558                                         "responseClass": "void",
559                                         "parameters": [
560                                                 {
561                                                         "name": "channelId",
562                                                         "description": "Channel's id",
563                                                         "paramType": "path",
564                                                         "required": true,
565                                                         "allowMultiple": false,
566                                                         "dataType": "string"
567                                                 },
568                                                 {
569                                                         "name": "mohClass",
570                                                         "description": "Music on hold class to use",
571                                                         "paramType": "query",
572                                                         "required": false,
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                                         "httpMethod": "DELETE",
590                                         "summary": "Stop playing music on hold to a channel.",
591                                         "nickname": "stopMoh",
592                                         "responseClass": "void",
593                                         "parameters": [
594                                                 {
595                                                         "name": "channelId",
596                                                         "description": "Channel's id",
597                                                         "paramType": "path",
598                                                         "required": true,
599                                                         "allowMultiple": false,
600                                                         "dataType": "string"
601                                                 }
602                                         ],
603                                         "errorResponses": [
604                                                 {
605                                                         "code": 404,
606                                                         "reason": "Channel not found"
607                                                 },
608                                                 {
609                                                         "code": 409,
610                                                         "reason": "Channel not in a Stasis application"
611                                                 }
612                                         ]
613                                 }
614                         ]
615                 },
616                 {
617                         "path": "/channels/{channelId}/play",
618                         "description": "Play media to a channel",
619                         "operations": [
620                                 {
621                                         "httpMethod": "POST",
622                                         "summary": "Start playback of media.",
623                                         "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.)",
624                                         "nickname": "play",
625                                         "responseClass": "Playback",
626                                         "parameters": [
627                                                 {
628                                                         "name": "channelId",
629                                                         "description": "Channel's id",
630                                                         "paramType": "path",
631                                                         "required": true,
632                                                         "allowMultiple": false,
633                                                         "dataType": "string"
634                                                 },
635                                                 {
636                                                         "name": "media",
637                                                         "description": "Media's URI to play.",
638                                                         "paramType": "query",
639                                                         "required": true,
640                                                         "allowMultiple": false,
641                                                         "dataType": "string"
642                                                 },
643                                                 {
644                                                         "name": "lang",
645                                                         "description": "For sounds, selects language for sound.",
646                                                         "paramType": "query",
647                                                         "required": false,
648                                                         "allowMultiple": false,
649                                                         "dataType": "string"
650                                                 },
651                                                 {
652                                                         "name": "offsetms",
653                                                         "description": "Number of media to skip before playing.",
654                                                         "paramType": "query",
655                                                         "required": false,
656                                                         "allowMultiple": false,
657                                                         "dataType": "int"
658                                                 },
659                                                 {
660                                                         "name": "skipms",
661                                                         "description": "Number of milliseconds to skip for forward/reverse operations.",
662                                                         "paramType": "query",
663                                                         "required": false,
664                                                         "allowMultiple": false,
665                                                         "dataType": "int",
666                                                         "defaultValue": 3000
667                                                 }
668                                         ],
669                                         "errorResponses": [
670                                                 {
671                                                         "code": 404,
672                                                         "reason": "Channel not found"
673                                                 },
674                                                 {
675                                                         "code": 409,
676                                                         "reason": "Channel not in a Stasis application"
677                                                 }
678                                         ]
679                                 }
680                         ]
681                 },
682                 {
683                         "path": "/channels/{channelId}/record",
684                         "description": "Record audio from a channel",
685                         "operations": [
686                                 {
687                                         "httpMethod": "POST",
688                                         "summary": "Start a recording.",
689                                         "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.",
690                                         "nickname": "record",
691                                         "responseClass": "LiveRecording",
692                                         "parameters": [
693                                                 {
694                                                         "name": "channelId",
695                                                         "description": "Channel's id",
696                                                         "paramType": "path",
697                                                         "required": true,
698                                                         "allowMultiple": false,
699                                                         "dataType": "string"
700                                                 },
701                                                 {
702                                                         "name": "name",
703                                                         "description": "Recording's filename",
704                                                         "paramType": "query",
705                                                         "required": true,
706                                                         "allowMultiple": false,
707                                                         "dataType": "string"
708                                                 },
709                                                 {
710                                                         "name": "format",
711                                                         "description": "Format to encode audio in",
712                                                         "paramType": "query",
713                                                         "required": true,
714                                                         "allowMultiple": false,
715                                                         "dataType": "string"
716                                                 },
717                                                 {
718                                                         "name": "maxDurationSeconds",
719                                                         "description": "Maximum duration of the recording, in seconds. 0 for no limit",
720                                                         "paramType": "query",
721                                                         "required": false,
722                                                         "allowMultiple": false,
723                                                         "dataType": "int",
724                                                         "defaultValue": 0,
725                                                         "allowableValues": {
726                                                                 "valueType": "RANGE",
727                                                                 "min": 0
728                                                         }
729                                                 },
730                                                 {
731                                                         "name": "maxSilenceSeconds",
732                                                         "description": "Maximum duration of silence, in seconds. 0 for no limit",
733                                                         "paramType": "query",
734                                                         "required": false,
735                                                         "allowMultiple": false,
736                                                         "dataType": "int",
737                                                         "defaultValue": 0,
738                                                         "allowableValues": {
739                                                                 "valueType": "RANGE",
740                                                                 "min": 0
741                                                         }
742                                                 },
743                                                 {
744                                                         "name": "ifExists",
745                                                         "description": "Action to take if a recording with the same name already exists.",
746                                                         "paramType": "query",
747                                                         "required": false,
748                                                         "allowMultiple": false,
749                                                         "dataType": "string",
750                                                         "defaultValue": "fail",
751                                                         "allowableValues": {
752                                                                 "valueType": "LIST",
753                                                                 "values": [
754                                                                         "fail",
755                                                                         "overwrite",
756                                                                         "append"
757                                                                 ]
758                                                         }
759                                                 },
760                                                 {
761                                                         "name": "beep",
762                                                         "description": "Play beep when recording begins",
763                                                         "paramType": "query",
764                                                         "required": false,
765                                                         "allowMultiple": false,
766                                                         "dataType": "boolean",
767                                                         "defaultValue": false
768                                                 },
769                                                 {
770                                                         "name": "terminateOn",
771                                                         "description": "DTMF input to terminate recording",
772                                                         "paramType": "query",
773                                                         "required": false,
774                                                         "allowMultiple": false,
775                                                         "dataType": "string",
776                                                         "defaultValue": "none",
777                                                         "allowableValues": {
778                                                                 "valueType": "LIST",
779                                                                 "values": [
780                                                                         "none",
781                                                                         "any",
782                                                                         "*",
783                                                                         "#"
784                                                                 ]
785                                                         }
786                                                 }
787                                         ],
788                                         "errorResponses": [
789                                                 {
790                                                         "code": 400,
791                                                         "reason": "Invalid parameters"
792                                                 },
793                                                 {
794                                                         "code": 404,
795                                                         "reason": "Channel not found"
796                                                 },
797                                                 {
798                                                         "code": 409,
799                                                         "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"
800                                                 },
801                                                 {
802                                                         "code": 422,
803                                                         "reason": "The format specified is unknown on this system"
804                                                 }
805                                         ]
806                                 }
807                         ]
808                 },
809                 {
810                         "path": "/channels/{channelId}/variable",
811                         "description": "Variables on a channel",
812                         "operations": [
813                                 {
814                                         "httpMethod": "GET",
815                                         "summary": "Get the value of a channel variable or function.",
816                                         "nickname": "getChannelVar",
817                                         "responseClass": "Variable",
818                                         "parameters": [
819                                                 {
820                                                         "name": "channelId",
821                                                         "description": "Channel's id",
822                                                         "paramType": "path",
823                                                         "required": true,
824                                                         "allowMultiple": false,
825                                                         "dataType": "string"
826                                                 },
827                                                 {
828                                                         "name": "variable",
829                                                         "description": "The channel variable or function to get",
830                                                         "paramType": "query",
831                                                         "required": true,
832                                                         "allowMultiple": false,
833                                                         "dataType": "string"
834                                                 }
835                                         ],
836                                         "errorResponses": [
837                                                 {
838                                                         "code": 400,
839                                                         "reason": "Missing variable parameter."
840                                                 },
841                                                 {
842                                                         "code": 404,
843                                                         "reason": "Channel not found"
844                                                 },
845                                                 {
846                                                         "code": 409,
847                                                         "reason": "Channel not in a Stasis application"
848                                                 }
849                                         ]
850                                 },
851                                 {
852                                         "httpMethod": "POST",
853                                         "summary": "Set the value of a channel variable or function.",
854                                         "nickname": "setChannelVar",
855                                         "responseClass": "void",
856                                         "parameters": [
857                                                 {
858                                                         "name": "channelId",
859                                                         "description": "Channel's id",
860                                                         "paramType": "path",
861                                                         "required": true,
862                                                         "allowMultiple": false,
863                                                         "dataType": "string"
864                                                 },
865                                                 {
866                                                         "name": "variable",
867                                                         "description": "The channel variable or function to set",
868                                                         "paramType": "query",
869                                                         "required": true,
870                                                         "allowMultiple": false,
871                                                         "dataType": "string"
872                                                 },
873                                                 {
874                                                         "name": "value",
875                                                         "description": "The value to set the variable to",
876                                                         "paramType": "query",
877                                                         "required": false,
878                                                         "allowMultiple": false,
879                                                         "dataType": "string"
880                                                 }
881                                         ],
882                                         "errorResponses": [
883                                                 {
884                                                         "code": 400,
885                                                         "reason": "Missing variable parameter."
886                                                 },
887                                                 {
888                                                         "code": 404,
889                                                         "reason": "Channel not found"
890                                                 },
891                                                 {
892                                                         "code": 409,
893                                                         "reason": "Channel not in a Stasis application"
894                                                 }
895                                         ]
896                                 }
897                         ]
898                 }
899         ],
900         "models": {
901                 "Dialed": {
902                         "id": "Dialed",
903                         "description": "Dialed channel information.",
904                         "properties": {}
905                 },
906                 "DialplanCEP": {
907                         "id": "DialplanCEP",
908                         "description": "Dialplan location (context/extension/priority)",
909                         "properties": {
910                                 "context": {
911                                         "required": true,
912                                         "type": "string",
913                                         "description": "Context in the dialplan"
914                                 },
915                                 "exten": {
916                                         "required": true,
917                                         "type": "string",
918                                         "description": "Extension in the dialplan"
919                                 },
920                                 "priority": {
921                                         "required": true,
922                                         "type": "long",
923                                         "description": "Priority in the dialplan"
924                                 }
925                         }
926                 },
927                 "CallerID": {
928                         "id": "CallerID",
929                         "description": "Caller identification",
930                         "properties": {
931                                 "name": {
932                                         "required": true,
933                                         "type": "string"
934                                 },
935                                 "number": {
936                                         "required": true,
937                                         "type": "string"
938                                 }
939                         }
940                 },
941                 "Channel": {
942                         "id": "Channel",
943                         "description": "A specific communication connection between Asterisk and an Endpoint.",
944                         "properties": {
945                                 "id": {
946                                         "required": true,
947                                         "type": "string",
948                                         "description": "Unique identifier of the channel.\n\nThis is the same as the Uniqueid field in AMI."
949                                 },
950                                 "name": {
951                                         "required": true,
952                                         "type": "string",
953                                         "description": "Name of the channel (i.e. SIP/foo-0000a7e3)"
954                                 },
955                                 "state": {
956                                         "required": true,
957                                         "type": "string",
958                                         "allowableValues": {
959                                                 "valueType": "LIST",
960                                                 "values": [
961                                                         "Down",
962                                                         "Rsrved",
963                                                         "OffHook",
964                                                         "Dialing",
965                                                         "Ring",
966                                                         "Ringing",
967                                                         "Up",
968                                                         "Busy",
969                                                         "Dialing Offhook",
970                                                         "Pre-ring",
971                                                         "Unknown"
972                                                 ]
973                                         }
974                                 },
975                                 "caller": {
976                                         "required": true,
977                                         "type": "CallerID"
978                                 },
979                                 "connected": {
980                                         "required": true,
981                                         "type": "CallerID"
982                                 },
983                                 "accountcode": {
984                                         "required": true,
985                                         "type": "string"
986                                 },
987                                 "dialplan": {
988                                         "required": true,
989                                         "type": "DialplanCEP",
990                                         "description": "Current location in the dialplan"
991                                 },
992                                 "creationtime": {
993                                         "required": true,
994                                         "type": "Date",
995                                         "description": "Timestamp when channel was created"
996                                 }
997                         }
998                 }
999         }
1000 }