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.",
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,
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' } }",
97 "dataType": "containers",
98 "allowMultiple": false
102 "description": "The unique id to assign the channel on creation.",
103 "paramType": "query",
105 "allowMultiple": false,
109 "name": "otherChannelId",
110 "description": "The unique id to assign the second channel when using local channels.",
111 "paramType": "query",
113 "allowMultiple": false,
120 "reason": "Invalid parameters for originating a channel."
127 "path": "/channels/{channelId}",
128 "description": "Active channel",
132 "summary": "Channel details.",
134 "responseClass": "Channel",
138 "description": "Channel's id",
141 "allowMultiple": false,
148 "reason": "Channel not found"
153 "httpMethod": "POST",
154 "summary": "Create a new channel (originate with id).",
155 "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.",
156 "nickname": "originateWithId",
157 "responseClass": "Channel",
161 "description": "The unique id to assign the channel on creation.",
164 "allowMultiple": false,
169 "description": "Endpoint to call.",
170 "paramType": "query",
172 "allowMultiple": false,
177 "description": "The extension to dial after the endpoint answers",
178 "paramType": "query",
180 "allowMultiple": false,
185 "description": "The context to dial after the endpoint answers. If omitted, uses 'default'",
186 "paramType": "query",
188 "allowMultiple": false,
193 "description": "The priority to dial after the endpoint answers. If omitted, uses 1",
194 "paramType": "query",
196 "allowMultiple": false,
201 "description": "The application that is subscribed to the originated channel, and passed to the Stasis application.",
202 "paramType": "query",
204 "allowMultiple": false,
209 "description": "The application arguments to pass to the Stasis application.",
210 "paramType": "query",
212 "allowMultiple": false,
217 "description": "CallerID to use when dialing the endpoint or extension.",
218 "paramType": "query",
220 "allowMultiple": false,
225 "description": "Timeout (in seconds) before giving up dialing, or -1 for no timeout.",
226 "paramType": "query",
228 "allowMultiple": false,
234 "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' } }",
237 "dataType": "containers",
238 "allowMultiple": false
241 "name": "otherChannelId",
242 "description": "The unique id to assign the second channel when using local channels.",
243 "paramType": "query",
245 "allowMultiple": false,
252 "reason": "Invalid parameters for originating a channel."
258 "httpMethod": "DELETE",
259 "summary": "Delete (i.e. hangup) a channel.",
260 "nickname": "hangup",
261 "responseClass": "void",
265 "description": "Channel's id",
268 "allowMultiple": false,
273 "description": "Reason for hanging up the channel",
274 "paramType": "query",
276 "allowMultiple": false,
277 "dataType": "string",
278 "defalutValue": "normal",
292 "reason": "Invalid reason for hangup provided"
296 "reason": "Channel not found"
303 "path": "/channels/{channelId}/continue",
304 "description": "Exit application; continue execution in the dialplan",
307 "httpMethod": "POST",
308 "summary": "Exit application; continue execution in the dialplan.",
309 "nickname": "continueInDialplan",
310 "responseClass": "void",
314 "description": "Channel's id",
317 "allowMultiple": false,
322 "description": "The context to continue to.",
323 "paramType": "query",
325 "allowMultiple": false,
330 "description": "The extension to continue to.",
331 "paramType": "query",
333 "allowMultiple": false,
338 "description": "The priority to continue to.",
339 "paramType": "query",
341 "allowMultiple": false,
348 "reason": "Channel not found"
352 "reason": "Channel not in a Stasis application"
359 "path": "/channels/{channelId}/answer",
360 "description": "Answer a channel",
363 "httpMethod": "POST",
364 "summary": "Answer a channel.",
365 "nickname": "answer",
366 "responseClass": "void",
370 "description": "Channel's id",
373 "allowMultiple": false,
380 "reason": "Channel not found"
384 "reason": "Channel not in a Stasis application"
391 "path": "/channels/{channelId}/ring",
392 "description": "Send a ringing indication to a channel",
395 "httpMethod": "POST",
396 "summary": "Indicate ringing to a channel.",
398 "responseClass": "void",
402 "description": "Channel's id",
405 "allowMultiple": false,
412 "reason": "Channel not found"
416 "reason": "Channel not in a Stasis application"
421 "httpMethod": "DELETE",
422 "summary": "Stop ringing indication on a channel if locally generated.",
423 "nickname": "ringStop",
424 "responseClass": "void",
428 "description": "Channel's id",
431 "allowMultiple": false,
438 "reason": "Channel not found"
442 "reason": "Channel not in a Stasis application"
449 "path": "/channels/{channelId}/dtmf",
450 "description": "Send DTMF to a channel",
453 "httpMethod": "POST",
454 "summary": "Send provided DTMF to a given channel.",
455 "nickname": "sendDTMF",
456 "responseClass": "void",
460 "description": "Channel's id",
463 "allowMultiple": false,
468 "description": "DTMF To send.",
469 "paramType": "query",
471 "allowMultiple": false,
476 "description": "Amount of time to wait before DTMF digits (specified in milliseconds) start.",
477 "paramType": "query",
479 "allowMultiple": false,
485 "description": "Amount of time in between DTMF digits (specified in milliseconds).",
486 "paramType": "query",
488 "allowMultiple": false,
494 "description": "Length of each DTMF digit (specified in milliseconds).",
495 "paramType": "query",
497 "allowMultiple": false,
503 "description": "Amount of time to wait after DTMF digits (specified in milliseconds) end.",
504 "paramType": "query",
506 "allowMultiple": false,
514 "reason": "DTMF is required"
518 "reason": "Channel not found"
522 "reason": "Channel not in a Stasis application"
529 "path": "/channels/{channelId}/mute",
530 "description": "Mute a channel",
533 "httpMethod": "POST",
534 "summary": "Mute a channel.",
536 "responseClass": "void",
540 "description": "Channel's id",
543 "allowMultiple": false,
548 "description": "Direction in which to mute audio",
549 "paramType": "query",
551 "allowMultiple": false,
552 "dataType": "string",
553 "defaultValue": "both",
567 "reason": "Channel not found"
571 "reason": "Channel not in a Stasis application"
576 "httpMethod": "DELETE",
577 "summary": "Unmute a channel.",
578 "nickname": "unmute",
579 "responseClass": "void",
583 "description": "Channel's id",
586 "allowMultiple": false,
591 "description": "Direction in which to unmute audio",
592 "paramType": "query",
594 "allowMultiple": false,
595 "dataType": "string",
596 "defaultValue": "both",
610 "reason": "Channel not found"
614 "reason": "Channel not in a Stasis application"
621 "path": "/channels/{channelId}/hold",
622 "description": "Put a channel on hold",
625 "httpMethod": "POST",
626 "summary": "Hold a channel.",
628 "responseClass": "void",
632 "description": "Channel's id",
635 "allowMultiple": false,
642 "reason": "Channel not found"
646 "reason": "Channel not in a Stasis application"
651 "httpMethod": "DELETE",
652 "summary": "Remove a channel from hold.",
653 "nickname": "unhold",
654 "responseClass": "void",
658 "description": "Channel's id",
661 "allowMultiple": false,
668 "reason": "Channel not found"
672 "reason": "Channel not in a Stasis application"
679 "path": "/channels/{channelId}/moh",
680 "description": "Play music on hold to a channel",
683 "httpMethod": "POST",
684 "summary": "Play music on hold to a channel.",
685 "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.",
686 "nickname": "startMoh",
687 "responseClass": "void",
691 "description": "Channel's id",
694 "allowMultiple": false,
699 "description": "Music on hold class to use",
700 "paramType": "query",
702 "allowMultiple": false,
709 "reason": "Channel not found"
713 "reason": "Channel not in a Stasis application"
718 "httpMethod": "DELETE",
719 "summary": "Stop playing music on hold to a channel.",
720 "nickname": "stopMoh",
721 "responseClass": "void",
725 "description": "Channel's id",
728 "allowMultiple": false,
735 "reason": "Channel not found"
739 "reason": "Channel not in a Stasis application"
746 "path": "/channels/{channelId}/silence",
747 "description": "Play silence to a channel",
750 "httpMethod": "POST",
751 "summary": "Play silence to a channel.",
752 "notes": "Using media operations such as /play on a channel playing silence in this manner will suspend silence without resuming automatically.",
753 "nickname": "startSilence",
754 "responseClass": "void",
758 "description": "Channel's id",
761 "allowMultiple": false,
768 "reason": "Channel not found"
772 "reason": "Channel not in a Stasis application"
777 "httpMethod": "DELETE",
778 "summary": "Stop playing silence to a channel.",
779 "nickname": "stopSilence",
780 "responseClass": "void",
784 "description": "Channel's id",
787 "allowMultiple": false,
794 "reason": "Channel not found"
798 "reason": "Channel not in a Stasis application"
805 "path": "/channels/{channelId}/play",
806 "description": "Play media to a channel",
809 "httpMethod": "POST",
810 "summary": "Start playback of media.",
811 "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.)",
813 "responseClass": "Playback",
817 "description": "Channel's id",
820 "allowMultiple": false,
825 "description": "Media's URI to play.",
826 "paramType": "query",
828 "allowMultiple": false,
833 "description": "For sounds, selects language for sound.",
834 "paramType": "query",
836 "allowMultiple": false,
841 "description": "Number of media to skip before playing.",
842 "paramType": "query",
844 "allowMultiple": false,
849 "description": "Number of milliseconds to skip for forward/reverse operations.",
850 "paramType": "query",
852 "allowMultiple": false,
857 "name": "playbackId",
858 "description": "Playback ID.",
859 "paramType": "query",
861 "allowMultiple": false,
868 "reason": "Channel not found"
872 "reason": "Channel not in a Stasis application"
879 "path": "/channels/{channelId}/play/{playbackId}",
880 "description": "Play media to a channel",
883 "httpMethod": "POST",
884 "summary": "Start playback of media and specify the playbackId.",
885 "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.)",
886 "nickname": "playWithId",
887 "responseClass": "Playback",
891 "description": "Channel's id",
894 "allowMultiple": false,
898 "name": "playbackId",
899 "description": "Playback ID.",
902 "allowMultiple": false,
907 "description": "Media's URI to play.",
908 "paramType": "query",
910 "allowMultiple": false,
915 "description": "For sounds, selects language for sound.",
916 "paramType": "query",
918 "allowMultiple": false,
923 "description": "Number of media to skip before playing.",
924 "paramType": "query",
926 "allowMultiple": false,
931 "description": "Number of milliseconds to skip for forward/reverse operations.",
932 "paramType": "query",
934 "allowMultiple": false,
942 "reason": "Channel not found"
946 "reason": "Channel not in a Stasis application"
953 "path": "/channels/{channelId}/record",
954 "description": "Record audio from a channel",
957 "httpMethod": "POST",
958 "summary": "Start a recording.",
959 "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.",
960 "nickname": "record",
961 "responseClass": "LiveRecording",
965 "description": "Channel's id",
968 "allowMultiple": false,
973 "description": "Recording's filename",
974 "paramType": "query",
976 "allowMultiple": false,
981 "description": "Format to encode audio in",
982 "paramType": "query",
984 "allowMultiple": false,
988 "name": "maxDurationSeconds",
989 "description": "Maximum duration of the recording, in seconds. 0 for no limit",
990 "paramType": "query",
992 "allowMultiple": false,
996 "valueType": "RANGE",
1001 "name": "maxSilenceSeconds",
1002 "description": "Maximum duration of silence, in seconds. 0 for no limit",
1003 "paramType": "query",
1005 "allowMultiple": false,
1008 "allowableValues": {
1009 "valueType": "RANGE",
1015 "description": "Action to take if a recording with the same name already exists.",
1016 "paramType": "query",
1018 "allowMultiple": false,
1019 "dataType": "string",
1020 "defaultValue": "fail",
1021 "allowableValues": {
1022 "valueType": "LIST",
1032 "description": "Play beep when recording begins",
1033 "paramType": "query",
1035 "allowMultiple": false,
1036 "dataType": "boolean",
1037 "defaultValue": false
1040 "name": "terminateOn",
1041 "description": "DTMF input to terminate recording",
1042 "paramType": "query",
1044 "allowMultiple": false,
1045 "dataType": "string",
1046 "defaultValue": "none",
1047 "allowableValues": {
1048 "valueType": "LIST",
1061 "reason": "Invalid parameters"
1065 "reason": "Channel not found"
1069 "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"
1073 "reason": "The format specified is unknown on this system"
1080 "path": "/channels/{channelId}/variable",
1081 "description": "Variables on a channel",
1084 "httpMethod": "GET",
1085 "summary": "Get the value of a channel variable or function.",
1086 "nickname": "getChannelVar",
1087 "responseClass": "Variable",
1090 "name": "channelId",
1091 "description": "Channel's id",
1092 "paramType": "path",
1094 "allowMultiple": false,
1095 "dataType": "string"
1099 "description": "The channel variable or function to get",
1100 "paramType": "query",
1102 "allowMultiple": false,
1103 "dataType": "string"
1109 "reason": "Missing variable parameter."
1113 "reason": "Channel not found"
1117 "reason": "Channel not in a Stasis application"
1122 "httpMethod": "POST",
1123 "summary": "Set the value of a channel variable or function.",
1124 "nickname": "setChannelVar",
1125 "responseClass": "void",
1128 "name": "channelId",
1129 "description": "Channel's id",
1130 "paramType": "path",
1132 "allowMultiple": false,
1133 "dataType": "string"
1137 "description": "The channel variable or function to set",
1138 "paramType": "query",
1140 "allowMultiple": false,
1141 "dataType": "string"
1145 "description": "The value to set the variable to",
1146 "paramType": "query",
1148 "allowMultiple": false,
1149 "dataType": "string"
1155 "reason": "Missing variable parameter."
1159 "reason": "Channel not found"
1163 "reason": "Channel not in a Stasis application"
1170 "path": "/channels/{channelId}/snoop",
1171 "description": "Snoop (spy/whisper) on a channel",
1174 "httpMethod": "POST",
1175 "summary": "Start snooping.",
1176 "notes": "Snoop (spy/whisper) on a specific channel.",
1177 "nickname": "snoopChannel",
1178 "responseClass": "Channel",
1181 "name": "channelId",
1182 "description": "Channel's id",
1183 "paramType": "path",
1185 "allowMultiple": false,
1186 "dataType": "string"
1190 "description": "Direction of audio to spy on",
1191 "paramType": "query",
1193 "allowMultiple": false,
1194 "dataType": "string",
1195 "defaultValue": "none",
1196 "allowableValues": {
1197 "valueType": "LIST",
1208 "description": "Direction of audio to whisper into",
1209 "paramType": "query",
1211 "allowMultiple": false,
1212 "dataType": "string",
1213 "defaultValue": "none",
1214 "allowableValues": {
1215 "valueType": "LIST",
1226 "description": "Application the snooping channel is placed into",
1227 "paramType": "query",
1229 "allowMultiple": false,
1230 "dataType": "string"
1234 "description": "The application arguments to pass to the Stasis application",
1235 "paramType": "query",
1237 "allowMultiple": false,
1238 "dataType": "string"
1242 "description": "Unique ID to assign to snooping channel",
1243 "paramType": "query",
1245 "allowMultiple": false,
1246 "dataType": "string"
1252 "reason": "Invalid parameters"
1256 "reason": "Channel not found"
1263 "path": "/channels/{channelId}/snoop/{snoopId}",
1264 "description": "Snoop (spy/whisper) on a channel",
1267 "httpMethod": "POST",
1268 "summary": "Start snooping.",
1269 "notes": "Snoop (spy/whisper) on a specific channel.",
1270 "nickname": "snoopChannelWithId",
1271 "responseClass": "Channel",
1274 "name": "channelId",
1275 "description": "Channel's id",
1276 "paramType": "path",
1278 "allowMultiple": false,
1279 "dataType": "string"
1283 "description": "Unique ID to assign to snooping channel",
1284 "paramType": "path",
1286 "allowMultiple": false,
1287 "dataType": "string"
1291 "description": "Direction of audio to spy on",
1292 "paramType": "query",
1294 "allowMultiple": false,
1295 "dataType": "string",
1296 "defaultValue": "none",
1297 "allowableValues": {
1298 "valueType": "LIST",
1309 "description": "Direction of audio to whisper into",
1310 "paramType": "query",
1312 "allowMultiple": false,
1313 "dataType": "string",
1314 "defaultValue": "none",
1315 "allowableValues": {
1316 "valueType": "LIST",
1327 "description": "Application the snooping channel is placed into",
1328 "paramType": "query",
1330 "allowMultiple": false,
1331 "dataType": "string"
1335 "description": "The application arguments to pass to the Stasis application",
1336 "paramType": "query",
1338 "allowMultiple": false,
1339 "dataType": "string"
1345 "reason": "Invalid parameters"
1349 "reason": "Channel not found"
1359 "description": "Dialed channel information.",
1363 "id": "DialplanCEP",
1364 "description": "Dialplan location (context/extension/priority)",
1369 "description": "Context in the dialplan"
1374 "description": "Extension in the dialplan"
1379 "description": "Priority in the dialplan"
1385 "description": "Caller identification",
1399 "description": "A specific communication connection between Asterisk and an Endpoint.",
1404 "description": "Unique identifier of the channel.\n\nThis is the same as the Uniqueid field in AMI."
1409 "description": "Name of the channel (i.e. SIP/foo-0000a7e3)"
1414 "allowableValues": {
1415 "valueType": "LIST",
1445 "type": "DialplanCEP",
1446 "description": "Current location in the dialplan"
1451 "description": "Timestamp when channel was created"