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