2 "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.",
3 "_author": "David M. Lee, II <dlee@digium.com>",
4 "_svn_revision": "$Revision$",
6 "swaggerVersion": "1.1",
7 "basePath": "http://localhost:8088/stasis",
8 "resourcePath": "/api-docs/channels.{format}",
12 "description": "Active channels",
16 "summary": "List all active channels in Asterisk.",
17 "nickname": "getChannels",
18 "responseClass": "List[Channel]"
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",
29 "description": "Endpoint to call.",
32 "allowMultiple": false,
37 "description": "The extension to dial after the endpoint answers",
40 "allowMultiple": false,
45 "description": "The context to dial after the endpoint answers. If omitted, uses 'default'",
48 "allowMultiple": false,
53 "description": "The priority to dial after the endpoint answers. If omitted, uses 1",
56 "allowMultiple": false,
61 "description": "The application that is subscribed to the originated channel, and passed to the Stasis application.",
64 "allowMultiple": false,
69 "description": "The application arguments to pass to the Stasis application.",
72 "allowMultiple": false,
77 "description": "CallerID to use when dialing the endpoint or extension.",
80 "allowMultiple": false,
85 "description": "Timeout (in seconds) before giving up dialing, or -1 for no timeout.",
88 "allowMultiple": false,
96 "reason": "Invalid parameters for originating a channel."
103 "path": "/channels/{channelId}",
104 "description": "Active channel",
108 "summary": "Channel details.",
109 "nickname": "getChannel",
110 "responseClass": "Channel",
114 "description": "Channel's id",
117 "allowMultiple": false,
124 "reason": "Channel not found"
129 "httpMethod": "DELETE",
130 "summary": "Delete (i.e. hangup) a channel.",
131 "nickname": "deleteChannel",
132 "responseClass": "void",
136 "description": "Channel's id",
139 "allowMultiple": false,
146 "reason": "Channel not found"
153 "path": "/channels/{channelId}/continue",
154 "description": "Exit application; continue execution in the dialplan",
157 "httpMethod": "POST",
158 "summary": "Exit application; continue execution in the dialplan.",
159 "nickname": "continueInDialplan",
160 "responseClass": "void",
164 "description": "Channel's id",
167 "allowMultiple": false,
172 "description": "The context to continue to.",
173 "paramType": "query",
175 "allowMultiple": false,
180 "description": "The extension to continue to.",
181 "paramType": "query",
183 "allowMultiple": false,
188 "description": "The priority to continue to.",
189 "paramType": "query",
191 "allowMultiple": false,
198 "reason": "Channel not found"
202 "reason": "Channel not in a Stasis application"
209 "path": "/channels/{channelId}/answer",
210 "description": "Answer a channel",
213 "httpMethod": "POST",
214 "summary": "Answer a channel.",
215 "nickname": "answerChannel",
216 "responseClass": "void",
220 "description": "Channel's id",
223 "allowMultiple": false,
230 "reason": "Channel not found"
234 "reason": "Channel not in a Stasis application"
241 "path": "/channels/{channelId}/mute",
242 "description": "Mute a channel",
245 "httpMethod": "POST",
246 "summary": "Mute a channel.",
247 "nickname": "muteChannel",
248 "responseClass": "void",
252 "description": "Channel's id",
255 "allowMultiple": false,
260 "description": "Direction in which to mute audio",
261 "paramType": "query",
263 "allowMultiple": false,
264 "dataType": "string",
265 "defaultValue": "both",
279 "reason": "Channel not found"
283 "reason": "Channel not in a Stasis application"
290 "path": "/channels/{channelId}/unmute",
291 "description": "Unmute a channel",
294 "httpMethod": "POST",
295 "summary": "Unmute a channel.",
296 "nickname": "unmuteChannel",
297 "responseClass": "void",
301 "description": "Channel's id",
304 "allowMultiple": false,
309 "description": "Direction in which to unmute audio",
310 "paramType": "query",
312 "allowMultiple": false,
313 "dataType": "string",
314 "defaultValue": "both",
328 "reason": "Channel not found"
332 "reason": "Channel not in a Stasis application"
339 "path": "/channels/{channelId}/hold",
340 "description": "Put a channel on hold",
343 "httpMethod": "POST",
344 "summary": "Hold a channel.",
345 "nickname": "holdChannel",
346 "responseClass": "void",
350 "description": "Channel's id",
353 "allowMultiple": false,
360 "reason": "Channel not found"
364 "reason": "Channel not in a Stasis application"
371 "path": "/channels/{channelId}/hold",
372 "description": "Remove a channel from hold",
375 "httpMethod": "DELETE",
376 "summary": "Remove a channel from hold.",
377 "nickname": "unholdChannel",
378 "responseClass": "void",
382 "description": "Channel's id",
385 "allowMultiple": false,
392 "reason": "Channel not found"
396 "reason": "Channel not in a Stasis application"
403 "path": "/channels/{channelId}/moh",
404 "description": "Play music on hold to a channel",
407 "httpMethod": "POST",
408 "summary": "Play music on hold to a channel.",
409 "notes": "Using media operations such as playOnChannel 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.",
410 "nickname": "mohStartChannel",
411 "responseClass": "void",
415 "description": "Channel's id",
418 "allowMultiple": false,
423 "description": "Music on hold class to use",
424 "paramType": "query",
426 "allowMultiple": false,
433 "reason": "Channel not found"
437 "reason": "Channel not in a Stasis application"
444 "path": "/channels/{channelId}/moh",
445 "description": "Stop playing music on hold to a channel",
448 "httpMethod": "DELETE",
449 "summary": "Stop playing music on hold to a channel.",
450 "nickname": "mohStopChannel",
451 "responseClass": "void",
455 "description": "Channel's id",
458 "allowMultiple": false,
465 "reason": "Channel not found"
469 "reason": "Channel not in a Stasis application"
476 "path": "/channels/{channelId}/play",
477 "description": "Play media to a channel",
480 "httpMethod": "POST",
481 "summary": "Start playback of media.",
482 "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.)",
483 "nickname": "playOnChannel",
484 "responseClass": "Playback",
488 "description": "Channel's id",
491 "allowMultiple": false,
496 "description": "Media's URI to play.",
497 "paramType": "query",
499 "allowMultiple": false,
504 "description": "For sounds, selects language for sound.",
505 "paramType": "query",
507 "allowMultiple": false,
512 "description": "Number of media to skip before playing.",
513 "paramType": "query",
515 "allowMultiple": false,
520 "description": "Number of milliseconds to skip for forward/reverse operations.",
521 "paramType": "query",
523 "allowMultiple": false,
531 "reason": "Channel not found"
535 "reason": "Channel not in a Stasis application"
542 "path": "/channels/{channelId}/record",
543 "description": "Record audio from a channel",
546 "httpMethod": "POST",
547 "summary": "Start a recording.",
548 "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.",
549 "nickname": "recordChannel",
550 "responseClass": "LiveRecording",
554 "description": "Channel's id",
557 "allowMultiple": false,
562 "description": "Recording's filename",
563 "paramType": "query",
565 "allowMultiple": false,
570 "description": "Format to encode audio in",
571 "paramType": "query",
573 "allowMultiple": false,
577 "name": "maxDurationSeconds",
578 "description": "Maximum duration of the recording, in seconds. 0 for no limit",
579 "paramType": "query",
581 "allowMultiple": false,
585 "valueType": "RANGE",
590 "name": "maxSilenceSeconds",
591 "description": "Maximum duration of silence, in seconds. 0 for no limit",
592 "paramType": "query",
594 "allowMultiple": false,
598 "valueType": "RANGE",
604 "description": "Action to take if a recording with the same name already exists.",
605 "paramType": "query",
607 "allowMultiple": false,
608 "dataType": "string",
609 "defaultValue": "fail",
621 "description": "Play beep when recording begins",
622 "paramType": "query",
624 "allowMultiple": false,
625 "dataType": "boolean",
626 "defaultValue": false
629 "name": "terminateOn",
630 "description": "DTMF input to terminate recording",
631 "paramType": "query",
633 "allowMultiple": false,
634 "dataType": "string",
635 "defaultValue": "none",
650 "reason": "Invalid parameters"
654 "reason": "Channel not found"
658 "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"
662 "reason": "The format specified is unknown on this system"
669 "path": "/channels/{channelId}/variable",
670 "description": "Variables on a channel",
674 "summary": "Get the value of a channel variable or function.",
675 "nickname": "getChannelVar",
676 "responseClass": "Variable",
680 "description": "Channel's id",
683 "allowMultiple": false,
688 "description": "The channel variable or function to get",
689 "paramType": "query",
691 "allowMultiple": false,
698 "reason": "Missing variable parameter."
702 "reason": "Channel not found"
706 "reason": "Channel not in a Stasis application"
711 "httpMethod": "POST",
712 "summary": "Set the value of a channel variable or function.",
713 "nickname": "setChannelVar",
714 "responseClass": "void",
718 "description": "Channel's id",
721 "allowMultiple": false,
726 "description": "The channel variable or function to set",
727 "paramType": "query",
729 "allowMultiple": false,
734 "description": "The value to set the variable to",
735 "paramType": "query",
737 "allowMultiple": false,
744 "reason": "Missing variable parameter."
748 "reason": "Channel not found"
752 "reason": "Channel not in a Stasis application"
762 "description": "Dialed channel information.",
767 "description": "Dialplan location (context/extension/priority)",
772 "description": "Context in the dialplan"
777 "description": "Extension in the dialplan"
782 "description": "Priority in the dialplan"
788 "description": "Caller identification",
802 "description": "A specific communication connection between Asterisk and an Endpoint.",
807 "description": "Unique identifier of the channel.\n\nThis is the same as the Uniqueid field in AMI."
812 "description": "Name of the channel (i.e. SIP/foo-0000a7e3)"
848 "type": "DialplanCEP",
849 "description": "Current location in the dialplan"
854 "description": "Timestamp when channel was created"