ARI: Support channel variables in originate
[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": "1.0.0",
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                                                         "name": "variables",
94                                                         "description": "The 'variables' key in the body object holds variable key/value pairs to set on the channel on creation. Other keys in the body object are interpreted as query parameters. Ex. { 'endpoint': 'SIP/Alice', 'variables': { 'CALLERID(name)': 'Alice' } }",
95                                                         "paramType": "body",
96                                                         "required": false,
97                                                         "dataType": "containers",
98                                                         "allowMultiple": false
99                                                 }
100                                         ],
101                                         "errorResponses": [
102                                                 {
103                                                         "code": 400,
104                                                         "reason": "Invalid parameters for originating a channel."
105                                                 }
106                                         ]
107                                 }
108                         ]
109                 },
110                 {
111                         "path": "/channels/{channelId}",
112                         "description": "Active channel",
113                         "operations": [
114                                 {
115                                         "httpMethod": "GET",
116                                         "summary": "Channel details.",
117                                         "nickname": "get",
118                                         "responseClass": "Channel",
119                                         "parameters": [
120                                                 {
121                                                         "name": "channelId",
122                                                         "description": "Channel's id",
123                                                         "paramType": "path",
124                                                         "required": true,
125                                                         "allowMultiple": false,
126                                                         "dataType": "string"
127                                                 }
128                                         ],
129                                         "errorResponses": [
130                                                 {
131                                                         "code": 404,
132                                                         "reason": "Channel not found"
133                                                 }
134                                         ]
135                                 },
136                                 {
137                                         "httpMethod": "DELETE",
138                                         "summary": "Delete (i.e. hangup) a channel.",
139                                         "nickname": "hangup",
140                                         "responseClass": "void",
141                                         "parameters": [
142                                                 {
143                                                         "name": "channelId",
144                                                         "description": "Channel's id",
145                                                         "paramType": "path",
146                                                         "required": true,
147                                                         "allowMultiple": false,
148                                                         "dataType": "string"
149                                                 },
150                                                 {
151                                                         "name": "reason",
152                                                         "description": "Reason for hanging up the channel",
153                                                         "paramType": "query",
154                                                         "required": false,
155                                                         "allowMultiple": false,
156                                                         "dataType": "string",
157                                                         "defalutValue": "normal",
158                                                         "allowableValues": {
159                                                                 "valueType": "LIST",
160                                                                 "values": [
161                                                                         "normal",
162                                                                         "busy",
163                                                                         "congestion"
164                                                                 ]
165                                                         }
166                                                 }
167                                         ],
168                                         "errorResponses": [
169                                                 {
170                                                         "code": 400,
171                                                         "reason": "Invalid reason for hangup provided"
172                                                 },
173                                                 {
174                                                         "code": 404,
175                                                         "reason": "Channel not found"
176                                                 }
177                                         ]
178                                 }
179                         ]
180                 },
181                 {
182                         "path": "/channels/{channelId}/continue",
183                         "description": "Exit application; continue execution in the dialplan",
184                         "operations": [
185                                 {
186                                         "httpMethod": "POST",
187                                         "summary": "Exit application; continue execution in the dialplan.",
188                                         "nickname": "continueInDialplan",
189                                         "responseClass": "void",
190                                         "parameters": [
191                                                 {
192                                                         "name": "channelId",
193                                                         "description": "Channel's id",
194                                                         "paramType": "path",
195                                                         "required": true,
196                                                         "allowMultiple": false,
197                                                         "dataType": "string"
198                                                 },
199                                                 {
200                                                         "name": "context",
201                                                         "description": "The context to continue to.",
202                                                         "paramType": "query",
203                                                         "required": false,
204                                                         "allowMultiple": false,
205                                                         "dataType": "string"
206                                                 },
207                                                 {
208                                                         "name": "extension",
209                                                         "description": "The extension to continue to.",
210                                                         "paramType": "query",
211                                                         "required": false,
212                                                         "allowMultiple": false,
213                                                         "dataType": "string"
214                                                 },
215                                                 {
216                                                         "name": "priority",
217                                                         "description": "The priority to continue to.",
218                                                         "paramType": "query",
219                                                         "required": false,
220                                                         "allowMultiple": false,
221                                                         "dataType": "int"
222                                                 }
223                                         ],
224                                         "errorResponses": [
225                                                 {
226                                                         "code": 404,
227                                                         "reason": "Channel not found"
228                                                 },
229                                                 {
230                                                         "code": 409,
231                                                         "reason": "Channel not in a Stasis application"
232                                                 }
233                                         ]
234                                 }
235                         ]
236                 },
237                 {
238                         "path": "/channels/{channelId}/answer",
239                         "description": "Answer a channel",
240                         "operations": [
241                                 {
242                                         "httpMethod": "POST",
243                                         "summary": "Answer a channel.",
244                                         "nickname": "answer",
245                                         "responseClass": "void",
246                                         "parameters": [
247                                                 {
248                                                         "name": "channelId",
249                                                         "description": "Channel's id",
250                                                         "paramType": "path",
251                                                         "required": true,
252                                                         "allowMultiple": false,
253                                                         "dataType": "string"
254                                                 }
255                                         ],
256                                         "errorResponses": [
257                                                 {
258                                                         "code": 404,
259                                                         "reason": "Channel not found"
260                                                 },
261                                                 {
262                                                         "code": 409,
263                                                         "reason": "Channel not in a Stasis application"
264                                                 }
265                                         ]
266                                 }
267                         ]
268                 },
269                 {
270                         "path": "/channels/{channelId}/ring",
271                         "description": "Send a ringing indication to a channel",
272                         "operations": [
273                                 {
274                                         "httpMethod": "POST",
275                                         "summary": "Indicate ringing to a channel.",
276                                         "nickname": "ring",
277                                         "responseClass": "void",
278                                         "parameters": [
279                                                 {
280                                                         "name": "channelId",
281                                                         "description": "Channel's id",
282                                                         "paramType": "path",
283                                                         "required": true,
284                                                         "allowMultiple": false,
285                                                         "dataType": "string"
286                                                 }
287                                         ],
288                                         "errorResponses": [
289                                                 {
290                                                         "code": 404,
291                                                         "reason": "Channel not found"
292                                                 },
293                                                 {
294                                                         "code": 409,
295                                                         "reason": "Channel not in a Stasis application"
296                                                 }
297                                         ]
298                                 },
299                                 {
300                                         "httpMethod": "DELETE",
301                                         "summary": "Stop ringing indication on a channel if locally generated.",
302                                         "nickname": "ringStop",
303                                         "responseClass": "void",
304                                         "parameters": [
305                                                 {
306                                                         "name": "channelId",
307                                                         "description": "Channel's id",
308                                                         "paramType": "path",
309                                                         "required": true,
310                                                         "allowMultiple": false,
311                                                         "dataType": "string"
312                                                 }
313                                         ],
314                                         "errorResponses": [
315                                                 {
316                                                         "code": 404,
317                                                         "reason": "Channel not found"
318                                                 },
319                                                 {
320                                                         "code": 409,
321                                                         "reason": "Channel not in a Stasis application"
322                                                 }
323                                         ]
324                                 }
325                         ]
326                 },
327                 {
328                         "path": "/channels/{channelId}/dtmf",
329                         "description": "Send DTMF to a channel",
330                         "operations": [
331                                 {
332                                         "httpMethod": "POST",
333                                         "summary": "Send provided DTMF to a given channel.",
334                                         "nickname": "sendDTMF",
335                                         "responseClass": "void",
336                                         "parameters": [
337                                                 {
338                                                         "name": "channelId",
339                                                         "description": "Channel's id",
340                                                         "paramType": "path",
341                                                         "required": true,
342                                                         "allowMultiple": false,
343                                                         "dataType": "string"
344                                                 },
345                                                 {
346                                                         "name": "dtmf",
347                                                         "description": "DTMF To send.",
348                                                         "paramType": "query",
349                                                         "required": false,
350                                                         "allowMultiple": false,
351                                                         "dataType": "string"
352                                                 },
353                                                 {
354                                                         "name": "before",
355                                                         "description": "Amount of time to wait before DTMF digits (specified in milliseconds) start.",
356                                                         "paramType": "query",
357                                                         "required": false,
358                                                         "allowMultiple": false,
359                                                         "dataType": "int",
360                                                         "defaultValue": 0
361                                                 },
362                                                 {
363                                                         "name": "between",
364                                                         "description": "Amount of time in between DTMF digits (specified in milliseconds).",
365                                                         "paramType": "query",
366                                                         "required": false,
367                                                         "allowMultiple": false,
368                                                         "dataType": "int",
369                                                         "defaultValue": 100
370                                                 },
371                                                 {
372                                                         "name": "duration",
373                                                         "description": "Length of each DTMF digit (specified in milliseconds).",
374                                                         "paramType": "query",
375                                                         "required": false,
376                                                         "allowMultiple": false,
377                                                         "dataType": "int",
378                                                         "defaultValue": 100
379                                                 },
380                                                 {
381                                                         "name": "after",
382                                                         "description": "Amount of time to wait after DTMF digits (specified in milliseconds) end.",
383                                                         "paramType": "query",
384                                                         "required": false,
385                                                         "allowMultiple": false,
386                                                         "dataType": "int",
387                                                         "defaultValue": 0
388                                                 }
389                                         ],
390                                         "errorResponses": [
391                                                 {
392                                                         "code": 400,
393                                                         "reason": "DTMF is required"
394                                                 },
395                                                 {
396                                                         "code": 404,
397                                                         "reason": "Channel not found"
398                                                 },
399                                                 {
400                                                         "code": 409,
401                                                         "reason": "Channel not in a Stasis application"
402                                                 }
403                                         ]
404                                 }
405                         ]
406                 },
407                 {
408                         "path": "/channels/{channelId}/mute",
409                         "description": "Mute a channel",
410                         "operations": [
411                                 {
412                                         "httpMethod": "POST",
413                                         "summary": "Mute a channel.",
414                                         "nickname": "mute",
415                                         "responseClass": "void",
416                                         "parameters": [
417                                                 {
418                                                         "name": "channelId",
419                                                         "description": "Channel's id",
420                                                         "paramType": "path",
421                                                         "required": true,
422                                                         "allowMultiple": false,
423                                                         "dataType": "string"
424                                                 },
425                                                 {
426                                                         "name": "direction",
427                                                         "description": "Direction in which to mute audio",
428                                                         "paramType": "query",
429                                                         "required": false,
430                                                         "allowMultiple": false,
431                                                         "dataType": "string",
432                                                         "defaultValue": "both",
433                                                         "allowableValues": {
434                                                                 "valueType": "LIST",
435                                                                 "values": [
436                                                                         "both",
437                                                                         "in",
438                                                                         "out"
439                                                                 ]
440                                                         }
441                                                 }
442                                         ],
443                                         "errorResponses": [
444                                                 {
445                                                         "code": 404,
446                                                         "reason": "Channel not found"
447                                                 },
448                                                 {
449                                                         "code": 409,
450                                                         "reason": "Channel not in a Stasis application"
451                                                 }
452                                         ]
453                                 },
454                                 {
455                                         "httpMethod": "DELETE",
456                                         "summary": "Unmute a channel.",
457                                         "nickname": "unmute",
458                                         "responseClass": "void",
459                                         "parameters": [
460                                                 {
461                                                         "name": "channelId",
462                                                         "description": "Channel's id",
463                                                         "paramType": "path",
464                                                         "required": true,
465                                                         "allowMultiple": false,
466                                                         "dataType": "string"
467                                                 },
468                                                 {
469                                                         "name": "direction",
470                                                         "description": "Direction in which to unmute audio",
471                                                         "paramType": "query",
472                                                         "required": false,
473                                                         "allowMultiple": false,
474                                                         "dataType": "string",
475                                                         "defaultValue": "both",
476                                                         "allowableValues": {
477                                                                 "valueType": "LIST",
478                                                                 "values": [
479                                                                         "both",
480                                                                         "in",
481                                                                         "out"
482                                                                 ]
483                                                         }
484                                                 }
485                                         ],
486                                         "errorResponses": [
487                                                 {
488                                                         "code": 404,
489                                                         "reason": "Channel not found"
490                                                 },
491                                                 {
492                                                         "code": 409,
493                                                         "reason": "Channel not in a Stasis application"
494                                                 }
495                                         ]
496                                 }
497                         ]
498                 },
499                 {
500                         "path": "/channels/{channelId}/hold",
501                         "description": "Put a channel on hold",
502                         "operations": [
503                                 {
504                                         "httpMethod": "POST",
505                                         "summary": "Hold a channel.",
506                                         "nickname": "hold",
507                                         "responseClass": "void",
508                                         "parameters": [
509                                                 {
510                                                         "name": "channelId",
511                                                         "description": "Channel's id",
512                                                         "paramType": "path",
513                                                         "required": true,
514                                                         "allowMultiple": false,
515                                                         "dataType": "string"
516                                                 }
517                                         ],
518                                         "errorResponses": [
519                                                 {
520                                                         "code": 404,
521                                                         "reason": "Channel not found"
522                                                 },
523                                                 {
524                                                         "code": 409,
525                                                         "reason": "Channel not in a Stasis application"
526                                                 }
527                                         ]
528                                 },
529                                 {
530                                         "httpMethod": "DELETE",
531                                         "summary": "Remove a channel from hold.",
532                                         "nickname": "unhold",
533                                         "responseClass": "void",
534                                         "parameters": [
535                                                 {
536                                                         "name": "channelId",
537                                                         "description": "Channel's id",
538                                                         "paramType": "path",
539                                                         "required": true,
540                                                         "allowMultiple": false,
541                                                         "dataType": "string"
542                                                 }
543                                         ],
544                                         "errorResponses": [
545                                                 {
546                                                         "code": 404,
547                                                         "reason": "Channel not found"
548                                                 },
549                                                 {
550                                                         "code": 409,
551                                                         "reason": "Channel not in a Stasis application"
552                                                 }
553                                         ]
554                                 }
555                         ]
556                 },
557                 {
558                         "path": "/channels/{channelId}/moh",
559                         "description": "Play music on hold to a channel",
560                         "operations": [
561                                 {
562                                         "httpMethod": "POST",
563                                         "summary": "Play music on hold to a channel.",
564                                         "notes": "Using media operations such as /play 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.",
565                                         "nickname": "startMoh",
566                                         "responseClass": "void",
567                                         "parameters": [
568                                                 {
569                                                         "name": "channelId",
570                                                         "description": "Channel's id",
571                                                         "paramType": "path",
572                                                         "required": true,
573                                                         "allowMultiple": false,
574                                                         "dataType": "string"
575                                                 },
576                                                 {
577                                                         "name": "mohClass",
578                                                         "description": "Music on hold class to use",
579                                                         "paramType": "query",
580                                                         "required": false,
581                                                         "allowMultiple": false,
582                                                         "dataType": "string"
583                                                 }
584                                         ],
585                                         "errorResponses": [
586                                                 {
587                                                         "code": 404,
588                                                         "reason": "Channel not found"
589                                                 },
590                                                 {
591                                                         "code": 409,
592                                                         "reason": "Channel not in a Stasis application"
593                                                 }
594                                         ]
595                                 },
596                                 {
597                                         "httpMethod": "DELETE",
598                                         "summary": "Stop playing music on hold to a channel.",
599                                         "nickname": "stopMoh",
600                                         "responseClass": "void",
601                                         "parameters": [
602                                                 {
603                                                         "name": "channelId",
604                                                         "description": "Channel's id",
605                                                         "paramType": "path",
606                                                         "required": true,
607                                                         "allowMultiple": false,
608                                                         "dataType": "string"
609                                                 }
610                                         ],
611                                         "errorResponses": [
612                                                 {
613                                                         "code": 404,
614                                                         "reason": "Channel not found"
615                                                 },
616                                                 {
617                                                         "code": 409,
618                                                         "reason": "Channel not in a Stasis application"
619                                                 }
620                                         ]
621                                 }
622                         ]
623                 },
624                 {
625                         "path": "/channels/{channelId}/silence",
626                         "description": "Play silence to a channel",
627                         "operations": [
628                                 {
629                                         "httpMethod": "POST",
630                                         "summary": "Play silence to a channel.",
631                                         "notes": "Using media operations such as /play on a channel playing silence in this manner will suspend silence without resuming automatically.",
632                                         "nickname": "startSilence",
633                                         "responseClass": "void",
634                                         "parameters": [
635                                                 {
636                                                         "name": "channelId",
637                                                         "description": "Channel's id",
638                                                         "paramType": "path",
639                                                         "required": true,
640                                                         "allowMultiple": false,
641                                                         "dataType": "string"
642                                                 }
643                                         ],
644                                         "errorResponses": [
645                                                 {
646                                                         "code": 404,
647                                                         "reason": "Channel not found"
648                                                 },
649                                                 {
650                                                         "code": 409,
651                                                         "reason": "Channel not in a Stasis application"
652                                                 }
653                                         ]
654                                 },
655                                 {
656                                         "httpMethod": "DELETE",
657                                         "summary": "Stop playing silence to a channel.",
658                                         "nickname": "stopSilence",
659                                         "responseClass": "void",
660                                         "parameters": [
661                                                 {
662                                                         "name": "channelId",
663                                                         "description": "Channel's id",
664                                                         "paramType": "path",
665                                                         "required": true,
666                                                         "allowMultiple": false,
667                                                         "dataType": "string"
668                                                 }
669                                         ],
670                                         "errorResponses": [
671                                                 {
672                                                         "code": 404,
673                                                         "reason": "Channel not found"
674                                                 },
675                                                 {
676                                                         "code": 409,
677                                                         "reason": "Channel not in a Stasis application"
678                                                 }
679                                         ]
680                                 }
681                         ]
682                 },
683                 {
684                         "path": "/channels/{channelId}/play",
685                         "description": "Play media to a channel",
686                         "operations": [
687                                 {
688                                         "httpMethod": "POST",
689                                         "summary": "Start playback of media.",
690                                         "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.)",
691                                         "nickname": "play",
692                                         "responseClass": "Playback",
693                                         "parameters": [
694                                                 {
695                                                         "name": "channelId",
696                                                         "description": "Channel's id",
697                                                         "paramType": "path",
698                                                         "required": true,
699                                                         "allowMultiple": false,
700                                                         "dataType": "string"
701                                                 },
702                                                 {
703                                                         "name": "media",
704                                                         "description": "Media's URI to play.",
705                                                         "paramType": "query",
706                                                         "required": true,
707                                                         "allowMultiple": false,
708                                                         "dataType": "string"
709                                                 },
710                                                 {
711                                                         "name": "lang",
712                                                         "description": "For sounds, selects language for sound.",
713                                                         "paramType": "query",
714                                                         "required": false,
715                                                         "allowMultiple": false,
716                                                         "dataType": "string"
717                                                 },
718                                                 {
719                                                         "name": "offsetms",
720                                                         "description": "Number of media to skip before playing.",
721                                                         "paramType": "query",
722                                                         "required": false,
723                                                         "allowMultiple": false,
724                                                         "dataType": "int"
725                                                 },
726                                                 {
727                                                         "name": "skipms",
728                                                         "description": "Number of milliseconds to skip for forward/reverse operations.",
729                                                         "paramType": "query",
730                                                         "required": false,
731                                                         "allowMultiple": false,
732                                                         "dataType": "int",
733                                                         "defaultValue": 3000
734                                                 }
735                                         ],
736                                         "errorResponses": [
737                                                 {
738                                                         "code": 404,
739                                                         "reason": "Channel not found"
740                                                 },
741                                                 {
742                                                         "code": 409,
743                                                         "reason": "Channel not in a Stasis application"
744                                                 }
745                                         ]
746                                 }
747                         ]
748                 },
749                 {
750                         "path": "/channels/{channelId}/record",
751                         "description": "Record audio from a channel",
752                         "operations": [
753                                 {
754                                         "httpMethod": "POST",
755                                         "summary": "Start a recording.",
756                                         "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.",
757                                         "nickname": "record",
758                                         "responseClass": "LiveRecording",
759                                         "parameters": [
760                                                 {
761                                                         "name": "channelId",
762                                                         "description": "Channel's id",
763                                                         "paramType": "path",
764                                                         "required": true,
765                                                         "allowMultiple": false,
766                                                         "dataType": "string"
767                                                 },
768                                                 {
769                                                         "name": "name",
770                                                         "description": "Recording's filename",
771                                                         "paramType": "query",
772                                                         "required": true,
773                                                         "allowMultiple": false,
774                                                         "dataType": "string"
775                                                 },
776                                                 {
777                                                         "name": "format",
778                                                         "description": "Format to encode audio in",
779                                                         "paramType": "query",
780                                                         "required": true,
781                                                         "allowMultiple": false,
782                                                         "dataType": "string"
783                                                 },
784                                                 {
785                                                         "name": "maxDurationSeconds",
786                                                         "description": "Maximum duration of the recording, in seconds. 0 for no limit",
787                                                         "paramType": "query",
788                                                         "required": false,
789                                                         "allowMultiple": false,
790                                                         "dataType": "int",
791                                                         "defaultValue": 0,
792                                                         "allowableValues": {
793                                                                 "valueType": "RANGE",
794                                                                 "min": 0
795                                                         }
796                                                 },
797                                                 {
798                                                         "name": "maxSilenceSeconds",
799                                                         "description": "Maximum duration of silence, in seconds. 0 for no limit",
800                                                         "paramType": "query",
801                                                         "required": false,
802                                                         "allowMultiple": false,
803                                                         "dataType": "int",
804                                                         "defaultValue": 0,
805                                                         "allowableValues": {
806                                                                 "valueType": "RANGE",
807                                                                 "min": 0
808                                                         }
809                                                 },
810                                                 {
811                                                         "name": "ifExists",
812                                                         "description": "Action to take if a recording with the same name already exists.",
813                                                         "paramType": "query",
814                                                         "required": false,
815                                                         "allowMultiple": false,
816                                                         "dataType": "string",
817                                                         "defaultValue": "fail",
818                                                         "allowableValues": {
819                                                                 "valueType": "LIST",
820                                                                 "values": [
821                                                                         "fail",
822                                                                         "overwrite",
823                                                                         "append"
824                                                                 ]
825                                                         }
826                                                 },
827                                                 {
828                                                         "name": "beep",
829                                                         "description": "Play beep when recording begins",
830                                                         "paramType": "query",
831                                                         "required": false,
832                                                         "allowMultiple": false,
833                                                         "dataType": "boolean",
834                                                         "defaultValue": false
835                                                 },
836                                                 {
837                                                         "name": "terminateOn",
838                                                         "description": "DTMF input to terminate recording",
839                                                         "paramType": "query",
840                                                         "required": false,
841                                                         "allowMultiple": false,
842                                                         "dataType": "string",
843                                                         "defaultValue": "none",
844                                                         "allowableValues": {
845                                                                 "valueType": "LIST",
846                                                                 "values": [
847                                                                         "none",
848                                                                         "any",
849                                                                         "*",
850                                                                         "#"
851                                                                 ]
852                                                         }
853                                                 }
854                                         ],
855                                         "errorResponses": [
856                                                 {
857                                                         "code": 400,
858                                                         "reason": "Invalid parameters"
859                                                 },
860                                                 {
861                                                         "code": 404,
862                                                         "reason": "Channel not found"
863                                                 },
864                                                 {
865                                                         "code": 409,
866                                                         "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"
867                                                 },
868                                                 {
869                                                         "code": 422,
870                                                         "reason": "The format specified is unknown on this system"
871                                                 }
872                                         ]
873                                 }
874                         ]
875                 },
876                 {
877                         "path": "/channels/{channelId}/variable",
878                         "description": "Variables on a channel",
879                         "operations": [
880                                 {
881                                         "httpMethod": "GET",
882                                         "summary": "Get the value of a channel variable or function.",
883                                         "nickname": "getChannelVar",
884                                         "responseClass": "Variable",
885                                         "parameters": [
886                                                 {
887                                                         "name": "channelId",
888                                                         "description": "Channel's id",
889                                                         "paramType": "path",
890                                                         "required": true,
891                                                         "allowMultiple": false,
892                                                         "dataType": "string"
893                                                 },
894                                                 {
895                                                         "name": "variable",
896                                                         "description": "The channel variable or function to get",
897                                                         "paramType": "query",
898                                                         "required": true,
899                                                         "allowMultiple": false,
900                                                         "dataType": "string"
901                                                 }
902                                         ],
903                                         "errorResponses": [
904                                                 {
905                                                         "code": 400,
906                                                         "reason": "Missing variable parameter."
907                                                 },
908                                                 {
909                                                         "code": 404,
910                                                         "reason": "Channel not found"
911                                                 },
912                                                 {
913                                                         "code": 409,
914                                                         "reason": "Channel not in a Stasis application"
915                                                 }
916                                         ]
917                                 },
918                                 {
919                                         "httpMethod": "POST",
920                                         "summary": "Set the value of a channel variable or function.",
921                                         "nickname": "setChannelVar",
922                                         "responseClass": "void",
923                                         "parameters": [
924                                                 {
925                                                         "name": "channelId",
926                                                         "description": "Channel's id",
927                                                         "paramType": "path",
928                                                         "required": true,
929                                                         "allowMultiple": false,
930                                                         "dataType": "string"
931                                                 },
932                                                 {
933                                                         "name": "variable",
934                                                         "description": "The channel variable or function to set",
935                                                         "paramType": "query",
936                                                         "required": true,
937                                                         "allowMultiple": false,
938                                                         "dataType": "string"
939                                                 },
940                                                 {
941                                                         "name": "value",
942                                                         "description": "The value to set the variable to",
943                                                         "paramType": "query",
944                                                         "required": false,
945                                                         "allowMultiple": false,
946                                                         "dataType": "string"
947                                                 }
948                                         ],
949                                         "errorResponses": [
950                                                 {
951                                                         "code": 400,
952                                                         "reason": "Missing variable parameter."
953                                                 },
954                                                 {
955                                                         "code": 404,
956                                                         "reason": "Channel not found"
957                                                 },
958                                                 {
959                                                         "code": 409,
960                                                         "reason": "Channel not in a Stasis application"
961                                                 }
962                                         ]
963                                 }
964                         ]
965                 },
966                 {
967                         "path": "/channels/{channelId}/snoop",
968                         "description": "Snoop (spy/whisper) on a channel",
969                         "operations": [
970                                 {
971                                         "httpMethod": "POST",
972                                         "summary": "Start snooping.",
973                                         "notes": "Snoop (spy/whisper) on a specific channel.",
974                                         "nickname": "snoopChannel",
975                                         "responseClass": "Channel",
976                                         "parameters": [
977                                                 {
978                                                         "name": "channelId",
979                                                         "description": "Channel's id",
980                                                         "paramType": "path",
981                                                         "required": true,
982                                                         "allowMultiple": false,
983                                                         "dataType": "string"
984                                                 },
985                                                 {
986                                                         "name": "spy",
987                                                         "description": "Direction of audio to spy on",
988                                                         "paramType": "query",
989                                                         "required": false,
990                                                         "allowMultiple": false,
991                                                         "dataType": "string",
992                                                         "defaultValue": "none",
993                                                         "allowableValues": {
994                                                                 "valueType": "LIST",
995                                                                 "values": [
996                                                                         "none",
997                                                                         "both",
998                                                                         "out",
999                                                                         "in"
1000                                                                 ]
1001                                                         }
1002                                                 },
1003                                                 {
1004                                                         "name": "whisper",
1005                                                         "description": "Direction of audio to whisper into",
1006                                                         "paramType": "query",
1007                                                         "required": false,
1008                                                         "allowMultiple": false,
1009                                                         "dataType": "string",
1010                                                         "defaultValue": "none",
1011                                                         "allowableValues": {
1012                                                                 "valueType": "LIST",
1013                                                                 "values": [
1014                                                                         "none",
1015                                                                         "both",
1016                                                                         "out",
1017                                                                         "in"
1018                                                                 ]
1019                                                         }
1020                                                 },
1021                                                 {
1022                                                         "name": "app",
1023                                                         "description": "Application the snooping channel is placed into",
1024                                                         "paramType": "query",
1025                                                         "required": true,
1026                                                         "allowMultiple": false,
1027                                                         "dataType": "string"
1028                                                 },
1029                                                 {
1030                                                         "name": "appArgs",
1031                                                         "description": "The application arguments to pass to the Stasis application",
1032                                                         "paramType": "query",
1033                                                         "required": false,
1034                                                         "allowMultiple": false,
1035                                                         "dataType": "string"
1036                                                 }
1037                                         ],
1038                                         "errorResponses": [
1039                                                 {
1040                                                         "code": 400,
1041                                                         "reason": "Invalid parameters"
1042                                                 },
1043                                                 {
1044                                                         "code": 404,
1045                                                         "reason": "Channel not found"
1046                                                 }
1047                                         ]
1048                                 }
1049                         ]
1050                 }
1051         ],
1052         "models": {
1053                 "Dialed": {
1054                         "id": "Dialed",
1055                         "description": "Dialed channel information.",
1056                         "properties": {}
1057                 },
1058                 "DialplanCEP": {
1059                         "id": "DialplanCEP",
1060                         "description": "Dialplan location (context/extension/priority)",
1061                         "properties": {
1062                                 "context": {
1063                                         "required": true,
1064                                         "type": "string",
1065                                         "description": "Context in the dialplan"
1066                                 },
1067                                 "exten": {
1068                                         "required": true,
1069                                         "type": "string",
1070                                         "description": "Extension in the dialplan"
1071                                 },
1072                                 "priority": {
1073                                         "required": true,
1074                                         "type": "long",
1075                                         "description": "Priority in the dialplan"
1076                                 }
1077                         }
1078                 },
1079                 "CallerID": {
1080                         "id": "CallerID",
1081                         "description": "Caller identification",
1082                         "properties": {
1083                                 "name": {
1084                                         "required": true,
1085                                         "type": "string"
1086                                 },
1087                                 "number": {
1088                                         "required": true,
1089                                         "type": "string"
1090                                 }
1091                         }
1092                 },
1093                 "Channel": {
1094                         "id": "Channel",
1095                         "description": "A specific communication connection between Asterisk and an Endpoint.",
1096                         "properties": {
1097                                 "id": {
1098                                         "required": true,
1099                                         "type": "string",
1100                                         "description": "Unique identifier of the channel.\n\nThis is the same as the Uniqueid field in AMI."
1101                                 },
1102                                 "name": {
1103                                         "required": true,
1104                                         "type": "string",
1105                                         "description": "Name of the channel (i.e. SIP/foo-0000a7e3)"
1106                                 },
1107                                 "state": {
1108                                         "required": true,
1109                                         "type": "string",
1110                                         "allowableValues": {
1111                                                 "valueType": "LIST",
1112                                                 "values": [
1113                                                         "Down",
1114                                                         "Rsrved",
1115                                                         "OffHook",
1116                                                         "Dialing",
1117                                                         "Ring",
1118                                                         "Ringing",
1119                                                         "Up",
1120                                                         "Busy",
1121                                                         "Dialing Offhook",
1122                                                         "Pre-ring",
1123                                                         "Unknown"
1124                                                 ]
1125                                         }
1126                                 },
1127                                 "caller": {
1128                                         "required": true,
1129                                         "type": "CallerID"
1130                                 },
1131                                 "connected": {
1132                                         "required": true,
1133                                         "type": "CallerID"
1134                                 },
1135                                 "accountcode": {
1136                                         "required": true,
1137                                         "type": "string"
1138                                 },
1139                                 "dialplan": {
1140                                         "required": true,
1141                                         "type": "DialplanCEP",
1142                                         "description": "Current location in the dialplan"
1143                                 },
1144                                 "creationtime": {
1145                                         "required": true,
1146                                         "type": "Date",
1147                                         "description": "Timestamp when channel was created"
1148                                 }
1149                         }
1150                 }
1151         }
1152 }