res/ari/resource_channels: Add missing 'no_answer' reason to DELETE /channels
[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.6.0",
6         "swaggerVersion": "1.1",
7         "basePath": "http://localhost:8088/ari",
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. Mutually exclusive with 'app'.",
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'. Mutually exclusive with 'app'.",
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. Mutually exclusive with 'app'.",
54                                                         "paramType": "query",
55                                                         "required": false,
56                                                         "allowMultiple": false,
57                                                         "dataType": "long"
58                                                 },
59                                                 {
60                                                         "name": "label",
61                                                         "description": "The label to dial after the endpoint answers. Will supersede 'priority' if provided. Mutually exclusive with 'app'.",
62                                                         "paramType": "query",
63                                                         "required": false,
64                                                         "allowMultiple": false,
65                                                         "dataType": "string"
66                                                 },
67                                                 {
68                                                         "name": "app",
69                                                         "description": "The application that is subscribed to the originated channel. When the channel is answered, it will be passed to this Stasis application. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.",
70                                                         "paramType": "query",
71                                                         "required": false,
72                                                         "allowMultiple": false,
73                                                         "dataType": "string"
74                                                 },
75                                                 {
76                                                         "name": "appArgs",
77                                                         "description": "The application arguments to pass to the Stasis application provided by 'app'. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.",
78                                                         "paramType": "query",
79                                                         "required": false,
80                                                         "allowMultiple": false,
81                                                         "dataType": "string"
82                                                 },
83                                                 {
84                                                         "name": "callerId",
85                                                         "description": "CallerID to use when dialing the endpoint or extension.",
86                                                         "paramType": "query",
87                                                         "required": false,
88                                                         "allowMultiple": false,
89                                                         "dataType": "string"
90                                                 },
91                                                 {
92                                                         "name": "timeout",
93                                                         "description": "Timeout (in seconds) before giving up dialing, or -1 for no timeout.",
94                                                         "paramType": "query",
95                                                         "required": false,
96                                                         "allowMultiple": false,
97                                                         "dataType": "int",
98                                                         "defaultValue": 30
99                                                 },
100                                                 {
101                                                         "name": "variables",
102                                                         "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\" } }",
103                                                         "paramType": "body",
104                                                         "required": false,
105                                                         "dataType": "containers",
106                                                         "allowMultiple": false
107                                                 },
108                                                 {
109                                                         "name": "channelId",
110                                                         "description": "The unique id to assign the channel on creation.",
111                                                         "paramType": "query",
112                                                         "required": false,
113                                                         "allowMultiple": false,
114                                                         "dataType": "string"
115                                                 },
116                                                 {
117                                                         "name": "otherChannelId",
118                                                         "description": "The unique id to assign the second channel when using local channels.",
119                                                         "paramType": "query",
120                                                         "required": false,
121                                                         "allowMultiple": false,
122                                                         "dataType": "string"
123                                                 },
124                                                 {
125                                                         "name": "originator",
126                                                         "description": "The unique id of the channel which is originating this one.",
127                                                         "paramType": "query",
128                                                         "required": false,
129                                                         "allowMultiple": false,
130                                                         "dataType": "string"
131                                                 }
132                                         ],
133                                         "errorResponses": [
134                                                 {
135                                                         "code": 400,
136                                                         "reason": "Invalid parameters for originating a channel."
137                                                 }
138                                         ]
139                                 }
140                         ]
141                 },
142                 {
143                         "path": "/channels/{channelId}",
144                         "description": "Active channel",
145                         "operations": [
146                                 {
147                                         "httpMethod": "GET",
148                                         "summary": "Channel details.",
149                                         "nickname": "get",
150                                         "responseClass": "Channel",
151                                         "parameters": [
152                                                 {
153                                                         "name": "channelId",
154                                                         "description": "Channel's id",
155                                                         "paramType": "path",
156                                                         "required": true,
157                                                         "allowMultiple": false,
158                                                         "dataType": "string"
159                                                 }
160                                         ],
161                                         "errorResponses": [
162                                                 {
163                                                         "code": 404,
164                                                         "reason": "Channel not found"
165                                                 }
166                                         ]
167                                 },
168                                 {
169                                         "httpMethod": "POST",
170                                         "summary": "Create a new channel (originate with id).",
171                                         "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.",
172                                         "nickname": "originateWithId",
173                                         "responseClass": "Channel",
174                                         "parameters": [
175                                                 {
176                                                         "name": "channelId",
177                                                         "description": "The unique id to assign the channel on creation.",
178                                                         "paramType": "path",
179                                                         "required": true,
180                                                         "allowMultiple": false,
181                                                         "dataType": "string"
182                                                 },
183                                                 {
184                                                         "name": "endpoint",
185                                                         "description": "Endpoint to call.",
186                                                         "paramType": "query",
187                                                         "required": true,
188                                                         "allowMultiple": false,
189                                                         "dataType": "string"
190                                                 },
191                                                 {
192                                                         "name": "extension",
193                                                         "description": "The extension to dial after the endpoint answers. Mutually exclusive with 'app'.",
194                                                         "paramType": "query",
195                                                         "required": false,
196                                                         "allowMultiple": false,
197                                                         "dataType": "string"
198                                                 },
199                                                 {
200                                                         "name": "context",
201                                                         "description": "The context to dial after the endpoint answers. If omitted, uses 'default'. Mutually exclusive with 'app'.",
202                                                         "paramType": "query",
203                                                         "required": false,
204                                                         "allowMultiple": false,
205                                                         "dataType": "string"
206                                                 },
207                                                 {
208                                                         "name": "priority",
209                                                         "description": "The priority to dial after the endpoint answers. If omitted, uses 1. Mutually exclusive with 'app'.",
210                                                         "paramType": "query",
211                                                         "required": false,
212                                                         "allowMultiple": false,
213                                                         "dataType": "long"
214                                                 },
215                                                 {
216                                                         "name": "label",
217                                                         "description": "The label to dial after the endpoint answers. Will supersede 'priority' if provided. Mutually exclusive with 'app'.",
218                                                         "paramType": "query",
219                                                         "required": false,
220                                                         "allowMultiple": false,
221                                                         "dataType": "string"
222                                                 },
223                                                 {
224                                                         "name": "app",
225                                                         "description": "The application that is subscribed to the originated channel. When the channel is answered, it will be passed to this Stasis application. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.",
226                                                         "paramType": "query",
227                                                         "required": false,
228                                                         "allowMultiple": false,
229                                                         "dataType": "string"
230                                                 },
231                                                 {
232                                                         "name": "appArgs",
233                                                         "description": "The application arguments to pass to the Stasis application provided by 'app'. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.",
234                                                         "paramType": "query",
235                                                         "required": false,
236                                                         "allowMultiple": false,
237                                                         "dataType": "string"
238                                                 },
239                                                 {
240                                                         "name": "callerId",
241                                                         "description": "CallerID to use when dialing the endpoint or extension.",
242                                                         "paramType": "query",
243                                                         "required": false,
244                                                         "allowMultiple": false,
245                                                         "dataType": "string"
246                                                 },
247                                                 {
248                                                         "name": "timeout",
249                                                         "description": "Timeout (in seconds) before giving up dialing, or -1 for no timeout.",
250                                                         "paramType": "query",
251                                                         "required": false,
252                                                         "allowMultiple": false,
253                                                         "dataType": "int",
254                                                         "defaultValue": 30
255                                                 },
256                                                 {
257                                                         "name": "variables",
258                                                         "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\" } }",
259                                                         "paramType": "body",
260                                                         "required": false,
261                                                         "dataType": "containers",
262                                                         "allowMultiple": false
263                                                 },
264                                                 {
265                                                         "name": "otherChannelId",
266                                                         "description": "The unique id to assign the second channel when using local channels.",
267                                                         "paramType": "query",
268                                                         "required": false,
269                                                         "allowMultiple": false,
270                                                         "dataType": "string"
271                                                 },
272                                                 {
273                                                         "name": "originator",
274                                                         "description": "The unique id of the channel which is originating this one.",
275                                                         "paramType": "query",
276                                                         "required": false,
277                                                         "allowMultiple": false,
278                                                         "dataType": "string"
279                                                 }
280                                         ],
281                                         "errorResponses": [
282                                                 {
283                                                         "code": 400,
284                                                         "reason": "Invalid parameters for originating a channel."
285                                                 }
286                                         ]
287
288                                 },
289                                 {
290                                         "httpMethod": "DELETE",
291                                         "summary": "Delete (i.e. hangup) a channel.",
292                                         "nickname": "hangup",
293                                         "responseClass": "void",
294                                         "parameters": [
295                                                 {
296                                                         "name": "channelId",
297                                                         "description": "Channel's id",
298                                                         "paramType": "path",
299                                                         "required": true,
300                                                         "allowMultiple": false,
301                                                         "dataType": "string"
302                                                 },
303                                                 {
304                                                         "name": "reason",
305                                                         "description": "Reason for hanging up the channel",
306                                                         "paramType": "query",
307                                                         "required": false,
308                                                         "allowMultiple": false,
309                                                         "dataType": "string",
310                                                         "defalutValue": "normal",
311                                                         "allowableValues": {
312                                                                 "valueType": "LIST",
313                                                                 "values": [
314                                                                         "normal",
315                                                                         "busy",
316                                                                         "congestion",
317                                                                         "no_answer"
318                                                                 ]
319                                                         }
320                                                 }
321                                         ],
322                                         "errorResponses": [
323                                                 {
324                                                         "code": 400,
325                                                         "reason": "Invalid reason for hangup provided"
326                                                 },
327                                                 {
328                                                         "code": 404,
329                                                         "reason": "Channel not found"
330                                                 }
331                                         ]
332                                 }
333                         ]
334                 },
335                 {
336                         "path": "/channels/{channelId}/continue",
337                         "description": "Exit application; continue execution in the dialplan",
338                         "operations": [
339                                 {
340                                         "httpMethod": "POST",
341                                         "summary": "Exit application; continue execution in the dialplan.",
342                                         "nickname": "continueInDialplan",
343                                         "responseClass": "void",
344                                         "parameters": [
345                                                 {
346                                                         "name": "channelId",
347                                                         "description": "Channel's id",
348                                                         "paramType": "path",
349                                                         "required": true,
350                                                         "allowMultiple": false,
351                                                         "dataType": "string"
352                                                 },
353                                                 {
354                                                         "name": "context",
355                                                         "description": "The context to continue to.",
356                                                         "paramType": "query",
357                                                         "required": false,
358                                                         "allowMultiple": false,
359                                                         "dataType": "string"
360                                                 },
361                                                 {
362                                                         "name": "extension",
363                                                         "description": "The extension to continue to.",
364                                                         "paramType": "query",
365                                                         "required": false,
366                                                         "allowMultiple": false,
367                                                         "dataType": "string"
368                                                 },
369                                                 {
370                                                         "name": "priority",
371                                                         "description": "The priority to continue to.",
372                                                         "paramType": "query",
373                                                         "required": false,
374                                                         "allowMultiple": false,
375                                                         "dataType": "int"
376                                                 },
377                                                 {
378                                                         "name": "label",
379                                                         "description": "The label to continue to - will supersede 'priority' if both are provided.",
380                                                         "paramType": "query",
381                                                         "required": false,
382                                                         "allowMultiple": false,
383                                                         "dataType": "string"
384                                                 }
385                                         ],
386                                         "errorResponses": [
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}/answer",
401                         "description": "Answer a channel",
402                         "operations": [
403                                 {
404                                         "httpMethod": "POST",
405                                         "summary": "Answer a channel.",
406                                         "nickname": "answer",
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                                         "errorResponses": [
419                                                 {
420                                                         "code": 404,
421                                                         "reason": "Channel not found"
422                                                 },
423                                                 {
424                                                         "code": 409,
425                                                         "reason": "Channel not in a Stasis application"
426                                                 }
427                                         ]
428                                 }
429                         ]
430                 },
431                 {
432                         "path": "/channels/{channelId}/ring",
433                         "description": "Send a ringing indication to a channel",
434                         "operations": [
435                                 {
436                                         "httpMethod": "POST",
437                                         "summary": "Indicate ringing to a channel.",
438                                         "nickname": "ring",
439                                         "responseClass": "void",
440                                         "parameters": [
441                                                 {
442                                                         "name": "channelId",
443                                                         "description": "Channel's id",
444                                                         "paramType": "path",
445                                                         "required": true,
446                                                         "allowMultiple": false,
447                                                         "dataType": "string"
448                                                 }
449                                         ],
450                                         "errorResponses": [
451                                                 {
452                                                         "code": 404,
453                                                         "reason": "Channel not found"
454                                                 },
455                                                 {
456                                                         "code": 409,
457                                                         "reason": "Channel not in a Stasis application"
458                                                 }
459                                         ]
460                                 },
461                                 {
462                                         "httpMethod": "DELETE",
463                                         "summary": "Stop ringing indication on a channel if locally generated.",
464                                         "nickname": "ringStop",
465                                         "responseClass": "void",
466                                         "parameters": [
467                                                 {
468                                                         "name": "channelId",
469                                                         "description": "Channel's id",
470                                                         "paramType": "path",
471                                                         "required": true,
472                                                         "allowMultiple": false,
473                                                         "dataType": "string"
474                                                 }
475                                         ],
476                                         "errorResponses": [
477                                                 {
478                                                         "code": 404,
479                                                         "reason": "Channel not found"
480                                                 },
481                                                 {
482                                                         "code": 409,
483                                                         "reason": "Channel not in a Stasis application"
484                                                 }
485                                         ]
486                                 }
487                         ]
488                 },
489                 {
490                         "path": "/channels/{channelId}/dtmf",
491                         "description": "Send DTMF to a channel",
492                         "operations": [
493                                 {
494                                         "httpMethod": "POST",
495                                         "summary": "Send provided DTMF to a given channel.",
496                                         "nickname": "sendDTMF",
497                                         "responseClass": "void",
498                                         "parameters": [
499                                                 {
500                                                         "name": "channelId",
501                                                         "description": "Channel's id",
502                                                         "paramType": "path",
503                                                         "required": true,
504                                                         "allowMultiple": false,
505                                                         "dataType": "string"
506                                                 },
507                                                 {
508                                                         "name": "dtmf",
509                                                         "description": "DTMF To send.",
510                                                         "paramType": "query",
511                                                         "required": false,
512                                                         "allowMultiple": false,
513                                                         "dataType": "string"
514                                                 },
515                                                 {
516                                                         "name": "before",
517                                                         "description": "Amount of time to wait before DTMF digits (specified in milliseconds) start.",
518                                                         "paramType": "query",
519                                                         "required": false,
520                                                         "allowMultiple": false,
521                                                         "dataType": "int",
522                                                         "defaultValue": 0
523                                                 },
524                                                 {
525                                                         "name": "between",
526                                                         "description": "Amount of time in between DTMF digits (specified in milliseconds).",
527                                                         "paramType": "query",
528                                                         "required": false,
529                                                         "allowMultiple": false,
530                                                         "dataType": "int",
531                                                         "defaultValue": 100
532                                                 },
533                                                 {
534                                                         "name": "duration",
535                                                         "description": "Length of each DTMF digit (specified in milliseconds).",
536                                                         "paramType": "query",
537                                                         "required": false,
538                                                         "allowMultiple": false,
539                                                         "dataType": "int",
540                                                         "defaultValue": 100
541                                                 },
542                                                 {
543                                                         "name": "after",
544                                                         "description": "Amount of time to wait after DTMF digits (specified in milliseconds) end.",
545                                                         "paramType": "query",
546                                                         "required": false,
547                                                         "allowMultiple": false,
548                                                         "dataType": "int",
549                                                         "defaultValue": 0
550                                                 }
551                                         ],
552                                         "errorResponses": [
553                                                 {
554                                                         "code": 400,
555                                                         "reason": "DTMF is required"
556                                                 },
557                                                 {
558                                                         "code": 404,
559                                                         "reason": "Channel not found"
560                                                 },
561                                                 {
562                                                         "code": 409,
563                                                         "reason": "Channel not in a Stasis application"
564                                                 }
565                                         ]
566                                 }
567                         ]
568                 },
569                 {
570                         "path": "/channels/{channelId}/mute",
571                         "description": "Mute a channel",
572                         "operations": [
573                                 {
574                                         "httpMethod": "POST",
575                                         "summary": "Mute a channel.",
576                                         "nickname": "mute",
577                                         "responseClass": "void",
578                                         "parameters": [
579                                                 {
580                                                         "name": "channelId",
581                                                         "description": "Channel's id",
582                                                         "paramType": "path",
583                                                         "required": true,
584                                                         "allowMultiple": false,
585                                                         "dataType": "string"
586                                                 },
587                                                 {
588                                                         "name": "direction",
589                                                         "description": "Direction in which to mute audio",
590                                                         "paramType": "query",
591                                                         "required": false,
592                                                         "allowMultiple": false,
593                                                         "dataType": "string",
594                                                         "defaultValue": "both",
595                                                         "allowableValues": {
596                                                                 "valueType": "LIST",
597                                                                 "values": [
598                                                                         "both",
599                                                                         "in",
600                                                                         "out"
601                                                                 ]
602                                                         }
603                                                 }
604                                         ],
605                                         "errorResponses": [
606                                                 {
607                                                         "code": 404,
608                                                         "reason": "Channel not found"
609                                                 },
610                                                 {
611                                                         "code": 409,
612                                                         "reason": "Channel not in a Stasis application"
613                                                 }
614                                         ]
615                                 },
616                                 {
617                                         "httpMethod": "DELETE",
618                                         "summary": "Unmute a channel.",
619                                         "nickname": "unmute",
620                                         "responseClass": "void",
621                                         "parameters": [
622                                                 {
623                                                         "name": "channelId",
624                                                         "description": "Channel's id",
625                                                         "paramType": "path",
626                                                         "required": true,
627                                                         "allowMultiple": false,
628                                                         "dataType": "string"
629                                                 },
630                                                 {
631                                                         "name": "direction",
632                                                         "description": "Direction in which to unmute audio",
633                                                         "paramType": "query",
634                                                         "required": false,
635                                                         "allowMultiple": false,
636                                                         "dataType": "string",
637                                                         "defaultValue": "both",
638                                                         "allowableValues": {
639                                                                 "valueType": "LIST",
640                                                                 "values": [
641                                                                         "both",
642                                                                         "in",
643                                                                         "out"
644                                                                 ]
645                                                         }
646                                                 }
647                                         ],
648                                         "errorResponses": [
649                                                 {
650                                                         "code": 404,
651                                                         "reason": "Channel not found"
652                                                 },
653                                                 {
654                                                         "code": 409,
655                                                         "reason": "Channel not in a Stasis application"
656                                                 }
657                                         ]
658                                 }
659                         ]
660                 },
661                 {
662                         "path": "/channels/{channelId}/hold",
663                         "description": "Put a channel on hold",
664                         "operations": [
665                                 {
666                                         "httpMethod": "POST",
667                                         "summary": "Hold a channel.",
668                                         "nickname": "hold",
669                                         "responseClass": "void",
670                                         "parameters": [
671                                                 {
672                                                         "name": "channelId",
673                                                         "description": "Channel's id",
674                                                         "paramType": "path",
675                                                         "required": true,
676                                                         "allowMultiple": false,
677                                                         "dataType": "string"
678                                                 }
679                                         ],
680                                         "errorResponses": [
681                                                 {
682                                                         "code": 404,
683                                                         "reason": "Channel not found"
684                                                 },
685                                                 {
686                                                         "code": 409,
687                                                         "reason": "Channel not in a Stasis application"
688                                                 }
689                                         ]
690                                 },
691                                 {
692                                         "httpMethod": "DELETE",
693                                         "summary": "Remove a channel from hold.",
694                                         "nickname": "unhold",
695                                         "responseClass": "void",
696                                         "parameters": [
697                                                 {
698                                                         "name": "channelId",
699                                                         "description": "Channel's id",
700                                                         "paramType": "path",
701                                                         "required": true,
702                                                         "allowMultiple": false,
703                                                         "dataType": "string"
704                                                 }
705                                         ],
706                                         "errorResponses": [
707                                                 {
708                                                         "code": 404,
709                                                         "reason": "Channel not found"
710                                                 },
711                                                 {
712                                                         "code": 409,
713                                                         "reason": "Channel not in a Stasis application"
714                                                 }
715                                         ]
716                                 }
717                         ]
718                 },
719                 {
720                         "path": "/channels/{channelId}/moh",
721                         "description": "Play music on hold to a channel",
722                         "operations": [
723                                 {
724                                         "httpMethod": "POST",
725                                         "summary": "Play music on hold to a channel.",
726                                         "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.",
727                                         "nickname": "startMoh",
728                                         "responseClass": "void",
729                                         "parameters": [
730                                                 {
731                                                         "name": "channelId",
732                                                         "description": "Channel's id",
733                                                         "paramType": "path",
734                                                         "required": true,
735                                                         "allowMultiple": false,
736                                                         "dataType": "string"
737                                                 },
738                                                 {
739                                                         "name": "mohClass",
740                                                         "description": "Music on hold class to use",
741                                                         "paramType": "query",
742                                                         "required": false,
743                                                         "allowMultiple": false,
744                                                         "dataType": "string"
745                                                 }
746                                         ],
747                                         "errorResponses": [
748                                                 {
749                                                         "code": 404,
750                                                         "reason": "Channel not found"
751                                                 },
752                                                 {
753                                                         "code": 409,
754                                                         "reason": "Channel not in a Stasis application"
755                                                 }
756                                         ]
757                                 },
758                                 {
759                                         "httpMethod": "DELETE",
760                                         "summary": "Stop playing music on hold to a channel.",
761                                         "nickname": "stopMoh",
762                                         "responseClass": "void",
763                                         "parameters": [
764                                                 {
765                                                         "name": "channelId",
766                                                         "description": "Channel's id",
767                                                         "paramType": "path",
768                                                         "required": true,
769                                                         "allowMultiple": false,
770                                                         "dataType": "string"
771                                                 }
772                                         ],
773                                         "errorResponses": [
774                                                 {
775                                                         "code": 404,
776                                                         "reason": "Channel not found"
777                                                 },
778                                                 {
779                                                         "code": 409,
780                                                         "reason": "Channel not in a Stasis application"
781                                                 }
782                                         ]
783                                 }
784                         ]
785                 },
786                 {
787                         "path": "/channels/{channelId}/silence",
788                         "description": "Play silence to a channel",
789                         "operations": [
790                                 {
791                                         "httpMethod": "POST",
792                                         "summary": "Play silence to a channel.",
793                                         "notes": "Using media operations such as /play on a channel playing silence in this manner will suspend silence without resuming automatically.",
794                                         "nickname": "startSilence",
795                                         "responseClass": "void",
796                                         "parameters": [
797                                                 {
798                                                         "name": "channelId",
799                                                         "description": "Channel's id",
800                                                         "paramType": "path",
801                                                         "required": true,
802                                                         "allowMultiple": false,
803                                                         "dataType": "string"
804                                                 }
805                                         ],
806                                         "errorResponses": [
807                                                 {
808                                                         "code": 404,
809                                                         "reason": "Channel not found"
810                                                 },
811                                                 {
812                                                         "code": 409,
813                                                         "reason": "Channel not in a Stasis application"
814                                                 }
815                                         ]
816                                 },
817                                 {
818                                         "httpMethod": "DELETE",
819                                         "summary": "Stop playing silence to a channel.",
820                                         "nickname": "stopSilence",
821                                         "responseClass": "void",
822                                         "parameters": [
823                                                 {
824                                                         "name": "channelId",
825                                                         "description": "Channel's id",
826                                                         "paramType": "path",
827                                                         "required": true,
828                                                         "allowMultiple": false,
829                                                         "dataType": "string"
830                                                 }
831                                         ],
832                                         "errorResponses": [
833                                                 {
834                                                         "code": 404,
835                                                         "reason": "Channel not found"
836                                                 },
837                                                 {
838                                                         "code": 409,
839                                                         "reason": "Channel not in a Stasis application"
840                                                 }
841                                         ]
842                                 }
843                         ]
844                 },
845                 {
846                         "path": "/channels/{channelId}/play",
847                         "description": "Play media to a channel",
848                         "operations": [
849                                 {
850                                         "httpMethod": "POST",
851                                         "summary": "Start playback of media.",
852                                         "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: 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.)",
853                                         "nickname": "play",
854                                         "responseClass": "Playback",
855                                         "parameters": [
856                                                 {
857                                                         "name": "channelId",
858                                                         "description": "Channel's id",
859                                                         "paramType": "path",
860                                                         "required": true,
861                                                         "allowMultiple": false,
862                                                         "dataType": "string"
863                                                 },
864                                                 {
865                                                         "name": "media",
866                                                         "description": "Media's URI to play.",
867                                                         "paramType": "query",
868                                                         "required": true,
869                                                         "allowMultiple": false,
870                                                         "dataType": "string"
871                                                 },
872                                                 {
873                                                         "name": "lang",
874                                                         "description": "For sounds, selects language for sound.",
875                                                         "paramType": "query",
876                                                         "required": false,
877                                                         "allowMultiple": false,
878                                                         "dataType": "string"
879                                                 },
880                                                 {
881                                                         "name": "offsetms",
882                                                         "description": "Number of media to skip before playing.",
883                                                         "paramType": "query",
884                                                         "required": false,
885                                                         "allowMultiple": false,
886                                                         "dataType": "int"
887                                                 },
888                                                 {
889                                                         "name": "skipms",
890                                                         "description": "Number of milliseconds to skip for forward/reverse operations.",
891                                                         "paramType": "query",
892                                                         "required": false,
893                                                         "allowMultiple": false,
894                                                         "dataType": "int",
895                                                         "defaultValue": 3000
896                                                 },
897                                                 {
898                                                         "name": "playbackId",
899                                                         "description": "Playback ID.",
900                                                         "paramType": "query",
901                                                         "required": false,
902                                                         "allowMultiple": false,
903                                                         "dataType": "string"
904                                                 }
905                                         ],
906                                         "errorResponses": [
907                                                 {
908                                                         "code": 404,
909                                                         "reason": "Channel not found"
910                                                 },
911                                                 {
912                                                         "code": 409,
913                                                         "reason": "Channel not in a Stasis application"
914                                                 }
915                                         ]
916                                 }
917                         ]
918                 },
919                 {
920                         "path": "/channels/{channelId}/play/{playbackId}",
921                         "description": "Play media to a channel",
922                         "operations": [
923                                 {
924                                         "httpMethod": "POST",
925                                         "summary": "Start playback of media and specify the playbackId.",
926                                         "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: 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.)",
927                                         "nickname": "playWithId",
928                                         "responseClass": "Playback",
929                                         "parameters": [
930                                                 {
931                                                         "name": "channelId",
932                                                         "description": "Channel's id",
933                                                         "paramType": "path",
934                                                         "required": true,
935                                                         "allowMultiple": false,
936                                                         "dataType": "string"
937                                                 },
938                                                 {
939                                                         "name": "playbackId",
940                                                         "description": "Playback ID.",
941                                                         "paramType": "path",
942                                                         "required": true,
943                                                         "allowMultiple": false,
944                                                         "dataType": "string"
945                                                 },
946                                                 {
947                                                         "name": "media",
948                                                         "description": "Media's URI to play.",
949                                                         "paramType": "query",
950                                                         "required": true,
951                                                         "allowMultiple": false,
952                                                         "dataType": "string"
953                                                 },
954                                                 {
955                                                         "name": "lang",
956                                                         "description": "For sounds, selects language for sound.",
957                                                         "paramType": "query",
958                                                         "required": false,
959                                                         "allowMultiple": false,
960                                                         "dataType": "string"
961                                                 },
962                                                 {
963                                                         "name": "offsetms",
964                                                         "description": "Number of media to skip before playing.",
965                                                         "paramType": "query",
966                                                         "required": false,
967                                                         "allowMultiple": false,
968                                                         "dataType": "int"
969                                                 },
970                                                 {
971                                                         "name": "skipms",
972                                                         "description": "Number of milliseconds to skip for forward/reverse operations.",
973                                                         "paramType": "query",
974                                                         "required": false,
975                                                         "allowMultiple": false,
976                                                         "dataType": "int",
977                                                         "defaultValue": 3000
978                                                 }
979                                         ],
980                                         "errorResponses": [
981                                                 {
982                                                         "code": 404,
983                                                         "reason": "Channel not found"
984                                                 },
985                                                 {
986                                                         "code": 409,
987                                                         "reason": "Channel not in a Stasis application"
988                                                 }
989                                         ]
990                                 }
991                         ]
992                 },
993                 {
994                         "path": "/channels/{channelId}/record",
995                         "description": "Record audio from a channel",
996                         "operations": [
997                                 {
998                                         "httpMethod": "POST",
999                                         "summary": "Start a recording.",
1000                                         "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.",
1001                                         "nickname": "record",
1002                                         "responseClass": "LiveRecording",
1003                                         "parameters": [
1004                                                 {
1005                                                         "name": "channelId",
1006                                                         "description": "Channel's id",
1007                                                         "paramType": "path",
1008                                                         "required": true,
1009                                                         "allowMultiple": false,
1010                                                         "dataType": "string"
1011                                                 },
1012                                                 {
1013                                                         "name": "name",
1014                                                         "description": "Recording's filename",
1015                                                         "paramType": "query",
1016                                                         "required": true,
1017                                                         "allowMultiple": false,
1018                                                         "dataType": "string"
1019                                                 },
1020                                                 {
1021                                                         "name": "format",
1022                                                         "description": "Format to encode audio in",
1023                                                         "paramType": "query",
1024                                                         "required": true,
1025                                                         "allowMultiple": false,
1026                                                         "dataType": "string"
1027                                                 },
1028                                                 {
1029                                                         "name": "maxDurationSeconds",
1030                                                         "description": "Maximum duration of the recording, in seconds. 0 for no limit",
1031                                                         "paramType": "query",
1032                                                         "required": false,
1033                                                         "allowMultiple": false,
1034                                                         "dataType": "int",
1035                                                         "defaultValue": 0,
1036                                                         "allowableValues": {
1037                                                                 "valueType": "RANGE",
1038                                                                 "min": 0
1039                                                         }
1040                                                 },
1041                                                 {
1042                                                         "name": "maxSilenceSeconds",
1043                                                         "description": "Maximum duration of silence, in seconds. 0 for no limit",
1044                                                         "paramType": "query",
1045                                                         "required": false,
1046                                                         "allowMultiple": false,
1047                                                         "dataType": "int",
1048                                                         "defaultValue": 0,
1049                                                         "allowableValues": {
1050                                                                 "valueType": "RANGE",
1051                                                                 "min": 0
1052                                                         }
1053                                                 },
1054                                                 {
1055                                                         "name": "ifExists",
1056                                                         "description": "Action to take if a recording with the same name already exists.",
1057                                                         "paramType": "query",
1058                                                         "required": false,
1059                                                         "allowMultiple": false,
1060                                                         "dataType": "string",
1061                                                         "defaultValue": "fail",
1062                                                         "allowableValues": {
1063                                                                 "valueType": "LIST",
1064                                                                 "values": [
1065                                                                         "fail",
1066                                                                         "overwrite",
1067                                                                         "append"
1068                                                                 ]
1069                                                         }
1070                                                 },
1071                                                 {
1072                                                         "name": "beep",
1073                                                         "description": "Play beep when recording begins",
1074                                                         "paramType": "query",
1075                                                         "required": false,
1076                                                         "allowMultiple": false,
1077                                                         "dataType": "boolean",
1078                                                         "defaultValue": false
1079                                                 },
1080                                                 {
1081                                                         "name": "terminateOn",
1082                                                         "description": "DTMF input to terminate recording",
1083                                                         "paramType": "query",
1084                                                         "required": false,
1085                                                         "allowMultiple": false,
1086                                                         "dataType": "string",
1087                                                         "defaultValue": "none",
1088                                                         "allowableValues": {
1089                                                                 "valueType": "LIST",
1090                                                                 "values": [
1091                                                                         "none",
1092                                                                         "any",
1093                                                                         "*",
1094                                                                         "#"
1095                                                                 ]
1096                                                         }
1097                                                 }
1098                                         ],
1099                                         "errorResponses": [
1100                                                 {
1101                                                         "code": 400,
1102                                                         "reason": "Invalid parameters"
1103                                                 },
1104                                                 {
1105                                                         "code": 404,
1106                                                         "reason": "Channel not found"
1107                                                 },
1108                                                 {
1109                                                         "code": 409,
1110                                                         "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"
1111                                                 },
1112                                                 {
1113                                                         "code": 422,
1114                                                         "reason": "The format specified is unknown on this system"
1115                                                 }
1116                                         ]
1117                                 }
1118                         ]
1119                 },
1120                 {
1121                         "path": "/channels/{channelId}/variable",
1122                         "description": "Variables on a channel",
1123                         "operations": [
1124                                 {
1125                                         "httpMethod": "GET",
1126                                         "summary": "Get the value of a channel variable or function.",
1127                                         "nickname": "getChannelVar",
1128                                         "responseClass": "Variable",
1129                                         "parameters": [
1130                                                 {
1131                                                         "name": "channelId",
1132                                                         "description": "Channel's id",
1133                                                         "paramType": "path",
1134                                                         "required": true,
1135                                                         "allowMultiple": false,
1136                                                         "dataType": "string"
1137                                                 },
1138                                                 {
1139                                                         "name": "variable",
1140                                                         "description": "The channel variable or function to get",
1141                                                         "paramType": "query",
1142                                                         "required": true,
1143                                                         "allowMultiple": false,
1144                                                         "dataType": "string"
1145                                                 }
1146                                         ],
1147                                         "errorResponses": [
1148                                                 {
1149                                                         "code": 400,
1150                                                         "reason": "Missing variable parameter."
1151                                                 },
1152                                                 {
1153                                                         "code": 404,
1154                                                         "reason": "Channel not found"
1155                                                 },
1156                                                 {
1157                                                         "code": 409,
1158                                                         "reason": "Channel not in a Stasis application"
1159                                                 }
1160                                         ]
1161                                 },
1162                                 {
1163                                         "httpMethod": "POST",
1164                                         "summary": "Set the value of a channel variable or function.",
1165                                         "nickname": "setChannelVar",
1166                                         "responseClass": "void",
1167                                         "parameters": [
1168                                                 {
1169                                                         "name": "channelId",
1170                                                         "description": "Channel's id",
1171                                                         "paramType": "path",
1172                                                         "required": true,
1173                                                         "allowMultiple": false,
1174                                                         "dataType": "string"
1175                                                 },
1176                                                 {
1177                                                         "name": "variable",
1178                                                         "description": "The channel variable or function to set",
1179                                                         "paramType": "query",
1180                                                         "required": true,
1181                                                         "allowMultiple": false,
1182                                                         "dataType": "string"
1183                                                 },
1184                                                 {
1185                                                         "name": "value",
1186                                                         "description": "The value to set the variable to",
1187                                                         "paramType": "query",
1188                                                         "required": false,
1189                                                         "allowMultiple": false,
1190                                                         "dataType": "string"
1191                                                 }
1192                                         ],
1193                                         "errorResponses": [
1194                                                 {
1195                                                         "code": 400,
1196                                                         "reason": "Missing variable parameter."
1197                                                 },
1198                                                 {
1199                                                         "code": 404,
1200                                                         "reason": "Channel not found"
1201                                                 },
1202                                                 {
1203                                                         "code": 409,
1204                                                         "reason": "Channel not in a Stasis application"
1205                                                 }
1206                                         ]
1207                                 }
1208                         ]
1209                 },
1210                 {
1211                         "path": "/channels/{channelId}/snoop",
1212                         "description": "Snoop (spy/whisper) on a channel",
1213                         "operations": [
1214                                 {
1215                                         "httpMethod": "POST",
1216                                         "summary": "Start snooping.",
1217                                         "notes": "Snoop (spy/whisper) on a specific channel.",
1218                                         "nickname": "snoopChannel",
1219                                         "responseClass": "Channel",
1220                                         "parameters": [
1221                                                 {
1222                                                         "name": "channelId",
1223                                                         "description": "Channel's id",
1224                                                         "paramType": "path",
1225                                                         "required": true,
1226                                                         "allowMultiple": false,
1227                                                         "dataType": "string"
1228                                                 },
1229                                                 {
1230                                                         "name": "spy",
1231                                                         "description": "Direction of audio to spy on",
1232                                                         "paramType": "query",
1233                                                         "required": false,
1234                                                         "allowMultiple": false,
1235                                                         "dataType": "string",
1236                                                         "defaultValue": "none",
1237                                                         "allowableValues": {
1238                                                                 "valueType": "LIST",
1239                                                                 "values": [
1240                                                                         "none",
1241                                                                         "both",
1242                                                                         "out",
1243                                                                         "in"
1244                                                                 ]
1245                                                         }
1246                                                 },
1247                                                 {
1248                                                         "name": "whisper",
1249                                                         "description": "Direction of audio to whisper into",
1250                                                         "paramType": "query",
1251                                                         "required": false,
1252                                                         "allowMultiple": false,
1253                                                         "dataType": "string",
1254                                                         "defaultValue": "none",
1255                                                         "allowableValues": {
1256                                                                 "valueType": "LIST",
1257                                                                 "values": [
1258                                                                         "none",
1259                                                                         "both",
1260                                                                         "out",
1261                                                                         "in"
1262                                                                 ]
1263                                                         }
1264                                                 },
1265                                                 {
1266                                                         "name": "app",
1267                                                         "description": "Application the snooping channel is placed into",
1268                                                         "paramType": "query",
1269                                                         "required": true,
1270                                                         "allowMultiple": false,
1271                                                         "dataType": "string"
1272                                                 },
1273                                                 {
1274                                                         "name": "appArgs",
1275                                                         "description": "The application arguments to pass to the Stasis application",
1276                                                         "paramType": "query",
1277                                                         "required": false,
1278                                                         "allowMultiple": false,
1279                                                         "dataType": "string"
1280                                                 },
1281                                                 {
1282                                                         "name": "snoopId",
1283                                                         "description": "Unique ID to assign to snooping channel",
1284                                                         "paramType": "query",
1285                                                         "required": false,
1286                                                         "allowMultiple": false,
1287                                                         "dataType": "string"
1288                                                 }
1289                                         ],
1290                                         "errorResponses": [
1291                                                 {
1292                                                         "code": 400,
1293                                                         "reason": "Invalid parameters"
1294                                                 },
1295                                                 {
1296                                                         "code": 404,
1297                                                         "reason": "Channel not found"
1298                                                 }
1299                                         ]
1300                                 }
1301                         ]
1302                 },
1303                 {
1304                         "path": "/channels/{channelId}/snoop/{snoopId}",
1305                         "description": "Snoop (spy/whisper) on a channel",
1306                         "operations": [
1307                                 {
1308                                         "httpMethod": "POST",
1309                                         "summary": "Start snooping.",
1310                                         "notes": "Snoop (spy/whisper) on a specific channel.",
1311                                         "nickname": "snoopChannelWithId",
1312                                         "responseClass": "Channel",
1313                                         "parameters": [
1314                                                 {
1315                                                         "name": "channelId",
1316                                                         "description": "Channel's id",
1317                                                         "paramType": "path",
1318                                                         "required": true,
1319                                                         "allowMultiple": false,
1320                                                         "dataType": "string"
1321                                                 },
1322                                                 {
1323                                                         "name": "snoopId",
1324                                                         "description": "Unique ID to assign to snooping channel",
1325                                                         "paramType": "path",
1326                                                         "required": true,
1327                                                         "allowMultiple": false,
1328                                                         "dataType": "string"
1329                                                 },
1330                                                 {
1331                                                         "name": "spy",
1332                                                         "description": "Direction of audio to spy on",
1333                                                         "paramType": "query",
1334                                                         "required": false,
1335                                                         "allowMultiple": false,
1336                                                         "dataType": "string",
1337                                                         "defaultValue": "none",
1338                                                         "allowableValues": {
1339                                                                 "valueType": "LIST",
1340                                                                 "values": [
1341                                                                         "none",
1342                                                                         "both",
1343                                                                         "out",
1344                                                                         "in"
1345                                                                 ]
1346                                                         }
1347                                                 },
1348                                                 {
1349                                                         "name": "whisper",
1350                                                         "description": "Direction of audio to whisper into",
1351                                                         "paramType": "query",
1352                                                         "required": false,
1353                                                         "allowMultiple": false,
1354                                                         "dataType": "string",
1355                                                         "defaultValue": "none",
1356                                                         "allowableValues": {
1357                                                                 "valueType": "LIST",
1358                                                                 "values": [
1359                                                                         "none",
1360                                                                         "both",
1361                                                                         "out",
1362                                                                         "in"
1363                                                                 ]
1364                                                         }
1365                                                 },
1366                                                 {
1367                                                         "name": "app",
1368                                                         "description": "Application the snooping channel is placed into",
1369                                                         "paramType": "query",
1370                                                         "required": true,
1371                                                         "allowMultiple": false,
1372                                                         "dataType": "string"
1373                                                 },
1374                                                 {
1375                                                         "name": "appArgs",
1376                                                         "description": "The application arguments to pass to the Stasis application",
1377                                                         "paramType": "query",
1378                                                         "required": false,
1379                                                         "allowMultiple": false,
1380                                                         "dataType": "string"
1381                                                 }
1382                                         ],
1383                                         "errorResponses": [
1384                                                 {
1385                                                         "code": 400,
1386                                                         "reason": "Invalid parameters"
1387                                                 },
1388                                                 {
1389                                                         "code": 404,
1390                                                         "reason": "Channel not found"
1391                                                 }
1392                                         ]
1393                                 }
1394                         ]
1395                 }
1396         ],
1397         "models": {
1398                 "Dialed": {
1399                         "id": "Dialed",
1400                         "description": "Dialed channel information.",
1401                         "properties": {}
1402                 },
1403                 "DialplanCEP": {
1404                         "id": "DialplanCEP",
1405                         "description": "Dialplan location (context/extension/priority)",
1406                         "properties": {
1407                                 "context": {
1408                                         "required": true,
1409                                         "type": "string",
1410                                         "description": "Context in the dialplan"
1411                                 },
1412                                 "exten": {
1413                                         "required": true,
1414                                         "type": "string",
1415                                         "description": "Extension in the dialplan"
1416                                 },
1417                                 "priority": {
1418                                         "required": true,
1419                                         "type": "long",
1420                                         "description": "Priority in the dialplan"
1421                                 }
1422                         }
1423                 },
1424                 "CallerID": {
1425                         "id": "CallerID",
1426                         "description": "Caller identification",
1427                         "properties": {
1428                                 "name": {
1429                                         "required": true,
1430                                         "type": "string"
1431                                 },
1432                                 "number": {
1433                                         "required": true,
1434                                         "type": "string"
1435                                 }
1436                         }
1437                 },
1438                 "Channel": {
1439                         "id": "Channel",
1440                         "description": "A specific communication connection between Asterisk and an Endpoint.",
1441                         "properties": {
1442                                 "id": {
1443                                         "required": true,
1444                                         "type": "string",
1445                                         "description": "Unique identifier of the channel.\n\nThis is the same as the Uniqueid field in AMI."
1446                                 },
1447                                 "name": {
1448                                         "required": true,
1449                                         "type": "string",
1450                                         "description": "Name of the channel (i.e. SIP/foo-0000a7e3)"
1451                                 },
1452                                 "state": {
1453                                         "required": true,
1454                                         "type": "string",
1455                                         "allowableValues": {
1456                                                 "valueType": "LIST",
1457                                                 "values": [
1458                                                         "Down",
1459                                                         "Rsrved",
1460                                                         "OffHook",
1461                                                         "Dialing",
1462                                                         "Ring",
1463                                                         "Ringing",
1464                                                         "Up",
1465                                                         "Busy",
1466                                                         "Dialing Offhook",
1467                                                         "Pre-ring",
1468                                                         "Unknown"
1469                                                 ]
1470                                         }
1471                                 },
1472                                 "caller": {
1473                                         "required": true,
1474                                         "type": "CallerID"
1475                                 },
1476                                 "connected": {
1477                                         "required": true,
1478                                         "type": "CallerID"
1479                                 },
1480                                 "accountcode": {
1481                                         "required": true,
1482                                         "type": "string"
1483                                 },
1484                                 "dialplan": {
1485                                         "required": true,
1486                                         "type": "DialplanCEP",
1487                                         "description": "Current location in the dialplan"
1488                                 },
1489                                 "creationtime": {
1490                                         "required": true,
1491                                         "type": "Date",
1492                                         "description": "Timestamp when channel was created"
1493                                 },
1494                                 "language": {
1495                                         "required": true,
1496                                         "type": "string",
1497                                         "description": "The default spoken language"
1498                                 }
1499                         }
1500                 }
1501         }
1502 }