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