res_stasis: Add ability to switch applications.
[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}/move",
520                         "description": "Move the channel from one Stasis application to another.",
521                         "operations": [
522                                 {
523                                         "httpMethod": "POST",
524                                         "summary": "Move the channel from one Stasis application to another.",
525                                         "nickname": "move",
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": "app",
538                                                         "description": "The channel will be passed to this Stasis application.",
539                                                         "paramType": "query",
540                                                         "required": true,
541                                                         "allowMultiple": false,
542                                                         "dataType": "string"
543                                                 },
544                                                 {
545                                                         "name": "appArgs",
546                                                         "description": "The application arguments to pass to the Stasis application provided by 'app'.",
547                                                         "paramType": "query",
548                                                         "required": false,
549                                                         "allowMultiple": false,
550                                                         "dataType": "string"
551                                                 }
552                                         ],
553                                         "errorResponses": [
554                                                 {
555                                                         "code": "404",
556                                                         "reason": "Channel not found"
557                                                 },
558                                                 {
559                                                         "code": "409",
560                                                         "reason": "Channel not in a Stasis application"
561                                                 }
562                                         ]
563                                 }
564                         ]
565                 },
566                 {
567                         "path": "/channels/{channelId}/redirect",
568                         "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.",
569                         "operations": [
570                                 {
571                                         "httpMethod": "POST",
572                                         "summary": "Redirect the channel to a different location.",
573                                         "nickname": "redirect",
574                                         "responseClass": "void",
575                                         "parameters": [
576                                                 {
577                                                         "name": "channelId",
578                                                         "description": "Channel's id",
579                                                         "paramType": "path",
580                                                         "required": true,
581                                                         "allowMultiple": false,
582                                                         "dataType": "string"
583                                                 },
584                                                 {
585                                                         "name": "endpoint",
586                                                         "description": "The endpoint to redirect the channel to",
587                                                         "paramType": "query",
588                                                         "required": true,
589                                                         "allowMultiple": false,
590                                                         "dataType": "string"
591                                                 }
592                                         ],
593                                         "errorResponses": [
594                                                 {
595                                                         "code": 400,
596                                                         "reason": "Endpoint parameter not provided"
597                                                 },
598                                                 {
599                                                         "code": 404,
600                                                         "reason": "Channel or endpoint not found"
601                                                 },
602                                                 {
603                                                         "code": 409,
604                                                         "reason": "Channel not in a Stasis application"
605                                                 },
606                                                 {
607                                                         "code": 422,
608                                                         "reason": "Endpoint is not the same type as the channel"
609                                                 },
610                                                 {
611                                                         "code": 412,
612                                                         "reason": "Channel in invalid state"
613                                                 }
614                                         ]
615                                 }
616                         ]
617                 },
618                 {
619                         "path": "/channels/{channelId}/answer",
620                         "description": "Answer a channel",
621                         "operations": [
622                                 {
623                                         "httpMethod": "POST",
624                                         "summary": "Answer a channel.",
625                                         "nickname": "answer",
626                                         "responseClass": "void",
627                                         "parameters": [
628                                                 {
629                                                         "name": "channelId",
630                                                         "description": "Channel's id",
631                                                         "paramType": "path",
632                                                         "required": true,
633                                                         "allowMultiple": false,
634                                                         "dataType": "string"
635                                                 }
636                                         ],
637                                         "errorResponses": [
638                                                 {
639                                                         "code": 404,
640                                                         "reason": "Channel not found"
641                                                 },
642                                                 {
643                                                         "code": 409,
644                                                         "reason": "Channel not in a Stasis application"
645                                                 },
646                                                 {
647                                                         "code": 412,
648                                                         "reason": "Channel in invalid state"
649                                                 }
650                                         ]
651                                 }
652                         ]
653                 },
654                 {
655                         "path": "/channels/{channelId}/ring",
656                         "description": "Send a ringing indication to a channel",
657                         "operations": [
658                                 {
659                                         "httpMethod": "POST",
660                                         "summary": "Indicate ringing to a channel.",
661                                         "nickname": "ring",
662                                         "responseClass": "void",
663                                         "parameters": [
664                                                 {
665                                                         "name": "channelId",
666                                                         "description": "Channel's id",
667                                                         "paramType": "path",
668                                                         "required": true,
669                                                         "allowMultiple": false,
670                                                         "dataType": "string"
671                                                 }
672                                         ],
673                                         "errorResponses": [
674                                                 {
675                                                         "code": 404,
676                                                         "reason": "Channel not found"
677                                                 },
678                                                 {
679                                                         "code": 409,
680                                                         "reason": "Channel not in a Stasis application"
681                                                 },
682                                                 {
683                                                         "code": 412,
684                                                         "reason": "Channel in invalid state"
685                                                 }
686                                         ]
687                                 },
688                                 {
689                                         "httpMethod": "DELETE",
690                                         "summary": "Stop ringing indication on a channel if locally generated.",
691                                         "nickname": "ringStop",
692                                         "responseClass": "void",
693                                         "parameters": [
694                                                 {
695                                                         "name": "channelId",
696                                                         "description": "Channel's id",
697                                                         "paramType": "path",
698                                                         "required": true,
699                                                         "allowMultiple": false,
700                                                         "dataType": "string"
701                                                 }
702                                         ],
703                                         "errorResponses": [
704                                                 {
705                                                         "code": 404,
706                                                         "reason": "Channel not found"
707                                                 },
708                                                 {
709                                                         "code": 409,
710                                                         "reason": "Channel not in a Stasis application"
711                                                 },
712                                                 {
713                                                         "code": 412,
714                                                         "reason": "Channel in invalid state"
715                                                 }
716                                         ]
717                                 }
718                         ]
719                 },
720                 {
721                         "path": "/channels/{channelId}/dtmf",
722                         "description": "Send DTMF to a channel",
723                         "operations": [
724                                 {
725                                         "httpMethod": "POST",
726                                         "summary": "Send provided DTMF to a given channel.",
727                                         "nickname": "sendDTMF",
728                                         "responseClass": "void",
729                                         "parameters": [
730                                                 {
731                                                         "name": "channelId",
732                                                         "description": "Channel's id",
733                                                         "paramType": "path",
734                                                         "required": true,
735                                                         "allowMultiple": false,
736                                                         "dataType": "string"
737                                                 },
738                                                 {
739                                                         "name": "dtmf",
740                                                         "description": "DTMF To send.",
741                                                         "paramType": "query",
742                                                         "required": false,
743                                                         "allowMultiple": false,
744                                                         "dataType": "string"
745                                                 },
746                                                 {
747                                                         "name": "before",
748                                                         "description": "Amount of time to wait before DTMF digits (specified in milliseconds) start.",
749                                                         "paramType": "query",
750                                                         "required": false,
751                                                         "allowMultiple": false,
752                                                         "dataType": "int",
753                                                         "defaultValue": 0
754                                                 },
755                                                 {
756                                                         "name": "between",
757                                                         "description": "Amount of time in between DTMF digits (specified in milliseconds).",
758                                                         "paramType": "query",
759                                                         "required": false,
760                                                         "allowMultiple": false,
761                                                         "dataType": "int",
762                                                         "defaultValue": 100
763                                                 },
764                                                 {
765                                                         "name": "duration",
766                                                         "description": "Length of each DTMF digit (specified in milliseconds).",
767                                                         "paramType": "query",
768                                                         "required": false,
769                                                         "allowMultiple": false,
770                                                         "dataType": "int",
771                                                         "defaultValue": 100
772                                                 },
773                                                 {
774                                                         "name": "after",
775                                                         "description": "Amount of time to wait after DTMF digits (specified in milliseconds) end.",
776                                                         "paramType": "query",
777                                                         "required": false,
778                                                         "allowMultiple": false,
779                                                         "dataType": "int",
780                                                         "defaultValue": 0
781                                                 }
782                                         ],
783                                         "errorResponses": [
784                                                 {
785                                                         "code": 400,
786                                                         "reason": "DTMF is required"
787                                                 },
788                                                 {
789                                                         "code": 404,
790                                                         "reason": "Channel not found"
791                                                 },
792                                                 {
793                                                         "code": 409,
794                                                         "reason": "Channel not in a Stasis application"
795                                                 },
796                                                 {
797                                                         "code": 412,
798                                                         "reason": "Channel in invalid state"
799                                                 }
800                                         ]
801                                 }
802                         ]
803                 },
804                 {
805                         "path": "/channels/{channelId}/mute",
806                         "description": "Mute a channel",
807                         "operations": [
808                                 {
809                                         "httpMethod": "POST",
810                                         "summary": "Mute a channel.",
811                                         "nickname": "mute",
812                                         "responseClass": "void",
813                                         "parameters": [
814                                                 {
815                                                         "name": "channelId",
816                                                         "description": "Channel's id",
817                                                         "paramType": "path",
818                                                         "required": true,
819                                                         "allowMultiple": false,
820                                                         "dataType": "string"
821                                                 },
822                                                 {
823                                                         "name": "direction",
824                                                         "description": "Direction in which to mute audio",
825                                                         "paramType": "query",
826                                                         "required": false,
827                                                         "allowMultiple": false,
828                                                         "dataType": "string",
829                                                         "defaultValue": "both",
830                                                         "allowableValues": {
831                                                                 "valueType": "LIST",
832                                                                 "values": [
833                                                                         "both",
834                                                                         "in",
835                                                                         "out"
836                                                                 ]
837                                                         }
838                                                 }
839                                         ],
840                                         "errorResponses": [
841                                                 {
842                                                         "code": 404,
843                                                         "reason": "Channel not found"
844                                                 },
845                                                 {
846                                                         "code": 409,
847                                                         "reason": "Channel not in a Stasis application"
848                                                 },
849                                                 {
850                                                         "code": 412,
851                                                         "reason": "Channel in invalid state"
852                                                 }
853                                         ]
854                                 },
855                                 {
856                                         "httpMethod": "DELETE",
857                                         "summary": "Unmute a channel.",
858                                         "nickname": "unmute",
859                                         "responseClass": "void",
860                                         "parameters": [
861                                                 {
862                                                         "name": "channelId",
863                                                         "description": "Channel's id",
864                                                         "paramType": "path",
865                                                         "required": true,
866                                                         "allowMultiple": false,
867                                                         "dataType": "string"
868                                                 },
869                                                 {
870                                                         "name": "direction",
871                                                         "description": "Direction in which to unmute audio",
872                                                         "paramType": "query",
873                                                         "required": false,
874                                                         "allowMultiple": false,
875                                                         "dataType": "string",
876                                                         "defaultValue": "both",
877                                                         "allowableValues": {
878                                                                 "valueType": "LIST",
879                                                                 "values": [
880                                                                         "both",
881                                                                         "in",
882                                                                         "out"
883                                                                 ]
884                                                         }
885                                                 }
886                                         ],
887                                         "errorResponses": [
888                                                 {
889                                                         "code": 404,
890                                                         "reason": "Channel not found"
891                                                 },
892                                                 {
893                                                         "code": 409,
894                                                         "reason": "Channel not in a Stasis application"
895                                                 },
896                                                 {
897                                                         "code": 412,
898                                                         "reason": "Channel in invalid state"
899                                                 }
900                                         ]
901                                 }
902                         ]
903                 },
904                 {
905                         "path": "/channels/{channelId}/hold",
906                         "description": "Put a channel on hold",
907                         "operations": [
908                                 {
909                                         "httpMethod": "POST",
910                                         "summary": "Hold a channel.",
911                                         "nickname": "hold",
912                                         "responseClass": "void",
913                                         "parameters": [
914                                                 {
915                                                         "name": "channelId",
916                                                         "description": "Channel's id",
917                                                         "paramType": "path",
918                                                         "required": true,
919                                                         "allowMultiple": false,
920                                                         "dataType": "string"
921                                                 }
922                                         ],
923                                         "errorResponses": [
924                                                 {
925                                                         "code": 404,
926                                                         "reason": "Channel not found"
927                                                 },
928                                                 {
929                                                         "code": 409,
930                                                         "reason": "Channel not in a Stasis application"
931                                                 },
932                                                 {
933                                                         "code": 412,
934                                                         "reason": "Channel in invalid state"
935                                                 }
936                                         ]
937                                 },
938                                 {
939                                         "httpMethod": "DELETE",
940                                         "summary": "Remove a channel from hold.",
941                                         "nickname": "unhold",
942                                         "responseClass": "void",
943                                         "parameters": [
944                                                 {
945                                                         "name": "channelId",
946                                                         "description": "Channel's id",
947                                                         "paramType": "path",
948                                                         "required": true,
949                                                         "allowMultiple": false,
950                                                         "dataType": "string"
951                                                 }
952                                         ],
953                                         "errorResponses": [
954                                                 {
955                                                         "code": 404,
956                                                         "reason": "Channel not found"
957                                                 },
958                                                 {
959                                                         "code": 409,
960                                                         "reason": "Channel not in a Stasis application"
961                                                 },
962                                                 {
963                                                         "code": 412,
964                                                         "reason": "Channel in invalid state"
965                                                 }
966                                         ]
967                                 }
968                         ]
969                 },
970                 {
971                         "path": "/channels/{channelId}/moh",
972                         "description": "Play music on hold to a channel",
973                         "operations": [
974                                 {
975                                         "httpMethod": "POST",
976                                         "summary": "Play music on hold to a channel.",
977                                         "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.",
978                                         "nickname": "startMoh",
979                                         "responseClass": "void",
980                                         "parameters": [
981                                                 {
982                                                         "name": "channelId",
983                                                         "description": "Channel's id",
984                                                         "paramType": "path",
985                                                         "required": true,
986                                                         "allowMultiple": false,
987                                                         "dataType": "string"
988                                                 },
989                                                 {
990                                                         "name": "mohClass",
991                                                         "description": "Music on hold class to use",
992                                                         "paramType": "query",
993                                                         "required": false,
994                                                         "allowMultiple": false,
995                                                         "dataType": "string"
996                                                 }
997                                         ],
998                                         "errorResponses": [
999                                                 {
1000                                                         "code": 404,
1001                                                         "reason": "Channel not found"
1002                                                 },
1003                                                 {
1004                                                         "code": 409,
1005                                                         "reason": "Channel not in a Stasis application"
1006                                                 },
1007                                                 {
1008                                                         "code": 412,
1009                                                         "reason": "Channel in invalid state"
1010                                                 }
1011                                         ]
1012                                 },
1013                                 {
1014                                         "httpMethod": "DELETE",
1015                                         "summary": "Stop playing music on hold to a channel.",
1016                                         "nickname": "stopMoh",
1017                                         "responseClass": "void",
1018                                         "parameters": [
1019                                                 {
1020                                                         "name": "channelId",
1021                                                         "description": "Channel's id",
1022                                                         "paramType": "path",
1023                                                         "required": true,
1024                                                         "allowMultiple": false,
1025                                                         "dataType": "string"
1026                                                 }
1027                                         ],
1028                                         "errorResponses": [
1029                                                 {
1030                                                         "code": 404,
1031                                                         "reason": "Channel not found"
1032                                                 },
1033                                                 {
1034                                                         "code": 409,
1035                                                         "reason": "Channel not in a Stasis application"
1036                                                 },
1037                                                 {
1038                                                         "code": 412,
1039                                                         "reason": "Channel in invalid state"
1040                                                 }
1041                                         ]
1042                                 }
1043                         ]
1044                 },
1045                 {
1046                         "path": "/channels/{channelId}/silence",
1047                         "description": "Play silence to a channel",
1048                         "operations": [
1049                                 {
1050                                         "httpMethod": "POST",
1051                                         "summary": "Play silence to a channel.",
1052                                         "notes": "Using media operations such as /play on a channel playing silence in this manner will suspend silence without resuming automatically.",
1053                                         "nickname": "startSilence",
1054                                         "responseClass": "void",
1055                                         "parameters": [
1056                                                 {
1057                                                         "name": "channelId",
1058                                                         "description": "Channel's id",
1059                                                         "paramType": "path",
1060                                                         "required": true,
1061                                                         "allowMultiple": false,
1062                                                         "dataType": "string"
1063                                                 }
1064                                         ],
1065                                         "errorResponses": [
1066                                                 {
1067                                                         "code": 404,
1068                                                         "reason": "Channel not found"
1069                                                 },
1070                                                 {
1071                                                         "code": 409,
1072                                                         "reason": "Channel not in a Stasis application"
1073                                                 },
1074                                                 {
1075                                                         "code": 412,
1076                                                         "reason": "Channel in invalid state"
1077                                                 }
1078                                         ]
1079                                 },
1080                                 {
1081                                         "httpMethod": "DELETE",
1082                                         "summary": "Stop playing silence to a channel.",
1083                                         "nickname": "stopSilence",
1084                                         "responseClass": "void",
1085                                         "parameters": [
1086                                                 {
1087                                                         "name": "channelId",
1088                                                         "description": "Channel's id",
1089                                                         "paramType": "path",
1090                                                         "required": true,
1091                                                         "allowMultiple": false,
1092                                                         "dataType": "string"
1093                                                 }
1094                                         ],
1095                                         "errorResponses": [
1096                                                 {
1097                                                         "code": 404,
1098                                                         "reason": "Channel not found"
1099                                                 },
1100                                                 {
1101                                                         "code": 409,
1102                                                         "reason": "Channel not in a Stasis application"
1103                                                 },
1104                                                 {
1105                                                         "code": 412,
1106                                                         "reason": "Channel in invalid state"
1107                                                 }
1108                                         ]
1109                                 }
1110                         ]
1111                 },
1112                 {
1113                         "path": "/channels/{channelId}/play",
1114                         "description": "Play media to a channel",
1115                         "operations": [
1116                                 {
1117                                         "httpMethod": "POST",
1118                                         "summary": "Start playback of media.",
1119                                         "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.)",
1120                                         "nickname": "play",
1121                                         "responseClass": "Playback",
1122                                         "parameters": [
1123                                                 {
1124                                                         "name": "channelId",
1125                                                         "description": "Channel's id",
1126                                                         "paramType": "path",
1127                                                         "required": true,
1128                                                         "allowMultiple": false,
1129                                                         "dataType": "string"
1130                                                 },
1131                                                 {
1132                                                         "name": "media",
1133                                                         "description": "Media URIs to play.",
1134                                                         "paramType": "query",
1135                                                         "required": true,
1136                                                         "allowMultiple": true,
1137                                                         "dataType": "string"
1138                                                 },
1139                                                 {
1140                                                         "name": "lang",
1141                                                         "description": "For sounds, selects language for sound.",
1142                                                         "paramType": "query",
1143                                                         "required": false,
1144                                                         "allowMultiple": false,
1145                                                         "dataType": "string"
1146                                                 },
1147                                                 {
1148                                                         "name": "offsetms",
1149                                                         "description": "Number of milliseconds to skip before playing. Only applies to the first URI if multiple media URIs are specified.",
1150                                                         "paramType": "query",
1151                                                         "required": false,
1152                                                         "allowMultiple": false,
1153                                                         "dataType": "int"
1154                                                 },
1155                                                 {
1156                                                         "name": "skipms",
1157                                                         "description": "Number of milliseconds to skip for forward/reverse operations.",
1158                                                         "paramType": "query",
1159                                                         "required": false,
1160                                                         "allowMultiple": false,
1161                                                         "dataType": "int",
1162                                                         "defaultValue": 3000
1163                                                 },
1164                                                 {
1165                                                         "name": "playbackId",
1166                                                         "description": "Playback ID.",
1167                                                         "paramType": "query",
1168                                                         "required": false,
1169                                                         "allowMultiple": false,
1170                                                         "dataType": "string"
1171                                                 }
1172                                         ],
1173                                         "errorResponses": [
1174                                                 {
1175                                                         "code": 404,
1176                                                         "reason": "Channel not found"
1177                                                 },
1178                                                 {
1179                                                         "code": 409,
1180                                                         "reason": "Channel not in a Stasis application"
1181                                                 },
1182                                                 {
1183                                                         "code": 412,
1184                                                         "reason": "Channel in invalid state"
1185                                                 }
1186                                         ]
1187                                 }
1188                         ]
1189                 },
1190                 {
1191                         "path": "/channels/{channelId}/play/{playbackId}",
1192                         "description": "Play media to a channel",
1193                         "operations": [
1194                                 {
1195                                         "httpMethod": "POST",
1196                                         "summary": "Start playback of media and specify the playbackId.",
1197                                         "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.)",
1198                                         "nickname": "playWithId",
1199                                         "responseClass": "Playback",
1200                                         "parameters": [
1201                                                 {
1202                                                         "name": "channelId",
1203                                                         "description": "Channel's id",
1204                                                         "paramType": "path",
1205                                                         "required": true,
1206                                                         "allowMultiple": false,
1207                                                         "dataType": "string"
1208                                                 },
1209                                                 {
1210                                                         "name": "playbackId",
1211                                                         "description": "Playback ID.",
1212                                                         "paramType": "path",
1213                                                         "required": true,
1214                                                         "allowMultiple": false,
1215                                                         "dataType": "string"
1216                                                 },
1217                                                 {
1218                                                         "name": "media",
1219                                                         "description": "Media URIs to play.",
1220                                                         "paramType": "query",
1221                                                         "required": true,
1222                                                         "allowMultiple": true,
1223                                                         "dataType": "string"
1224                                                 },
1225                                                 {
1226                                                         "name": "lang",
1227                                                         "description": "For sounds, selects language for sound.",
1228                                                         "paramType": "query",
1229                                                         "required": false,
1230                                                         "allowMultiple": false,
1231                                                         "dataType": "string"
1232                                                 },
1233                                                 {
1234                                                         "name": "offsetms",
1235                                                         "description": "Number of milliseconds to skip before playing. Only applies to the first URI if multiple media URIs are specified.",
1236                                                         "paramType": "query",
1237                                                         "required": false,
1238                                                         "allowMultiple": false,
1239                                                         "dataType": "int"
1240                                                 },
1241                                                 {
1242                                                         "name": "skipms",
1243                                                         "description": "Number of milliseconds to skip for forward/reverse operations.",
1244                                                         "paramType": "query",
1245                                                         "required": false,
1246                                                         "allowMultiple": false,
1247                                                         "dataType": "int",
1248                                                         "defaultValue": 3000
1249                                                 }
1250                                         ],
1251                                         "errorResponses": [
1252                                                 {
1253                                                         "code": 404,
1254                                                         "reason": "Channel not found"
1255                                                 },
1256                                                 {
1257                                                         "code": 409,
1258                                                         "reason": "Channel not in a Stasis application"
1259                                                 },
1260                                                 {
1261                                                         "code": 412,
1262                                                         "reason": "Channel in invalid state"
1263                                                 }
1264                                         ]
1265                                 }
1266                         ]
1267                 },
1268                 {
1269                         "path": "/channels/{channelId}/record",
1270                         "description": "Record audio from a channel",
1271                         "operations": [
1272                                 {
1273                                         "httpMethod": "POST",
1274                                         "summary": "Start a recording.",
1275                                         "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.",
1276                                         "nickname": "record",
1277                                         "responseClass": "LiveRecording",
1278                                         "parameters": [
1279                                                 {
1280                                                         "name": "channelId",
1281                                                         "description": "Channel's id",
1282                                                         "paramType": "path",
1283                                                         "required": true,
1284                                                         "allowMultiple": false,
1285                                                         "dataType": "string"
1286                                                 },
1287                                                 {
1288                                                         "name": "name",
1289                                                         "description": "Recording's filename",
1290                                                         "paramType": "query",
1291                                                         "required": true,
1292                                                         "allowMultiple": false,
1293                                                         "dataType": "string"
1294                                                 },
1295                                                 {
1296                                                         "name": "format",
1297                                                         "description": "Format to encode audio in",
1298                                                         "paramType": "query",
1299                                                         "required": true,
1300                                                         "allowMultiple": false,
1301                                                         "dataType": "string"
1302                                                 },
1303                                                 {
1304                                                         "name": "maxDurationSeconds",
1305                                                         "description": "Maximum duration of the recording, in seconds. 0 for no limit",
1306                                                         "paramType": "query",
1307                                                         "required": false,
1308                                                         "allowMultiple": false,
1309                                                         "dataType": "int",
1310                                                         "defaultValue": 0,
1311                                                         "allowableValues": {
1312                                                                 "valueType": "RANGE",
1313                                                                 "min": 0
1314                                                         }
1315                                                 },
1316                                                 {
1317                                                         "name": "maxSilenceSeconds",
1318                                                         "description": "Maximum duration of silence, in seconds. 0 for no limit",
1319                                                         "paramType": "query",
1320                                                         "required": false,
1321                                                         "allowMultiple": false,
1322                                                         "dataType": "int",
1323                                                         "defaultValue": 0,
1324                                                         "allowableValues": {
1325                                                                 "valueType": "RANGE",
1326                                                                 "min": 0
1327                                                         }
1328                                                 },
1329                                                 {
1330                                                         "name": "ifExists",
1331                                                         "description": "Action to take if a recording with the same name already exists.",
1332                                                         "paramType": "query",
1333                                                         "required": false,
1334                                                         "allowMultiple": false,
1335                                                         "dataType": "string",
1336                                                         "defaultValue": "fail",
1337                                                         "allowableValues": {
1338                                                                 "valueType": "LIST",
1339                                                                 "values": [
1340                                                                         "fail",
1341                                                                         "overwrite",
1342                                                                         "append"
1343                                                                 ]
1344                                                         }
1345                                                 },
1346                                                 {
1347                                                         "name": "beep",
1348                                                         "description": "Play beep when recording begins",
1349                                                         "paramType": "query",
1350                                                         "required": false,
1351                                                         "allowMultiple": false,
1352                                                         "dataType": "boolean",
1353                                                         "defaultValue": false
1354                                                 },
1355                                                 {
1356                                                         "name": "terminateOn",
1357                                                         "description": "DTMF input to terminate recording",
1358                                                         "paramType": "query",
1359                                                         "required": false,
1360                                                         "allowMultiple": false,
1361                                                         "dataType": "string",
1362                                                         "defaultValue": "none",
1363                                                         "allowableValues": {
1364                                                                 "valueType": "LIST",
1365                                                                 "values": [
1366                                                                         "none",
1367                                                                         "any",
1368                                                                         "*",
1369                                                                         "#"
1370                                                                 ]
1371                                                         }
1372                                                 }
1373                                         ],
1374                                         "errorResponses": [
1375                                                 {
1376                                                         "code": 400,
1377                                                         "reason": "Invalid parameters"
1378                                                 },
1379                                                 {
1380                                                         "code": 404,
1381                                                         "reason": "Channel not found"
1382                                                 },
1383                                                 {
1384                                                         "code": 409,
1385                                                         "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"
1386                                                 },
1387                                                 {
1388                                                         "code": 422,
1389                                                         "reason": "The format specified is unknown on this system"
1390                                                 }
1391                                         ]
1392                                 }
1393                         ]
1394                 },
1395                 {
1396                         "path": "/channels/{channelId}/variable",
1397                         "description": "Variables on a channel",
1398                         "operations": [
1399                                 {
1400                                         "httpMethod": "GET",
1401                                         "summary": "Get the value of a channel variable or function.",
1402                                         "nickname": "getChannelVar",
1403                                         "responseClass": "Variable",
1404                                         "parameters": [
1405                                                 {
1406                                                         "name": "channelId",
1407                                                         "description": "Channel's id",
1408                                                         "paramType": "path",
1409                                                         "required": true,
1410                                                         "allowMultiple": false,
1411                                                         "dataType": "string"
1412                                                 },
1413                                                 {
1414                                                         "name": "variable",
1415                                                         "description": "The channel variable or function to get",
1416                                                         "paramType": "query",
1417                                                         "required": true,
1418                                                         "allowMultiple": false,
1419                                                         "dataType": "string"
1420                                                 }
1421                                         ],
1422                                         "errorResponses": [
1423                                                 {
1424                                                         "code": 400,
1425                                                         "reason": "Missing variable parameter."
1426                                                 },
1427                                                 {
1428                                                         "code": 404,
1429                                                         "reason": "Channel or variable not found"
1430                                                 },
1431                                                 {
1432                                                         "code": 409,
1433                                                         "reason": "Channel not in a Stasis application"
1434                                                 }
1435                                         ]
1436                                 },
1437                                 {
1438                                         "httpMethod": "POST",
1439                                         "summary": "Set the value of a channel variable or function.",
1440                                         "nickname": "setChannelVar",
1441                                         "responseClass": "void",
1442                                         "parameters": [
1443                                                 {
1444                                                         "name": "channelId",
1445                                                         "description": "Channel's id",
1446                                                         "paramType": "path",
1447                                                         "required": true,
1448                                                         "allowMultiple": false,
1449                                                         "dataType": "string"
1450                                                 },
1451                                                 {
1452                                                         "name": "variable",
1453                                                         "description": "The channel variable or function to set",
1454                                                         "paramType": "query",
1455                                                         "required": true,
1456                                                         "allowMultiple": false,
1457                                                         "dataType": "string"
1458                                                 },
1459                                                 {
1460                                                         "name": "value",
1461                                                         "description": "The value to set the variable to",
1462                                                         "paramType": "query",
1463                                                         "required": false,
1464                                                         "allowMultiple": false,
1465                                                         "dataType": "string"
1466                                                 }
1467                                         ],
1468                                         "errorResponses": [
1469                                                 {
1470                                                         "code": 400,
1471                                                         "reason": "Missing variable parameter."
1472                                                 },
1473                                                 {
1474                                                         "code": 404,
1475                                                         "reason": "Channel not found"
1476                                                 },
1477                                                 {
1478                                                         "code": 409,
1479                                                         "reason": "Channel not in a Stasis application"
1480                                                 }
1481                                         ]
1482                                 }
1483                         ]
1484                 },
1485                 {
1486                         "path": "/channels/{channelId}/snoop",
1487                         "description": "Snoop (spy/whisper) on a channel",
1488                         "operations": [
1489                                 {
1490                                         "httpMethod": "POST",
1491                                         "summary": "Start snooping.",
1492                                         "notes": "Snoop (spy/whisper) on a specific channel.",
1493                                         "nickname": "snoopChannel",
1494                                         "responseClass": "Channel",
1495                                         "parameters": [
1496                                                 {
1497                                                         "name": "channelId",
1498                                                         "description": "Channel's id",
1499                                                         "paramType": "path",
1500                                                         "required": true,
1501                                                         "allowMultiple": false,
1502                                                         "dataType": "string"
1503                                                 },
1504                                                 {
1505                                                         "name": "spy",
1506                                                         "description": "Direction of audio to spy on",
1507                                                         "paramType": "query",
1508                                                         "required": false,
1509                                                         "allowMultiple": false,
1510                                                         "dataType": "string",
1511                                                         "defaultValue": "none",
1512                                                         "allowableValues": {
1513                                                                 "valueType": "LIST",
1514                                                                 "values": [
1515                                                                         "none",
1516                                                                         "both",
1517                                                                         "out",
1518                                                                         "in"
1519                                                                 ]
1520                                                         }
1521                                                 },
1522                                                 {
1523                                                         "name": "whisper",
1524                                                         "description": "Direction of audio to whisper into",
1525                                                         "paramType": "query",
1526                                                         "required": false,
1527                                                         "allowMultiple": false,
1528                                                         "dataType": "string",
1529                                                         "defaultValue": "none",
1530                                                         "allowableValues": {
1531                                                                 "valueType": "LIST",
1532                                                                 "values": [
1533                                                                         "none",
1534                                                                         "both",
1535                                                                         "out",
1536                                                                         "in"
1537                                                                 ]
1538                                                         }
1539                                                 },
1540                                                 {
1541                                                         "name": "app",
1542                                                         "description": "Application the snooping channel is placed into",
1543                                                         "paramType": "query",
1544                                                         "required": true,
1545                                                         "allowMultiple": false,
1546                                                         "dataType": "string"
1547                                                 },
1548                                                 {
1549                                                         "name": "appArgs",
1550                                                         "description": "The application arguments to pass to the Stasis application",
1551                                                         "paramType": "query",
1552                                                         "required": false,
1553                                                         "allowMultiple": false,
1554                                                         "dataType": "string"
1555                                                 },
1556                                                 {
1557                                                         "name": "snoopId",
1558                                                         "description": "Unique ID to assign to snooping channel",
1559                                                         "paramType": "query",
1560                                                         "required": false,
1561                                                         "allowMultiple": false,
1562                                                         "dataType": "string"
1563                                                 }
1564                                         ],
1565                                         "errorResponses": [
1566                                                 {
1567                                                         "code": 400,
1568                                                         "reason": "Invalid parameters"
1569                                                 },
1570                                                 {
1571                                                         "code": 404,
1572                                                         "reason": "Channel not found"
1573                                                 }
1574                                         ]
1575                                 }
1576                         ]
1577                 },
1578                 {
1579                         "path": "/channels/{channelId}/snoop/{snoopId}",
1580                         "description": "Snoop (spy/whisper) on a channel",
1581                         "operations": [
1582                                 {
1583                                         "httpMethod": "POST",
1584                                         "summary": "Start snooping.",
1585                                         "notes": "Snoop (spy/whisper) on a specific channel.",
1586                                         "nickname": "snoopChannelWithId",
1587                                         "responseClass": "Channel",
1588                                         "parameters": [
1589                                                 {
1590                                                         "name": "channelId",
1591                                                         "description": "Channel's id",
1592                                                         "paramType": "path",
1593                                                         "required": true,
1594                                                         "allowMultiple": false,
1595                                                         "dataType": "string"
1596                                                 },
1597                                                 {
1598                                                         "name": "snoopId",
1599                                                         "description": "Unique ID to assign to snooping channel",
1600                                                         "paramType": "path",
1601                                                         "required": true,
1602                                                         "allowMultiple": false,
1603                                                         "dataType": "string"
1604                                                 },
1605                                                 {
1606                                                         "name": "spy",
1607                                                         "description": "Direction of audio to spy on",
1608                                                         "paramType": "query",
1609                                                         "required": false,
1610                                                         "allowMultiple": false,
1611                                                         "dataType": "string",
1612                                                         "defaultValue": "none",
1613                                                         "allowableValues": {
1614                                                                 "valueType": "LIST",
1615                                                                 "values": [
1616                                                                         "none",
1617                                                                         "both",
1618                                                                         "out",
1619                                                                         "in"
1620                                                                 ]
1621                                                         }
1622                                                 },
1623                                                 {
1624                                                         "name": "whisper",
1625                                                         "description": "Direction of audio to whisper into",
1626                                                         "paramType": "query",
1627                                                         "required": false,
1628                                                         "allowMultiple": false,
1629                                                         "dataType": "string",
1630                                                         "defaultValue": "none",
1631                                                         "allowableValues": {
1632                                                                 "valueType": "LIST",
1633                                                                 "values": [
1634                                                                         "none",
1635                                                                         "both",
1636                                                                         "out",
1637                                                                         "in"
1638                                                                 ]
1639                                                         }
1640                                                 },
1641                                                 {
1642                                                         "name": "app",
1643                                                         "description": "Application the snooping channel is placed into",
1644                                                         "paramType": "query",
1645                                                         "required": true,
1646                                                         "allowMultiple": false,
1647                                                         "dataType": "string"
1648                                                 },
1649                                                 {
1650                                                         "name": "appArgs",
1651                                                         "description": "The application arguments to pass to the Stasis application",
1652                                                         "paramType": "query",
1653                                                         "required": false,
1654                                                         "allowMultiple": false,
1655                                                         "dataType": "string"
1656                                                 }
1657                                         ],
1658                                         "errorResponses": [
1659                                                 {
1660                                                         "code": 400,
1661                                                         "reason": "Invalid parameters"
1662                                                 },
1663                                                 {
1664                                                         "code": 404,
1665                                                         "reason": "Channel not found"
1666                                                 }
1667                                         ]
1668                                 }
1669                         ]
1670                 },
1671                 {
1672                         "path": "/channels/{channelId}/dial",
1673                         "description": "Dial a channel",
1674                         "operations": [
1675                                 {
1676                                         "httpMethod": "POST",
1677                                         "summary": "Dial a created channel.",
1678                                         "nickname": "dial",
1679                                         "responseClass": "void",
1680                                         "parameters": [
1681                                                 {
1682                                                         "name": "channelId",
1683                                                         "description": "Channel's id",
1684                                                         "paramType": "path",
1685                                                         "required": true,
1686                                                         "allowMultiple": false,
1687                                                         "dataType": "string"
1688                                                 },
1689                                                 {
1690                                                         "name": "caller",
1691                                                         "description": "Channel ID of caller",
1692                                                         "paramType": "query",
1693                                                         "required": false,
1694                                                         "allowMultiple": false,
1695                                                         "dataType": "string"
1696                                                 },
1697                                                 {
1698                                                         "name": "timeout",
1699                                                         "description": "Dial timeout",
1700                                                         "paramType": "query",
1701                                                         "required": false,
1702                                                         "allowMultiple": false,
1703                                                         "dataType": "int",
1704                                                         "defaultValue": 0,
1705                                                         "allowableValues": {
1706                                                                 "valueType": "RANGE",
1707                                                                 "min": 0
1708                                                         }
1709                                                 }
1710                                         ],
1711                                         "errorResponses": [
1712                                                 {
1713                                                         "code": 404,
1714                                                         "reason": "Channel cannot be found."
1715                                                 },
1716                                                 {
1717                                                         "code": 409,
1718                                                         "reason": "Channel cannot be dialed."
1719                                                 }
1720                                         ]
1721                                 }
1722                         ]
1723                 }
1724         ],
1725         "models": {
1726                 "Dialed": {
1727                         "id": "Dialed",
1728                         "description": "Dialed channel information.",
1729                         "properties": {}
1730                 },
1731                 "DialplanCEP": {
1732                         "id": "DialplanCEP",
1733                         "description": "Dialplan location (context/extension/priority)",
1734                         "properties": {
1735                                 "context": {
1736                                         "required": true,
1737                                         "type": "string",
1738                                         "description": "Context in the dialplan"
1739                                 },
1740                                 "exten": {
1741                                         "required": true,
1742                                         "type": "string",
1743                                         "description": "Extension in the dialplan"
1744                                 },
1745                                 "priority": {
1746                                         "required": true,
1747                                         "type": "long",
1748                                         "description": "Priority in the dialplan"
1749                                 }
1750                         }
1751                 },
1752                 "CallerID": {
1753                         "id": "CallerID",
1754                         "description": "Caller identification",
1755                         "properties": {
1756                                 "name": {
1757                                         "required": true,
1758                                         "type": "string"
1759                                 },
1760                                 "number": {
1761                                         "required": true,
1762                                         "type": "string"
1763                                 }
1764                         }
1765                 },
1766                 "Channel": {
1767                         "id": "Channel",
1768                         "description": "A specific communication connection between Asterisk and an Endpoint.",
1769                         "properties": {
1770                                 "id": {
1771                                         "required": true,
1772                                         "type": "string",
1773                                         "description": "Unique identifier of the channel.\n\nThis is the same as the Uniqueid field in AMI."
1774                                 },
1775                                 "name": {
1776                                         "required": true,
1777                                         "type": "string",
1778                                         "description": "Name of the channel (i.e. SIP/foo-0000a7e3)"
1779                                 },
1780                                 "state": {
1781                                         "required": true,
1782                                         "type": "string",
1783                                         "allowableValues": {
1784                                                 "valueType": "LIST",
1785                                                 "values": [
1786                                                         "Down",
1787                                                         "Rsrved",
1788                                                         "OffHook",
1789                                                         "Dialing",
1790                                                         "Ring",
1791                                                         "Ringing",
1792                                                         "Up",
1793                                                         "Busy",
1794                                                         "Dialing Offhook",
1795                                                         "Pre-ring",
1796                                                         "Unknown"
1797                                                 ]
1798                                         }
1799                                 },
1800                                 "caller": {
1801                                         "required": true,
1802                                         "type": "CallerID"
1803                                 },
1804                                 "connected": {
1805                                         "required": true,
1806                                         "type": "CallerID"
1807                                 },
1808                                 "accountcode": {
1809                                         "required": true,
1810                                         "type": "string"
1811                                 },
1812                                 "dialplan": {
1813                                         "required": true,
1814                                         "type": "DialplanCEP",
1815                                         "description": "Current location in the dialplan"
1816                                 },
1817                                 "creationtime": {
1818                                         "required": true,
1819                                         "type": "Date",
1820                                         "description": "Timestamp when channel was created"
1821                                 },
1822                                 "language": {
1823                                         "required": true,
1824                                         "type": "string",
1825                                         "description": "The default spoken language"
1826                                 },
1827                                 "channelvars": {
1828                                         "required": false,
1829                                         "type": "object",
1830                                         "description": "Channel variables"
1831                                 }
1832                         }
1833                 }
1834         }
1835 }