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