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