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