res_pjsip_transport_websocket: save the original contact host
[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                                                         "name": "variables",
228                                                         "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\" } }",
229                                                         "paramType": "body",
230                                                         "required": false,
231                                                         "dataType": "containers",
232                                                         "allowMultiple": false
233                                                 }
234                                         ],
235                                         "errorResponses": [
236                                                 {
237                                                         "code": 409,
238                                                         "reason": "Channel with given unique ID already exists."
239                                                 }
240                                         ]
241                                 }
242                         ]
243                 },
244                 {
245                         "path": "/channels/{channelId}",
246                         "description": "Active channel",
247                         "operations": [
248                                 {
249                                         "httpMethod": "GET",
250                                         "summary": "Channel details.",
251                                         "nickname": "get",
252                                         "responseClass": "Channel",
253                                         "parameters": [
254                                                 {
255                                                         "name": "channelId",
256                                                         "description": "Channel's id",
257                                                         "paramType": "path",
258                                                         "required": true,
259                                                         "allowMultiple": false,
260                                                         "dataType": "string"
261                                                 }
262                                         ],
263                                         "errorResponses": [
264                                                 {
265                                                         "code": 404,
266                                                         "reason": "Channel not found"
267                                                 }
268                                         ]
269                                 },
270                                 {
271                                         "httpMethod": "POST",
272                                         "summary": "Create a new channel (originate with id).",
273                                         "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.",
274                                         "nickname": "originateWithId",
275                                         "responseClass": "Channel",
276                                         "parameters": [
277                                                 {
278                                                         "name": "channelId",
279                                                         "description": "The unique id to assign the channel on creation.",
280                                                         "paramType": "path",
281                                                         "required": true,
282                                                         "allowMultiple": false,
283                                                         "dataType": "string"
284                                                 },
285                                                 {
286                                                         "name": "endpoint",
287                                                         "description": "Endpoint to call.",
288                                                         "paramType": "query",
289                                                         "required": true,
290                                                         "allowMultiple": false,
291                                                         "dataType": "string"
292                                                 },
293                                                 {
294                                                         "name": "extension",
295                                                         "description": "The extension to dial after the endpoint answers. Mutually exclusive with 'app'.",
296                                                         "paramType": "query",
297                                                         "required": false,
298                                                         "allowMultiple": false,
299                                                         "dataType": "string"
300                                                 },
301                                                 {
302                                                         "name": "context",
303                                                         "description": "The context to dial after the endpoint answers. If omitted, uses 'default'. Mutually exclusive with 'app'.",
304                                                         "paramType": "query",
305                                                         "required": false,
306                                                         "allowMultiple": false,
307                                                         "dataType": "string"
308                                                 },
309                                                 {
310                                                         "name": "priority",
311                                                         "description": "The priority to dial after the endpoint answers. If omitted, uses 1. Mutually exclusive with 'app'.",
312                                                         "paramType": "query",
313                                                         "required": false,
314                                                         "allowMultiple": false,
315                                                         "dataType": "long"
316                                                 },
317                                                 {
318                                                         "name": "label",
319                                                         "description": "The label to dial after the endpoint answers. Will supersede 'priority' if provided. Mutually exclusive with 'app'.",
320                                                         "paramType": "query",
321                                                         "required": false,
322                                                         "allowMultiple": false,
323                                                         "dataType": "string"
324                                                 },
325                                                 {
326                                                         "name": "app",
327                                                         "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'.",
328                                                         "paramType": "query",
329                                                         "required": false,
330                                                         "allowMultiple": false,
331                                                         "dataType": "string"
332                                                 },
333                                                 {
334                                                         "name": "appArgs",
335                                                         "description": "The application arguments to pass to the Stasis application provided by 'app'. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.",
336                                                         "paramType": "query",
337                                                         "required": false,
338                                                         "allowMultiple": false,
339                                                         "dataType": "string"
340                                                 },
341                                                 {
342                                                         "name": "callerId",
343                                                         "description": "CallerID to use when dialing the endpoint or extension.",
344                                                         "paramType": "query",
345                                                         "required": false,
346                                                         "allowMultiple": false,
347                                                         "dataType": "string"
348                                                 },
349                                                 {
350                                                         "name": "timeout",
351                                                         "description": "Timeout (in seconds) before giving up dialing, or -1 for no timeout.",
352                                                         "paramType": "query",
353                                                         "required": false,
354                                                         "allowMultiple": false,
355                                                         "dataType": "int",
356                                                         "defaultValue": 30
357                                                 },
358                                                 {
359                                                         "name": "variables",
360                                                         "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\" } }",
361                                                         "paramType": "body",
362                                                         "required": false,
363                                                         "dataType": "containers",
364                                                         "allowMultiple": false
365                                                 },
366                                                 {
367                                                         "name": "otherChannelId",
368                                                         "description": "The unique id to assign the second channel when using local channels.",
369                                                         "paramType": "query",
370                                                         "required": false,
371                                                         "allowMultiple": false,
372                                                         "dataType": "string"
373                                                 },
374                                                 {
375                                                         "name": "originator",
376                                                         "description": "The unique id of the channel which is originating this one.",
377                                                         "paramType": "query",
378                                                         "required": false,
379                                                         "allowMultiple": false,
380                                                         "dataType": "string"
381                                                 },
382                                                 {
383                                                         "name": "formats",
384                                                         "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\".",
385                                                         "paramType": "query",
386                                                         "required": false,
387                                                         "allowMultiple": false,
388                                                         "dataType": "string"
389                                                 }
390                                         ],
391                                         "errorResponses": [
392                                                 {
393                                                         "code": 400,
394                                                         "reason": "Invalid parameters for originating a channel."
395                                                 },
396                                                 {
397                                                         "code": 409,
398                                                         "reason": "Channel with given unique ID already exists."
399                                                 }
400                                         ]
401
402                                 },
403                                 {
404                                         "httpMethod": "DELETE",
405                                         "summary": "Delete (i.e. hangup) a channel.",
406                                         "nickname": "hangup",
407                                         "responseClass": "void",
408                                         "parameters": [
409                                                 {
410                                                         "name": "channelId",
411                                                         "description": "Channel's id",
412                                                         "paramType": "path",
413                                                         "required": true,
414                                                         "allowMultiple": false,
415                                                         "dataType": "string"
416                                                 },
417                                                 {
418                                                         "name": "reason_code",
419                                                         "description": "The reason code for hanging up the channel for detail use. Mutually exclusive with 'reason'. See detail hangup codes at here. https://wiki.asterisk.org/wiki/display/AST/Hangup+Cause+Mappings",
420                                                         "paramType": "query",
421                                                         "required": false,
422                                                         "allowMultiple": false,
423                                                         "dataType": "string"
424                                                 },
425                                                 {
426                                                         "name": "reason",
427                                                         "description": "Reason for hanging up the channel for simple use. Mutually exclusive with 'reason_code'.",
428                                                         "paramType": "query",
429                                                         "required": false,
430                                                         "allowMultiple": false,
431                                                         "dataType": "string",
432                                                         "allowableValues": {
433                                                                 "valueType": "LIST",
434                                                                 "values": [
435                                                                         "normal",
436                                                                         "busy",
437                                                                         "congestion",
438                                                                         "no_answer",
439                                                                         "timeout",
440                                                                         "rejected",
441                                                                         "unallocated",
442                                                                         "normal_unspecified",
443                                                                         "number_incomplete",
444                                                                         "codec_mismatch",
445                                                                         "interworking",
446                                                                         "failure",
447                                                                         "answered_elsewhere"
448                                                                 ]
449                                                         }
450                                                 }
451                                         ],
452                                         "errorResponses": [
453                                                 {
454                                                         "code": 400,
455                                                         "reason": "Invalid reason for hangup provided"
456                                                 },
457                                                 {
458                                                         "code": 404,
459                                                         "reason": "Channel not found"
460                                                 }
461                                         ]
462                                 }
463                         ]
464                 },
465                 {
466                         "path": "/channels/{channelId}/continue",
467                         "description": "Exit application; continue execution in the dialplan",
468                         "operations": [
469                                 {
470                                         "httpMethod": "POST",
471                                         "summary": "Exit application; continue execution in the dialplan.",
472                                         "nickname": "continueInDialplan",
473                                         "responseClass": "void",
474                                         "parameters": [
475                                                 {
476                                                         "name": "channelId",
477                                                         "description": "Channel's id",
478                                                         "paramType": "path",
479                                                         "required": true,
480                                                         "allowMultiple": false,
481                                                         "dataType": "string"
482                                                 },
483                                                 {
484                                                         "name": "context",
485                                                         "description": "The context to continue to.",
486                                                         "paramType": "query",
487                                                         "required": false,
488                                                         "allowMultiple": false,
489                                                         "dataType": "string"
490                                                 },
491                                                 {
492                                                         "name": "extension",
493                                                         "description": "The extension to continue to.",
494                                                         "paramType": "query",
495                                                         "required": false,
496                                                         "allowMultiple": false,
497                                                         "dataType": "string"
498                                                 },
499                                                 {
500                                                         "name": "priority",
501                                                         "description": "The priority to continue to.",
502                                                         "paramType": "query",
503                                                         "required": false,
504                                                         "allowMultiple": false,
505                                                         "dataType": "int"
506                                                 },
507                                                 {
508                                                         "name": "label",
509                                                         "description": "The label to continue to - will supersede 'priority' if both are provided.",
510                                                         "paramType": "query",
511                                                         "required": false,
512                                                         "allowMultiple": false,
513                                                         "dataType": "string"
514                                                 }
515                                         ],
516                                         "errorResponses": [
517                                                 {
518                                                         "code": 404,
519                                                         "reason": "Channel not found"
520                                                 },
521                                                 {
522                                                         "code": 409,
523                                                         "reason": "Channel not in a Stasis application"
524                                                 },
525                                                 {
526                                                         "code": 412,
527                                                         "reason": "Channel in invalid state"
528                                                 }
529                                         ]
530                                 }
531                         ]
532                 },
533                 {
534                         "path": "/channels/{channelId}/move",
535                         "description": "Move the channel from one Stasis application to another.",
536                         "operations": [
537                                 {
538                                         "httpMethod": "POST",
539                                         "summary": "Move the channel from one Stasis application to another.",
540                                         "nickname": "move",
541                                         "responseClass": "void",
542                                         "parameters": [
543                                                 {
544                                                         "name": "channelId",
545                                                         "description": "Channel's id",
546                                                         "paramType": "path",
547                                                         "required": true,
548                                                         "allowMultiple": false,
549                                                         "dataType": "string"
550                                                 },
551                                                 {
552                                                         "name": "app",
553                                                         "description": "The channel will be passed to this Stasis application.",
554                                                         "paramType": "query",
555                                                         "required": true,
556                                                         "allowMultiple": false,
557                                                         "dataType": "string"
558                                                 },
559                                                 {
560                                                         "name": "appArgs",
561                                                         "description": "The application arguments to pass to the Stasis application provided by 'app'.",
562                                                         "paramType": "query",
563                                                         "required": false,
564                                                         "allowMultiple": false,
565                                                         "dataType": "string"
566                                                 }
567                                         ],
568                                         "errorResponses": [
569                                                 {
570                                                         "code": "404",
571                                                         "reason": "Channel not found"
572                                                 },
573                                                 {
574                                                         "code": "409",
575                                                         "reason": "Channel not in a Stasis application"
576                                                 }
577                                         ]
578                                 }
579                         ]
580                 },
581                 {
582                         "path": "/channels/{channelId}/redirect",
583                         "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.",
584                         "operations": [
585                                 {
586                                         "httpMethod": "POST",
587                                         "summary": "Redirect the channel to a different location.",
588                                         "nickname": "redirect",
589                                         "responseClass": "void",
590                                         "parameters": [
591                                                 {
592                                                         "name": "channelId",
593                                                         "description": "Channel's id",
594                                                         "paramType": "path",
595                                                         "required": true,
596                                                         "allowMultiple": false,
597                                                         "dataType": "string"
598                                                 },
599                                                 {
600                                                         "name": "endpoint",
601                                                         "description": "The endpoint to redirect the channel to",
602                                                         "paramType": "query",
603                                                         "required": true,
604                                                         "allowMultiple": false,
605                                                         "dataType": "string"
606                                                 }
607                                         ],
608                                         "errorResponses": [
609                                                 {
610                                                         "code": 400,
611                                                         "reason": "Endpoint parameter not provided"
612                                                 },
613                                                 {
614                                                         "code": 404,
615                                                         "reason": "Channel or endpoint not found"
616                                                 },
617                                                 {
618                                                         "code": 409,
619                                                         "reason": "Channel not in a Stasis application"
620                                                 },
621                                                 {
622                                                         "code": 422,
623                                                         "reason": "Endpoint is not the same type as the channel"
624                                                 },
625                                                 {
626                                                         "code": 412,
627                                                         "reason": "Channel in invalid state"
628                                                 }
629                                         ]
630                                 }
631                         ]
632                 },
633                 {
634                         "path": "/channels/{channelId}/answer",
635                         "description": "Answer a channel",
636                         "operations": [
637                                 {
638                                         "httpMethod": "POST",
639                                         "summary": "Answer a channel.",
640                                         "nickname": "answer",
641                                         "responseClass": "void",
642                                         "parameters": [
643                                                 {
644                                                         "name": "channelId",
645                                                         "description": "Channel's id",
646                                                         "paramType": "path",
647                                                         "required": true,
648                                                         "allowMultiple": false,
649                                                         "dataType": "string"
650                                                 }
651                                         ],
652                                         "errorResponses": [
653                                                 {
654                                                         "code": 404,
655                                                         "reason": "Channel not found"
656                                                 },
657                                                 {
658                                                         "code": 409,
659                                                         "reason": "Channel not in a Stasis application"
660                                                 },
661                                                 {
662                                                         "code": 412,
663                                                         "reason": "Channel in invalid state"
664                                                 }
665                                         ]
666                                 }
667                         ]
668                 },
669                 {
670                         "path": "/channels/{channelId}/ring",
671                         "description": "Send a ringing indication to a channel",
672                         "operations": [
673                                 {
674                                         "httpMethod": "POST",
675                                         "summary": "Indicate ringing to a channel.",
676                                         "nickname": "ring",
677                                         "responseClass": "void",
678                                         "parameters": [
679                                                 {
680                                                         "name": "channelId",
681                                                         "description": "Channel's id",
682                                                         "paramType": "path",
683                                                         "required": true,
684                                                         "allowMultiple": false,
685                                                         "dataType": "string"
686                                                 }
687                                         ],
688                                         "errorResponses": [
689                                                 {
690                                                         "code": 404,
691                                                         "reason": "Channel not found"
692                                                 },
693                                                 {
694                                                         "code": 409,
695                                                         "reason": "Channel not in a Stasis application"
696                                                 },
697                                                 {
698                                                         "code": 412,
699                                                         "reason": "Channel in invalid state"
700                                                 }
701                                         ]
702                                 },
703                                 {
704                                         "httpMethod": "DELETE",
705                                         "summary": "Stop ringing indication on a channel if locally generated.",
706                                         "nickname": "ringStop",
707                                         "responseClass": "void",
708                                         "parameters": [
709                                                 {
710                                                         "name": "channelId",
711                                                         "description": "Channel's id",
712                                                         "paramType": "path",
713                                                         "required": true,
714                                                         "allowMultiple": false,
715                                                         "dataType": "string"
716                                                 }
717                                         ],
718                                         "errorResponses": [
719                                                 {
720                                                         "code": 404,
721                                                         "reason": "Channel not found"
722                                                 },
723                                                 {
724                                                         "code": 409,
725                                                         "reason": "Channel not in a Stasis application"
726                                                 },
727                                                 {
728                                                         "code": 412,
729                                                         "reason": "Channel in invalid state"
730                                                 }
731                                         ]
732                                 }
733                         ]
734                 },
735                 {
736                         "path": "/channels/{channelId}/dtmf",
737                         "description": "Send DTMF to a channel",
738                         "operations": [
739                                 {
740                                         "httpMethod": "POST",
741                                         "summary": "Send provided DTMF to a given channel.",
742                                         "nickname": "sendDTMF",
743                                         "responseClass": "void",
744                                         "parameters": [
745                                                 {
746                                                         "name": "channelId",
747                                                         "description": "Channel's id",
748                                                         "paramType": "path",
749                                                         "required": true,
750                                                         "allowMultiple": false,
751                                                         "dataType": "string"
752                                                 },
753                                                 {
754                                                         "name": "dtmf",
755                                                         "description": "DTMF To send.",
756                                                         "paramType": "query",
757                                                         "required": false,
758                                                         "allowMultiple": false,
759                                                         "dataType": "string"
760                                                 },
761                                                 {
762                                                         "name": "before",
763                                                         "description": "Amount of time to wait before DTMF digits (specified in milliseconds) start.",
764                                                         "paramType": "query",
765                                                         "required": false,
766                                                         "allowMultiple": false,
767                                                         "dataType": "int",
768                                                         "defaultValue": 0
769                                                 },
770                                                 {
771                                                         "name": "between",
772                                                         "description": "Amount of time in between DTMF digits (specified in milliseconds).",
773                                                         "paramType": "query",
774                                                         "required": false,
775                                                         "allowMultiple": false,
776                                                         "dataType": "int",
777                                                         "defaultValue": 100
778                                                 },
779                                                 {
780                                                         "name": "duration",
781                                                         "description": "Length of each DTMF digit (specified in milliseconds).",
782                                                         "paramType": "query",
783                                                         "required": false,
784                                                         "allowMultiple": false,
785                                                         "dataType": "int",
786                                                         "defaultValue": 100
787                                                 },
788                                                 {
789                                                         "name": "after",
790                                                         "description": "Amount of time to wait after DTMF digits (specified in milliseconds) end.",
791                                                         "paramType": "query",
792                                                         "required": false,
793                                                         "allowMultiple": false,
794                                                         "dataType": "int",
795                                                         "defaultValue": 0
796                                                 }
797                                         ],
798                                         "errorResponses": [
799                                                 {
800                                                         "code": 400,
801                                                         "reason": "DTMF is required"
802                                                 },
803                                                 {
804                                                         "code": 404,
805                                                         "reason": "Channel not found"
806                                                 },
807                                                 {
808                                                         "code": 409,
809                                                         "reason": "Channel not in a Stasis application"
810                                                 },
811                                                 {
812                                                         "code": 412,
813                                                         "reason": "Channel in invalid state"
814                                                 }
815                                         ]
816                                 }
817                         ]
818                 },
819                 {
820                         "path": "/channels/{channelId}/mute",
821                         "description": "Mute a channel",
822                         "operations": [
823                                 {
824                                         "httpMethod": "POST",
825                                         "summary": "Mute a channel.",
826                                         "nickname": "mute",
827                                         "responseClass": "void",
828                                         "parameters": [
829                                                 {
830                                                         "name": "channelId",
831                                                         "description": "Channel's id",
832                                                         "paramType": "path",
833                                                         "required": true,
834                                                         "allowMultiple": false,
835                                                         "dataType": "string"
836                                                 },
837                                                 {
838                                                         "name": "direction",
839                                                         "description": "Direction in which to mute audio",
840                                                         "paramType": "query",
841                                                         "required": false,
842                                                         "allowMultiple": false,
843                                                         "dataType": "string",
844                                                         "defaultValue": "both",
845                                                         "allowableValues": {
846                                                                 "valueType": "LIST",
847                                                                 "values": [
848                                                                         "both",
849                                                                         "in",
850                                                                         "out"
851                                                                 ]
852                                                         }
853                                                 }
854                                         ],
855                                         "errorResponses": [
856                                                 {
857                                                         "code": 404,
858                                                         "reason": "Channel not found"
859                                                 },
860                                                 {
861                                                         "code": 409,
862                                                         "reason": "Channel not in a Stasis application"
863                                                 },
864                                                 {
865                                                         "code": 412,
866                                                         "reason": "Channel in invalid state"
867                                                 }
868                                         ]
869                                 },
870                                 {
871                                         "httpMethod": "DELETE",
872                                         "summary": "Unmute a channel.",
873                                         "nickname": "unmute",
874                                         "responseClass": "void",
875                                         "parameters": [
876                                                 {
877                                                         "name": "channelId",
878                                                         "description": "Channel's id",
879                                                         "paramType": "path",
880                                                         "required": true,
881                                                         "allowMultiple": false,
882                                                         "dataType": "string"
883                                                 },
884                                                 {
885                                                         "name": "direction",
886                                                         "description": "Direction in which to unmute audio",
887                                                         "paramType": "query",
888                                                         "required": false,
889                                                         "allowMultiple": false,
890                                                         "dataType": "string",
891                                                         "defaultValue": "both",
892                                                         "allowableValues": {
893                                                                 "valueType": "LIST",
894                                                                 "values": [
895                                                                         "both",
896                                                                         "in",
897                                                                         "out"
898                                                                 ]
899                                                         }
900                                                 }
901                                         ],
902                                         "errorResponses": [
903                                                 {
904                                                         "code": 404,
905                                                         "reason": "Channel not found"
906                                                 },
907                                                 {
908                                                         "code": 409,
909                                                         "reason": "Channel not in a Stasis application"
910                                                 },
911                                                 {
912                                                         "code": 412,
913                                                         "reason": "Channel in invalid state"
914                                                 }
915                                         ]
916                                 }
917                         ]
918                 },
919                 {
920                         "path": "/channels/{channelId}/hold",
921                         "description": "Put a channel on hold",
922                         "operations": [
923                                 {
924                                         "httpMethod": "POST",
925                                         "summary": "Hold a channel.",
926                                         "nickname": "hold",
927                                         "responseClass": "void",
928                                         "parameters": [
929                                                 {
930                                                         "name": "channelId",
931                                                         "description": "Channel's id",
932                                                         "paramType": "path",
933                                                         "required": true,
934                                                         "allowMultiple": false,
935                                                         "dataType": "string"
936                                                 }
937                                         ],
938                                         "errorResponses": [
939                                                 {
940                                                         "code": 404,
941                                                         "reason": "Channel not found"
942                                                 },
943                                                 {
944                                                         "code": 409,
945                                                         "reason": "Channel not in a Stasis application"
946                                                 },
947                                                 {
948                                                         "code": 412,
949                                                         "reason": "Channel in invalid state"
950                                                 }
951                                         ]
952                                 },
953                                 {
954                                         "httpMethod": "DELETE",
955                                         "summary": "Remove a channel from hold.",
956                                         "nickname": "unhold",
957                                         "responseClass": "void",
958                                         "parameters": [
959                                                 {
960                                                         "name": "channelId",
961                                                         "description": "Channel's id",
962                                                         "paramType": "path",
963                                                         "required": true,
964                                                         "allowMultiple": false,
965                                                         "dataType": "string"
966                                                 }
967                                         ],
968                                         "errorResponses": [
969                                                 {
970                                                         "code": 404,
971                                                         "reason": "Channel not found"
972                                                 },
973                                                 {
974                                                         "code": 409,
975                                                         "reason": "Channel not in a Stasis application"
976                                                 },
977                                                 {
978                                                         "code": 412,
979                                                         "reason": "Channel in invalid state"
980                                                 }
981                                         ]
982                                 }
983                         ]
984                 },
985                 {
986                         "path": "/channels/{channelId}/moh",
987                         "description": "Play music on hold to a channel",
988                         "operations": [
989                                 {
990                                         "httpMethod": "POST",
991                                         "summary": "Play music on hold to a channel.",
992                                         "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.",
993                                         "nickname": "startMoh",
994                                         "responseClass": "void",
995                                         "parameters": [
996                                                 {
997                                                         "name": "channelId",
998                                                         "description": "Channel's id",
999                                                         "paramType": "path",
1000                                                         "required": true,
1001                                                         "allowMultiple": false,
1002                                                         "dataType": "string"
1003                                                 },
1004                                                 {
1005                                                         "name": "mohClass",
1006                                                         "description": "Music on hold class to use",
1007                                                         "paramType": "query",
1008                                                         "required": false,
1009                                                         "allowMultiple": false,
1010                                                         "dataType": "string"
1011                                                 }
1012                                         ],
1013                                         "errorResponses": [
1014                                                 {
1015                                                         "code": 404,
1016                                                         "reason": "Channel not found"
1017                                                 },
1018                                                 {
1019                                                         "code": 409,
1020                                                         "reason": "Channel not in a Stasis application"
1021                                                 },
1022                                                 {
1023                                                         "code": 412,
1024                                                         "reason": "Channel in invalid state"
1025                                                 }
1026                                         ]
1027                                 },
1028                                 {
1029                                         "httpMethod": "DELETE",
1030                                         "summary": "Stop playing music on hold to a channel.",
1031                                         "nickname": "stopMoh",
1032                                         "responseClass": "void",
1033                                         "parameters": [
1034                                                 {
1035                                                         "name": "channelId",
1036                                                         "description": "Channel's id",
1037                                                         "paramType": "path",
1038                                                         "required": true,
1039                                                         "allowMultiple": false,
1040                                                         "dataType": "string"
1041                                                 }
1042                                         ],
1043                                         "errorResponses": [
1044                                                 {
1045                                                         "code": 404,
1046                                                         "reason": "Channel not found"
1047                                                 },
1048                                                 {
1049                                                         "code": 409,
1050                                                         "reason": "Channel not in a Stasis application"
1051                                                 },
1052                                                 {
1053                                                         "code": 412,
1054                                                         "reason": "Channel in invalid state"
1055                                                 }
1056                                         ]
1057                                 }
1058                         ]
1059                 },
1060                 {
1061                         "path": "/channels/{channelId}/silence",
1062                         "description": "Play silence to a channel",
1063                         "operations": [
1064                                 {
1065                                         "httpMethod": "POST",
1066                                         "summary": "Play silence to a channel.",
1067                                         "notes": "Using media operations such as /play on a channel playing silence in this manner will suspend silence without resuming automatically.",
1068                                         "nickname": "startSilence",
1069                                         "responseClass": "void",
1070                                         "parameters": [
1071                                                 {
1072                                                         "name": "channelId",
1073                                                         "description": "Channel's id",
1074                                                         "paramType": "path",
1075                                                         "required": true,
1076                                                         "allowMultiple": false,
1077                                                         "dataType": "string"
1078                                                 }
1079                                         ],
1080                                         "errorResponses": [
1081                                                 {
1082                                                         "code": 404,
1083                                                         "reason": "Channel not found"
1084                                                 },
1085                                                 {
1086                                                         "code": 409,
1087                                                         "reason": "Channel not in a Stasis application"
1088                                                 },
1089                                                 {
1090                                                         "code": 412,
1091                                                         "reason": "Channel in invalid state"
1092                                                 }
1093                                         ]
1094                                 },
1095                                 {
1096                                         "httpMethod": "DELETE",
1097                                         "summary": "Stop playing silence to a channel.",
1098                                         "nickname": "stopSilence",
1099                                         "responseClass": "void",
1100                                         "parameters": [
1101                                                 {
1102                                                         "name": "channelId",
1103                                                         "description": "Channel's id",
1104                                                         "paramType": "path",
1105                                                         "required": true,
1106                                                         "allowMultiple": false,
1107                                                         "dataType": "string"
1108                                                 }
1109                                         ],
1110                                         "errorResponses": [
1111                                                 {
1112                                                         "code": 404,
1113                                                         "reason": "Channel not found"
1114                                                 },
1115                                                 {
1116                                                         "code": 409,
1117                                                         "reason": "Channel not in a Stasis application"
1118                                                 },
1119                                                 {
1120                                                         "code": 412,
1121                                                         "reason": "Channel in invalid state"
1122                                                 }
1123                                         ]
1124                                 }
1125                         ]
1126                 },
1127                 {
1128                         "path": "/channels/{channelId}/play",
1129                         "description": "Play media to a channel",
1130                         "operations": [
1131                                 {
1132                                         "httpMethod": "POST",
1133                                         "summary": "Start playback of media.",
1134                                         "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.)",
1135                                         "nickname": "play",
1136                                         "responseClass": "Playback",
1137                                         "parameters": [
1138                                                 {
1139                                                         "name": "channelId",
1140                                                         "description": "Channel's id",
1141                                                         "paramType": "path",
1142                                                         "required": true,
1143                                                         "allowMultiple": false,
1144                                                         "dataType": "string"
1145                                                 },
1146                                                 {
1147                                                         "name": "media",
1148                                                         "description": "Media URIs to play.",
1149                                                         "paramType": "query",
1150                                                         "required": true,
1151                                                         "allowMultiple": true,
1152                                                         "dataType": "string"
1153                                                 },
1154                                                 {
1155                                                         "name": "lang",
1156                                                         "description": "For sounds, selects language for sound.",
1157                                                         "paramType": "query",
1158                                                         "required": false,
1159                                                         "allowMultiple": false,
1160                                                         "dataType": "string"
1161                                                 },
1162                                                 {
1163                                                         "name": "offsetms",
1164                                                         "description": "Number of milliseconds to skip before playing. Only applies to the first URI if multiple media URIs are specified.",
1165                                                         "paramType": "query",
1166                                                         "required": false,
1167                                                         "allowMultiple": false,
1168                                                         "dataType": "int"
1169                                                 },
1170                                                 {
1171                                                         "name": "skipms",
1172                                                         "description": "Number of milliseconds to skip for forward/reverse operations.",
1173                                                         "paramType": "query",
1174                                                         "required": false,
1175                                                         "allowMultiple": false,
1176                                                         "dataType": "int",
1177                                                         "defaultValue": 3000
1178                                                 },
1179                                                 {
1180                                                         "name": "playbackId",
1181                                                         "description": "Playback ID.",
1182                                                         "paramType": "query",
1183                                                         "required": false,
1184                                                         "allowMultiple": false,
1185                                                         "dataType": "string"
1186                                                 }
1187                                         ],
1188                                         "errorResponses": [
1189                                                 {
1190                                                         "code": 404,
1191                                                         "reason": "Channel not found"
1192                                                 },
1193                                                 {
1194                                                         "code": 409,
1195                                                         "reason": "Channel not in a Stasis application"
1196                                                 },
1197                                                 {
1198                                                         "code": 412,
1199                                                         "reason": "Channel in invalid state"
1200                                                 }
1201                                         ]
1202                                 }
1203                         ]
1204                 },
1205                 {
1206                         "path": "/channels/{channelId}/play/{playbackId}",
1207                         "description": "Play media to a channel",
1208                         "operations": [
1209                                 {
1210                                         "httpMethod": "POST",
1211                                         "summary": "Start playback of media and specify the playbackId.",
1212                                         "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.)",
1213                                         "nickname": "playWithId",
1214                                         "responseClass": "Playback",
1215                                         "parameters": [
1216                                                 {
1217                                                         "name": "channelId",
1218                                                         "description": "Channel's id",
1219                                                         "paramType": "path",
1220                                                         "required": true,
1221                                                         "allowMultiple": false,
1222                                                         "dataType": "string"
1223                                                 },
1224                                                 {
1225                                                         "name": "playbackId",
1226                                                         "description": "Playback ID.",
1227                                                         "paramType": "path",
1228                                                         "required": true,
1229                                                         "allowMultiple": false,
1230                                                         "dataType": "string"
1231                                                 },
1232                                                 {
1233                                                         "name": "media",
1234                                                         "description": "Media URIs to play.",
1235                                                         "paramType": "query",
1236                                                         "required": true,
1237                                                         "allowMultiple": true,
1238                                                         "dataType": "string"
1239                                                 },
1240                                                 {
1241                                                         "name": "lang",
1242                                                         "description": "For sounds, selects language for sound.",
1243                                                         "paramType": "query",
1244                                                         "required": false,
1245                                                         "allowMultiple": false,
1246                                                         "dataType": "string"
1247                                                 },
1248                                                 {
1249                                                         "name": "offsetms",
1250                                                         "description": "Number of milliseconds to skip before playing. Only applies to the first URI if multiple media URIs are specified.",
1251                                                         "paramType": "query",
1252                                                         "required": false,
1253                                                         "allowMultiple": false,
1254                                                         "dataType": "int"
1255                                                 },
1256                                                 {
1257                                                         "name": "skipms",
1258                                                         "description": "Number of milliseconds to skip for forward/reverse operations.",
1259                                                         "paramType": "query",
1260                                                         "required": false,
1261                                                         "allowMultiple": false,
1262                                                         "dataType": "int",
1263                                                         "defaultValue": 3000
1264                                                 }
1265                                         ],
1266                                         "errorResponses": [
1267                                                 {
1268                                                         "code": 404,
1269                                                         "reason": "Channel not found"
1270                                                 },
1271                                                 {
1272                                                         "code": 409,
1273                                                         "reason": "Channel not in a Stasis application"
1274                                                 },
1275                                                 {
1276                                                         "code": 412,
1277                                                         "reason": "Channel in invalid state"
1278                                                 }
1279                                         ]
1280                                 }
1281                         ]
1282                 },
1283                 {
1284                         "path": "/channels/{channelId}/record",
1285                         "description": "Record audio from a channel",
1286                         "operations": [
1287                                 {
1288                                         "httpMethod": "POST",
1289                                         "summary": "Start a recording.",
1290                                         "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.",
1291                                         "nickname": "record",
1292                                         "responseClass": "LiveRecording",
1293                                         "parameters": [
1294                                                 {
1295                                                         "name": "channelId",
1296                                                         "description": "Channel's id",
1297                                                         "paramType": "path",
1298                                                         "required": true,
1299                                                         "allowMultiple": false,
1300                                                         "dataType": "string"
1301                                                 },
1302                                                 {
1303                                                         "name": "name",
1304                                                         "description": "Recording's filename",
1305                                                         "paramType": "query",
1306                                                         "required": true,
1307                                                         "allowMultiple": false,
1308                                                         "dataType": "string"
1309                                                 },
1310                                                 {
1311                                                         "name": "format",
1312                                                         "description": "Format to encode audio in",
1313                                                         "paramType": "query",
1314                                                         "required": true,
1315                                                         "allowMultiple": false,
1316                                                         "dataType": "string"
1317                                                 },
1318                                                 {
1319                                                         "name": "maxDurationSeconds",
1320                                                         "description": "Maximum duration of the recording, in seconds. 0 for no limit",
1321                                                         "paramType": "query",
1322                                                         "required": false,
1323                                                         "allowMultiple": false,
1324                                                         "dataType": "int",
1325                                                         "defaultValue": 0,
1326                                                         "allowableValues": {
1327                                                                 "valueType": "RANGE",
1328                                                                 "min": 0
1329                                                         }
1330                                                 },
1331                                                 {
1332                                                         "name": "maxSilenceSeconds",
1333                                                         "description": "Maximum duration of silence, in seconds. 0 for no limit",
1334                                                         "paramType": "query",
1335                                                         "required": false,
1336                                                         "allowMultiple": false,
1337                                                         "dataType": "int",
1338                                                         "defaultValue": 0,
1339                                                         "allowableValues": {
1340                                                                 "valueType": "RANGE",
1341                                                                 "min": 0
1342                                                         }
1343                                                 },
1344                                                 {
1345                                                         "name": "ifExists",
1346                                                         "description": "Action to take if a recording with the same name already exists.",
1347                                                         "paramType": "query",
1348                                                         "required": false,
1349                                                         "allowMultiple": false,
1350                                                         "dataType": "string",
1351                                                         "defaultValue": "fail",
1352                                                         "allowableValues": {
1353                                                                 "valueType": "LIST",
1354                                                                 "values": [
1355                                                                         "fail",
1356                                                                         "overwrite",
1357                                                                         "append"
1358                                                                 ]
1359                                                         }
1360                                                 },
1361                                                 {
1362                                                         "name": "beep",
1363                                                         "description": "Play beep when recording begins",
1364                                                         "paramType": "query",
1365                                                         "required": false,
1366                                                         "allowMultiple": false,
1367                                                         "dataType": "boolean",
1368                                                         "defaultValue": false
1369                                                 },
1370                                                 {
1371                                                         "name": "terminateOn",
1372                                                         "description": "DTMF input to terminate recording",
1373                                                         "paramType": "query",
1374                                                         "required": false,
1375                                                         "allowMultiple": false,
1376                                                         "dataType": "string",
1377                                                         "defaultValue": "none",
1378                                                         "allowableValues": {
1379                                                                 "valueType": "LIST",
1380                                                                 "values": [
1381                                                                         "none",
1382                                                                         "any",
1383                                                                         "*",
1384                                                                         "#"
1385                                                                 ]
1386                                                         }
1387                                                 }
1388                                         ],
1389                                         "errorResponses": [
1390                                                 {
1391                                                         "code": 400,
1392                                                         "reason": "Invalid parameters"
1393                                                 },
1394                                                 {
1395                                                         "code": 404,
1396                                                         "reason": "Channel not found"
1397                                                 },
1398                                                 {
1399                                                         "code": 409,
1400                                                         "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"
1401                                                 },
1402                                                 {
1403                                                         "code": 422,
1404                                                         "reason": "The format specified is unknown on this system"
1405                                                 }
1406                                         ]
1407                                 }
1408                         ]
1409                 },
1410                 {
1411                         "path": "/channels/{channelId}/variable",
1412                         "description": "Variables on a channel",
1413                         "operations": [
1414                                 {
1415                                         "httpMethod": "GET",
1416                                         "summary": "Get the value of a channel variable or function.",
1417                                         "nickname": "getChannelVar",
1418                                         "responseClass": "Variable",
1419                                         "parameters": [
1420                                                 {
1421                                                         "name": "channelId",
1422                                                         "description": "Channel's id",
1423                                                         "paramType": "path",
1424                                                         "required": true,
1425                                                         "allowMultiple": false,
1426                                                         "dataType": "string"
1427                                                 },
1428                                                 {
1429                                                         "name": "variable",
1430                                                         "description": "The channel variable or function to get",
1431                                                         "paramType": "query",
1432                                                         "required": true,
1433                                                         "allowMultiple": false,
1434                                                         "dataType": "string"
1435                                                 }
1436                                         ],
1437                                         "errorResponses": [
1438                                                 {
1439                                                         "code": 400,
1440                                                         "reason": "Missing variable parameter."
1441                                                 },
1442                                                 {
1443                                                         "code": 404,
1444                                                         "reason": "Channel or variable not found"
1445                                                 },
1446                                                 {
1447                                                         "code": 409,
1448                                                         "reason": "Channel not in a Stasis application"
1449                                                 }
1450                                         ]
1451                                 },
1452                                 {
1453                                         "httpMethod": "POST",
1454                                         "summary": "Set the value of a channel variable or function.",
1455                                         "nickname": "setChannelVar",
1456                                         "responseClass": "void",
1457                                         "parameters": [
1458                                                 {
1459                                                         "name": "channelId",
1460                                                         "description": "Channel's id",
1461                                                         "paramType": "path",
1462                                                         "required": true,
1463                                                         "allowMultiple": false,
1464                                                         "dataType": "string"
1465                                                 },
1466                                                 {
1467                                                         "name": "variable",
1468                                                         "description": "The channel variable or function to set",
1469                                                         "paramType": "query",
1470                                                         "required": true,
1471                                                         "allowMultiple": false,
1472                                                         "dataType": "string"
1473                                                 },
1474                                                 {
1475                                                         "name": "value",
1476                                                         "description": "The value to set the variable to",
1477                                                         "paramType": "query",
1478                                                         "required": false,
1479                                                         "allowMultiple": false,
1480                                                         "dataType": "string"
1481                                                 }
1482                                         ],
1483                                         "errorResponses": [
1484                                                 {
1485                                                         "code": 400,
1486                                                         "reason": "Missing variable parameter."
1487                                                 },
1488                                                 {
1489                                                         "code": 404,
1490                                                         "reason": "Channel not found"
1491                                                 },
1492                                                 {
1493                                                         "code": 409,
1494                                                         "reason": "Channel not in a Stasis application"
1495                                                 }
1496                                         ]
1497                                 }
1498                         ]
1499                 },
1500                 {
1501                         "path": "/channels/{channelId}/snoop",
1502                         "description": "Snoop (spy/whisper) on a channel",
1503                         "operations": [
1504                                 {
1505                                         "httpMethod": "POST",
1506                                         "summary": "Start snooping.",
1507                                         "notes": "Snoop (spy/whisper) on a specific channel.",
1508                                         "nickname": "snoopChannel",
1509                                         "responseClass": "Channel",
1510                                         "parameters": [
1511                                                 {
1512                                                         "name": "channelId",
1513                                                         "description": "Channel's id",
1514                                                         "paramType": "path",
1515                                                         "required": true,
1516                                                         "allowMultiple": false,
1517                                                         "dataType": "string"
1518                                                 },
1519                                                 {
1520                                                         "name": "spy",
1521                                                         "description": "Direction of audio to spy on",
1522                                                         "paramType": "query",
1523                                                         "required": false,
1524                                                         "allowMultiple": false,
1525                                                         "dataType": "string",
1526                                                         "defaultValue": "none",
1527                                                         "allowableValues": {
1528                                                                 "valueType": "LIST",
1529                                                                 "values": [
1530                                                                         "none",
1531                                                                         "both",
1532                                                                         "out",
1533                                                                         "in"
1534                                                                 ]
1535                                                         }
1536                                                 },
1537                                                 {
1538                                                         "name": "whisper",
1539                                                         "description": "Direction of audio to whisper into",
1540                                                         "paramType": "query",
1541                                                         "required": false,
1542                                                         "allowMultiple": false,
1543                                                         "dataType": "string",
1544                                                         "defaultValue": "none",
1545                                                         "allowableValues": {
1546                                                                 "valueType": "LIST",
1547                                                                 "values": [
1548                                                                         "none",
1549                                                                         "both",
1550                                                                         "out",
1551                                                                         "in"
1552                                                                 ]
1553                                                         }
1554                                                 },
1555                                                 {
1556                                                         "name": "app",
1557                                                         "description": "Application the snooping channel is placed into",
1558                                                         "paramType": "query",
1559                                                         "required": true,
1560                                                         "allowMultiple": false,
1561                                                         "dataType": "string"
1562                                                 },
1563                                                 {
1564                                                         "name": "appArgs",
1565                                                         "description": "The application arguments to pass to the Stasis application",
1566                                                         "paramType": "query",
1567                                                         "required": false,
1568                                                         "allowMultiple": false,
1569                                                         "dataType": "string"
1570                                                 },
1571                                                 {
1572                                                         "name": "snoopId",
1573                                                         "description": "Unique ID to assign to snooping channel",
1574                                                         "paramType": "query",
1575                                                         "required": false,
1576                                                         "allowMultiple": false,
1577                                                         "dataType": "string"
1578                                                 }
1579                                         ],
1580                                         "errorResponses": [
1581                                                 {
1582                                                         "code": 400,
1583                                                         "reason": "Invalid parameters"
1584                                                 },
1585                                                 {
1586                                                         "code": 404,
1587                                                         "reason": "Channel not found"
1588                                                 }
1589                                         ]
1590                                 }
1591                         ]
1592                 },
1593                 {
1594                         "path": "/channels/{channelId}/snoop/{snoopId}",
1595                         "description": "Snoop (spy/whisper) on a channel",
1596                         "operations": [
1597                                 {
1598                                         "httpMethod": "POST",
1599                                         "summary": "Start snooping.",
1600                                         "notes": "Snoop (spy/whisper) on a specific channel.",
1601                                         "nickname": "snoopChannelWithId",
1602                                         "responseClass": "Channel",
1603                                         "parameters": [
1604                                                 {
1605                                                         "name": "channelId",
1606                                                         "description": "Channel's id",
1607                                                         "paramType": "path",
1608                                                         "required": true,
1609                                                         "allowMultiple": false,
1610                                                         "dataType": "string"
1611                                                 },
1612                                                 {
1613                                                         "name": "snoopId",
1614                                                         "description": "Unique ID to assign to snooping channel",
1615                                                         "paramType": "path",
1616                                                         "required": true,
1617                                                         "allowMultiple": false,
1618                                                         "dataType": "string"
1619                                                 },
1620                                                 {
1621                                                         "name": "spy",
1622                                                         "description": "Direction of audio to spy on",
1623                                                         "paramType": "query",
1624                                                         "required": false,
1625                                                         "allowMultiple": false,
1626                                                         "dataType": "string",
1627                                                         "defaultValue": "none",
1628                                                         "allowableValues": {
1629                                                                 "valueType": "LIST",
1630                                                                 "values": [
1631                                                                         "none",
1632                                                                         "both",
1633                                                                         "out",
1634                                                                         "in"
1635                                                                 ]
1636                                                         }
1637                                                 },
1638                                                 {
1639                                                         "name": "whisper",
1640                                                         "description": "Direction of audio to whisper into",
1641                                                         "paramType": "query",
1642                                                         "required": false,
1643                                                         "allowMultiple": false,
1644                                                         "dataType": "string",
1645                                                         "defaultValue": "none",
1646                                                         "allowableValues": {
1647                                                                 "valueType": "LIST",
1648                                                                 "values": [
1649                                                                         "none",
1650                                                                         "both",
1651                                                                         "out",
1652                                                                         "in"
1653                                                                 ]
1654                                                         }
1655                                                 },
1656                                                 {
1657                                                         "name": "app",
1658                                                         "description": "Application the snooping channel is placed into",
1659                                                         "paramType": "query",
1660                                                         "required": true,
1661                                                         "allowMultiple": false,
1662                                                         "dataType": "string"
1663                                                 },
1664                                                 {
1665                                                         "name": "appArgs",
1666                                                         "description": "The application arguments to pass to the Stasis application",
1667                                                         "paramType": "query",
1668                                                         "required": false,
1669                                                         "allowMultiple": false,
1670                                                         "dataType": "string"
1671                                                 }
1672                                         ],
1673                                         "errorResponses": [
1674                                                 {
1675                                                         "code": 400,
1676                                                         "reason": "Invalid parameters"
1677                                                 },
1678                                                 {
1679                                                         "code": 404,
1680                                                         "reason": "Channel not found"
1681                                                 }
1682                                         ]
1683                                 }
1684                         ]
1685                 },
1686                 {
1687                         "path": "/channels/{channelId}/dial",
1688                         "description": "Dial a channel",
1689                         "operations": [
1690                                 {
1691                                         "httpMethod": "POST",
1692                                         "summary": "Dial a created channel.",
1693                                         "nickname": "dial",
1694                                         "responseClass": "void",
1695                                         "parameters": [
1696                                                 {
1697                                                         "name": "channelId",
1698                                                         "description": "Channel's id",
1699                                                         "paramType": "path",
1700                                                         "required": true,
1701                                                         "allowMultiple": false,
1702                                                         "dataType": "string"
1703                                                 },
1704                                                 {
1705                                                         "name": "caller",
1706                                                         "description": "Channel ID of caller",
1707                                                         "paramType": "query",
1708                                                         "required": false,
1709                                                         "allowMultiple": false,
1710                                                         "dataType": "string"
1711                                                 },
1712                                                 {
1713                                                         "name": "timeout",
1714                                                         "description": "Dial timeout",
1715                                                         "paramType": "query",
1716                                                         "required": false,
1717                                                         "allowMultiple": false,
1718                                                         "dataType": "int",
1719                                                         "defaultValue": 0,
1720                                                         "allowableValues": {
1721                                                                 "valueType": "RANGE",
1722                                                                 "min": 0
1723                                                         }
1724                                                 }
1725                                         ],
1726                                         "errorResponses": [
1727                                                 {
1728                                                         "code": 404,
1729                                                         "reason": "Channel cannot be found."
1730                                                 },
1731                                                 {
1732                                                         "code": 409,
1733                                                         "reason": "Channel cannot be dialed."
1734                                                 }
1735                                         ]
1736                                 }
1737                         ]
1738                 },
1739                 {
1740                         "path": "/channels/{channelId}/rtp_statistics",
1741                         "description": "Get RTP statistics information for RTP on a channel",
1742                         "operations": [
1743                                 {
1744                                         "httpMethod": "GET",
1745                                         "summary": "RTP stats on a channel.",
1746                                         "nickname": "rtpstatistics",
1747                                         "responseClass": "RTPstat",
1748                                         "parameters": [
1749                                                 {
1750                                                         "name": "channelId",
1751                                                         "description": "Channel's id",
1752                                                         "paramType": "path",
1753                                                         "required": true,
1754                                                         "allowMultiple": false,
1755                                                         "dataType": "string"
1756                                                 }
1757                                         ],
1758                                         "errorResponses": [
1759                                                 {
1760                                                         "code": 404,
1761                                                         "reason": "Channel cannot be found."
1762                                                 }
1763                                         ]
1764                                 }
1765                         ]
1766                 },
1767                 {
1768                         "path": "/channels/externalMedia",
1769                         "description": "Create a channel to an External Media source/sink.",
1770                         "operations": [
1771                                 {
1772                                         "httpMethod": "POST",
1773                                         "summary": "Start an External Media session.",
1774                                         "notes": "Create a channel to an External Media source/sink.",
1775                                         "nickname": "externalMedia",
1776                                         "responseClass": "Channel",
1777                                         "parameters": [
1778                                                 {
1779                                                         "name": "channelId",
1780                                                         "description": "The unique id to assign the channel on creation.",
1781                                                         "paramType": "query",
1782                                                         "required": false,
1783                                                         "allowMultiple": false,
1784                                                         "dataType": "string"
1785                                                 },
1786                                                 {
1787                                                         "name": "app",
1788                                                         "description": "Stasis Application to place channel into",
1789                                                         "paramType": "query",
1790                                                         "required": true,
1791                                                         "allowMultiple": false,
1792                                                         "dataType": "string"
1793                                                 },
1794                                                 {
1795                                                         "name": "variables",
1796                                                         "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\" } }",
1797                                                         "paramType": "body",
1798                                                         "required": false,
1799                                                         "dataType": "containers",
1800                                                         "allowMultiple": false
1801                                                 },
1802                                                 {
1803                                                         "name": "external_host",
1804                                                         "description": "Hostname/ip:port of external host",
1805                                                         "paramType": "query",
1806                                                         "required": true,
1807                                                         "allowMultiple": false,
1808                                                         "dataType": "string"
1809                                                 },
1810                                                 {
1811                                                         "name": "encapsulation",
1812                                                         "description": "Payload encapsulation protocol",
1813                                                         "paramType": "query",
1814                                                         "required": false,
1815                                                         "allowMultiple": false,
1816                                                         "dataType": "string",
1817                                                         "defaultValue": "rtp",
1818                                                         "allowableValues": {
1819                                                                 "valueType": "LIST",
1820                                                                 "values": [
1821                                                                         "rtp",
1822                                                                         "audiosocket"
1823                                                                 ]
1824                                                         }
1825                                                 },
1826                                                 {
1827                                                         "name": "transport",
1828                                                         "description": "Transport protocol",
1829                                                         "paramType": "query",
1830                                                         "required": false,
1831                                                         "allowMultiple": false,
1832                                                         "dataType": "string",
1833                                                         "defaultValue": "udp",
1834                                                         "allowableValues": {
1835                                                                 "valueType": "LIST",
1836                                                                 "values": [
1837                                                                         "udp",
1838                                                                         "tcp"
1839                                                                 ]
1840                                                         }
1841                                                 },
1842                                                 {
1843                                                         "name": "connection_type",
1844                                                         "description": "Connection type (client/server)",
1845                                                         "paramType": "query",
1846                                                         "required": false,
1847                                                         "allowMultiple": false,
1848                                                         "dataType": "string",
1849                                                         "defaultValue": "client",
1850                                                         "allowableValues": {
1851                                                                 "valueType": "LIST",
1852                                                                 "values": [
1853                                                                         "client"
1854                                                                 ]
1855                                                         }
1856                                                 },
1857                                                 {
1858                                                         "name": "format",
1859                                                         "description": "Format to encode audio in",
1860                                                         "paramType": "query",
1861                                                         "required": true,
1862                                                         "allowMultiple": false,
1863                                                         "dataType": "string"
1864                                                 },
1865                                                 {
1866                                                         "name": "direction",
1867                                                         "description": "External media direction",
1868                                                         "paramType": "query",
1869                                                         "required": false,
1870                                                         "allowMultiple": false,
1871                                                         "dataType": "string",
1872                                                         "defaultValue": "both",
1873                                                         "allowableValues": {
1874                                                                 "valueType": "LIST",
1875                                                                 "values": [
1876                                                                         "both"
1877                                                                 ]
1878                                                         }
1879                                                 },
1880                                                 {
1881                                                         "name": "data",
1882                                                         "description": "An arbitrary data field",
1883                                                         "paramType": "query",
1884                                                         "required": false,
1885                                                         "allowMultiple": false,
1886                                                         "dataType": "string"
1887                                                 }
1888                                         ],
1889                                         "errorResponses": [
1890                                                 {
1891                                                         "code": 400,
1892                                                         "reason": "Invalid parameters"
1893                                                 },
1894                                                 {
1895                                                         "code": 409,
1896                                                         "reason": "Channel is not in a Stasis application; Channel is already bridged"
1897                                                 }
1898                                         ]
1899                                 }
1900                         ]
1901                 }
1902         ],
1903         "models": {
1904                 "Dialed": {
1905                         "id": "Dialed",
1906                         "description": "Dialed channel information.",
1907                         "properties": {}
1908                 },
1909                 "DialplanCEP": {
1910                         "id": "DialplanCEP",
1911                         "description": "Dialplan location (context/extension/priority)",
1912                         "properties": {
1913                                 "context": {
1914                                         "required": true,
1915                                         "type": "string",
1916                                         "description": "Context in the dialplan"
1917                                 },
1918                                 "exten": {
1919                                         "required": true,
1920                                         "type": "string",
1921                                         "description": "Extension in the dialplan"
1922                                 },
1923                                 "priority": {
1924                                         "required": true,
1925                                         "type": "long",
1926                                         "description": "Priority in the dialplan"
1927                                 },
1928                                 "app_name": {
1929                                         "required": true,
1930                                         "type": "string",
1931                                         "description": "Name of current dialplan application"
1932                                 },
1933                                 "app_data": {
1934                                         "required": true,
1935                                         "type": "string",
1936                                         "description": "Parameter of current dialplan application"
1937                                 }
1938                         }
1939                 },
1940                 "CallerID": {
1941                         "id": "CallerID",
1942                         "description": "Caller identification",
1943                         "properties": {
1944                                 "name": {
1945                                         "required": true,
1946                                         "type": "string"
1947                                 },
1948                                 "number": {
1949                                         "required": true,
1950                                         "type": "string"
1951                                 }
1952                         }
1953                 },
1954                 "RTPstat": {
1955                         "id": "RTPstat",
1956                         "description": "A statistics of a RTP.",
1957                         "properties": {
1958                                 "txcount": {
1959                                         "required": true,
1960                                         "type": "int",
1961                                         "description": "Number of packets transmitted."
1962                                 },
1963                                 "rxcount": {
1964                                         "required": true,
1965                                         "type": "int",
1966                                         "description": "Number of packets received."
1967                                 },
1968                                 "txjitter": {
1969                                         "required": false,
1970                                         "type": "double",
1971                                         "description": "Jitter on transmitted packets."
1972                                 },
1973                                 "rxjitter": {
1974                                         "required": false,
1975                                         "type": "double",
1976                                         "description": "Jitter on received packets."
1977         &n