bridges.json 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  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.5.0",
  6. "swaggerVersion": "1.1",
  7. "basePath": "http://localhost:8088/ari",
  8. "resourcePath": "/api-docs/bridges.{format}",
  9. "apis": [
  10. {
  11. "path": "/bridges",
  12. "description": "Active bridges",
  13. "operations": [
  14. {
  15. "httpMethod": "GET",
  16. "summary": "List all active bridges in Asterisk.",
  17. "nickname": "list",
  18. "responseClass": "List[Bridge]"
  19. },
  20. {
  21. "httpMethod": "POST",
  22. "summary": "Create a new bridge.",
  23. "notes": "This bridge persists until it has been shut down, or Asterisk has been shut down.",
  24. "nickname": "create",
  25. "responseClass": "Bridge",
  26. "parameters": [
  27. {
  28. "name": "type",
  29. "description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media).",
  30. "paramType": "query",
  31. "required": false,
  32. "allowMultiple": false,
  33. "dataType": "string"
  34. },
  35. {
  36. "name": "bridgeId",
  37. "description": "Unique ID to give to the bridge being created.",
  38. "paramType": "query",
  39. "required": false,
  40. "allowMultiple": false,
  41. "dataType": "string"
  42. },
  43. {
  44. "name": "name",
  45. "description": "Name to give to the bridge being created.",
  46. "paramType": "query",
  47. "required": false,
  48. "allowMultiple": false,
  49. "dataType": "string"
  50. }
  51. ]
  52. }
  53. ]
  54. },
  55. {
  56. "path": "/bridges/{bridgeId}",
  57. "description": "Individual bridge",
  58. "operations": [
  59. {
  60. "httpMethod": "POST",
  61. "summary": "Create a new bridge or updates an existing one.",
  62. "notes": "This bridge persists until it has been shut down, or Asterisk has been shut down.",
  63. "nickname": "create_or_update_with_id",
  64. "responseClass": "Bridge",
  65. "parameters": [
  66. {
  67. "name": "type",
  68. "description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media) to set.",
  69. "paramType": "query",
  70. "required": false,
  71. "allowMultiple": false,
  72. "dataType": "string"
  73. },
  74. {
  75. "name": "bridgeId",
  76. "description": "Unique ID to give to the bridge being created.",
  77. "paramType": "path",
  78. "required": true,
  79. "allowMultiple": false,
  80. "dataType": "string"
  81. },
  82. {
  83. "name": "name",
  84. "description": "Set the name of the bridge.",
  85. "paramType": "query",
  86. "required": false,
  87. "allowMultiple": false,
  88. "dataType": "string"
  89. }
  90. ]
  91. },
  92. {
  93. "httpMethod": "GET",
  94. "summary": "Get bridge details.",
  95. "nickname": "get",
  96. "responseClass": "Bridge",
  97. "parameters": [
  98. {
  99. "name": "bridgeId",
  100. "description": "Bridge's id",
  101. "paramType": "path",
  102. "required": true,
  103. "allowMultiple": false,
  104. "dataType": "string"
  105. }
  106. ],
  107. "errorResponses": [
  108. {
  109. "code": 404,
  110. "reason": "Bridge not found"
  111. }
  112. ]
  113. },
  114. {
  115. "httpMethod": "DELETE",
  116. "summary": "Shut down a bridge.",
  117. "notes": "If any channels are in this bridge, they will be removed and resume whatever they were doing beforehand.",
  118. "nickname": "destroy",
  119. "responseClass": "void",
  120. "parameters": [
  121. {
  122. "name": "bridgeId",
  123. "description": "Bridge's id",
  124. "paramType": "path",
  125. "required": true,
  126. "allowMultiple": false,
  127. "dataType": "string"
  128. }
  129. ],
  130. "errorResponses": [
  131. {
  132. "code": 404,
  133. "reason": "Bridge not found"
  134. }
  135. ]
  136. }
  137. ]
  138. },
  139. {
  140. "path": "/bridges/{bridgeId}/addChannel",
  141. "description": "Add a channel to a bridge",
  142. "operations": [
  143. {
  144. "httpMethod": "POST",
  145. "summary": "Add a channel to a bridge.",
  146. "nickname": "addChannel",
  147. "responseClass": "void",
  148. "parameters": [
  149. {
  150. "name": "bridgeId",
  151. "description": "Bridge's id",
  152. "paramType": "path",
  153. "required": true,
  154. "allowMultiple": false,
  155. "dataType": "string"
  156. },
  157. {
  158. "name": "channel",
  159. "description": "Ids of channels to add to bridge",
  160. "paramType": "query",
  161. "required": true,
  162. "allowMultiple": true,
  163. "dataType": "string"
  164. },
  165. {
  166. "name": "role",
  167. "description": "Channel's role in the bridge",
  168. "paramType": "query",
  169. "required": false,
  170. "allowMultiple": false,
  171. "dataType": "string"
  172. }
  173. ],
  174. "errorResponses": [
  175. {
  176. "code": 400,
  177. "reason": "Channel not found"
  178. },
  179. {
  180. "code": 404,
  181. "reason": "Bridge not found"
  182. },
  183. {
  184. "code": 409,
  185. "reason": "Bridge not in Stasis application; Channel currently recording"
  186. },
  187. {
  188. "code": 422,
  189. "reason": "Channel not in Stasis application"
  190. }
  191. ]
  192. }
  193. ]
  194. },
  195. {
  196. "path": "/bridges/{bridgeId}/removeChannel",
  197. "description": "Remove a channel from a bridge",
  198. "operations": [
  199. {
  200. "httpMethod": "POST",
  201. "summary": "Remove a channel from a bridge.",
  202. "nickname": "removeChannel",
  203. "responseClass": "void",
  204. "parameters": [
  205. {
  206. "name": "bridgeId",
  207. "description": "Bridge's id",
  208. "paramType": "path",
  209. "required": true,
  210. "allowMultiple": false,
  211. "dataType": "string"
  212. },
  213. {
  214. "name": "channel",
  215. "description": "Ids of channels to remove from bridge",
  216. "paramType": "query",
  217. "required": true,
  218. "allowMultiple": true,
  219. "dataType": "string"
  220. }
  221. ],
  222. "errorResponses": [
  223. {
  224. "code": 400,
  225. "reason": "Channel not found"
  226. },
  227. {
  228. "code": 404,
  229. "reason": "Bridge not found"
  230. },
  231. {
  232. "code": 409,
  233. "reason": "Bridge not in Stasis application"
  234. },
  235. {
  236. "code": 422,
  237. "reason": "Channel not in this bridge"
  238. }
  239. ]
  240. }
  241. ]
  242. },
  243. {
  244. "path": "/bridges/{bridgeId}/moh",
  245. "description": "Play music on hold to a bridge",
  246. "operations": [
  247. {
  248. "httpMethod": "POST",
  249. "summary": "Play music on hold to a bridge or change the MOH class that is playing.",
  250. "nickname": "startMoh",
  251. "responseClass": "void",
  252. "parameters": [
  253. {
  254. "name": "bridgeId",
  255. "description": "Bridge's id",
  256. "paramType": "path",
  257. "required": true,
  258. "allowMultiple": false,
  259. "dataType": "string"
  260. },
  261. {
  262. "name": "mohClass",
  263. "description": "Channel's id",
  264. "paramType": "query",
  265. "required": false,
  266. "allowMultiple": false,
  267. "dataType": "string"
  268. }
  269. ],
  270. "errorResponses": [
  271. {
  272. "code": 404,
  273. "reason": "Bridge not found"
  274. },
  275. {
  276. "code": 409,
  277. "reason": "Bridge not in Stasis application"
  278. }
  279. ]
  280. },
  281. {
  282. "httpMethod": "DELETE",
  283. "summary": "Stop playing music on hold to a bridge.",
  284. "notes": "This will only stop music on hold being played via POST bridges/{bridgeId}/moh.",
  285. "nickname": "stopMoh",
  286. "responseClass": "void",
  287. "parameters": [
  288. {
  289. "name": "bridgeId",
  290. "description": "Bridge's id",
  291. "paramType": "path",
  292. "required": true,
  293. "allowMultiple": false,
  294. "dataType": "string"
  295. }
  296. ],
  297. "errorResponses": [
  298. {
  299. "code": 404,
  300. "reason": "Bridge not found"
  301. },
  302. {
  303. "code": 409,
  304. "reason": "Bridge not in Stasis application"
  305. }
  306. ]
  307. }
  308. ]
  309. },
  310. {
  311. "path": "/bridges/{bridgeId}/play",
  312. "description": "Play media to the participants of a bridge",
  313. "operations": [
  314. {
  315. "httpMethod": "POST",
  316. "summary": "Start playback of media on a bridge.",
  317. "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.)",
  318. "nickname": "play",
  319. "responseClass": "Playback",
  320. "parameters": [
  321. {
  322. "name": "bridgeId",
  323. "description": "Bridge's id",
  324. "paramType": "path",
  325. "required": true,
  326. "allowMultiple": false,
  327. "dataType": "string"
  328. },
  329. {
  330. "name": "media",
  331. "description": "Media's URI to play.",
  332. "paramType": "query",
  333. "required": true,
  334. "allowMultiple": false,
  335. "dataType": "string"
  336. },
  337. {
  338. "name": "lang",
  339. "description": "For sounds, selects language for sound.",
  340. "paramType": "query",
  341. "required": false,
  342. "allowMultiple": false,
  343. "dataType": "string"
  344. },
  345. {
  346. "name": "offsetms",
  347. "description": "Number of media to skip before playing.",
  348. "paramType": "query",
  349. "required": false,
  350. "allowMultiple": false,
  351. "dataType": "int",
  352. "defaultValue": 0,
  353. "allowableValues": {
  354. "valueType": "RANGE",
  355. "min": 0
  356. }
  357. },
  358. {
  359. "name": "skipms",
  360. "description": "Number of milliseconds to skip for forward/reverse operations.",
  361. "paramType": "query",
  362. "required": false,
  363. "allowMultiple": false,
  364. "dataType": "int",
  365. "defaultValue": 3000,
  366. "allowableValues": {
  367. "valueType": "RANGE",
  368. "min": 0
  369. }
  370. },
  371. {
  372. "name": "playbackId",
  373. "description": "Playback Id.",
  374. "paramType": "query",
  375. "required": false,
  376. "allowMultiple": false,
  377. "dataType": "string"
  378. }
  379. ],
  380. "errorResponses": [
  381. {
  382. "code": 404,
  383. "reason": "Bridge not found"
  384. },
  385. {
  386. "code": 409,
  387. "reason": "Bridge not in a Stasis application"
  388. }
  389. ]
  390. }
  391. ]
  392. },
  393. {
  394. "path": "/bridges/{bridgeId}/play/{playbackId}",
  395. "description": "Play media to a bridge",
  396. "operations": [
  397. {
  398. "httpMethod": "POST",
  399. "summary": "Start playback of media on a bridge.",
  400. "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.)",
  401. "nickname": "playWithId",
  402. "responseClass": "Playback",
  403. "parameters": [
  404. {
  405. "name": "bridgeId",
  406. "description": "Bridge's id",
  407. "paramType": "path",
  408. "required": true,
  409. "allowMultiple": false,
  410. "dataType": "string"
  411. },
  412. {
  413. "name": "playbackId",
  414. "description": "Playback ID.",
  415. "paramType": "path",
  416. "required": true,
  417. "allowMultiple": false,
  418. "dataType": "string"
  419. },
  420. {
  421. "name": "media",
  422. "description": "Media's URI to play.",
  423. "paramType": "query",
  424. "required": true,
  425. "allowMultiple": false,
  426. "dataType": "string"
  427. },
  428. {
  429. "name": "lang",
  430. "description": "For sounds, selects language for sound.",
  431. "paramType": "query",
  432. "required": false,
  433. "allowMultiple": false,
  434. "dataType": "string"
  435. },
  436. {
  437. "name": "offsetms",
  438. "description": "Number of media to skip before playing.",
  439. "paramType": "query",
  440. "required": false,
  441. "allowMultiple": false,
  442. "dataType": "int",
  443. "defaultValue": 0,
  444. "allowableValues": {
  445. "valueType": "RANGE",
  446. "min": 0
  447. }
  448. },
  449. {
  450. "name": "skipms",
  451. "description": "Number of milliseconds to skip for forward/reverse operations.",
  452. "paramType": "query",
  453. "required": false,
  454. "allowMultiple": false,
  455. "dataType": "int",
  456. "defaultValue": 3000,
  457. "allowableValues": {
  458. "valueType": "RANGE",
  459. "min": 0
  460. }
  461. }
  462. ],
  463. "errorResponses": [
  464. {
  465. "code": 404,
  466. "reason": "Bridge not found"
  467. },
  468. {
  469. "code": 409,
  470. "reason": "Bridge not in a Stasis application"
  471. }
  472. ]
  473. }
  474. ]
  475. },
  476. {
  477. "path": "/bridges/{bridgeId}/record",
  478. "description": "Record audio on a bridge",
  479. "operations": [
  480. {
  481. "httpMethod": "POST",
  482. "summary": "Start a recording.",
  483. "notes": "This records the mixed audio from all channels participating in this bridge.",
  484. "nickname": "record",
  485. "responseClass": "LiveRecording",
  486. "parameters": [
  487. {
  488. "name": "bridgeId",
  489. "description": "Bridge's id",
  490. "paramType": "path",
  491. "required": true,
  492. "allowMultiple": false,
  493. "dataType": "string"
  494. },
  495. {
  496. "name": "name",
  497. "description": "Recording's filename",
  498. "paramType": "query",
  499. "required": true,
  500. "allowMultiple": false,
  501. "dataType": "string"
  502. },
  503. {
  504. "name": "format",
  505. "description": "Format to encode audio in",
  506. "paramType": "query",
  507. "required": true,
  508. "allowMultiple": false,
  509. "dataType": "string"
  510. },
  511. {
  512. "name": "maxDurationSeconds",
  513. "description": "Maximum duration of the recording, in seconds. 0 for no limit.",
  514. "paramType": "query",
  515. "required": false,
  516. "allowMultiple": false,
  517. "dataType": "int",
  518. "defaultValue": 0,
  519. "allowableValues": {
  520. "valueType": "RANGE",
  521. "min": 0
  522. }
  523. },
  524. {
  525. "name": "maxSilenceSeconds",
  526. "description": "Maximum duration of silence, in seconds. 0 for no limit.",
  527. "paramType": "query",
  528. "required": false,
  529. "allowMultiple": false,
  530. "dataType": "int",
  531. "defaultValue": 0,
  532. "allowableValues": {
  533. "valueType": "RANGE",
  534. "min": 0
  535. }
  536. },
  537. {
  538. "name": "ifExists",
  539. "description": "Action to take if a recording with the same name already exists.",
  540. "paramType": "query",
  541. "required": false,
  542. "allowMultiple": false,
  543. "dataType": "string",
  544. "defaultValue": "fail",
  545. "allowableValues": {
  546. "valueType": "LIST",
  547. "values": [
  548. "fail",
  549. "overwrite",
  550. "append"
  551. ]
  552. }
  553. },
  554. {
  555. "name": "beep",
  556. "description": "Play beep when recording begins",
  557. "paramType": "query",
  558. "required": false,
  559. "allowMultiple": false,
  560. "dataType": "boolean",
  561. "defaultValue": false
  562. },
  563. {
  564. "name": "terminateOn",
  565. "description": "DTMF input to terminate recording.",
  566. "paramType": "query",
  567. "required": false,
  568. "allowMultiple": false,
  569. "dataType": "string",
  570. "defaultValue": "none",
  571. "allowableValues": {
  572. "valueType": "LIST",
  573. "values": [
  574. "none",
  575. "any",
  576. "*",
  577. "#"
  578. ]
  579. }
  580. }
  581. ],
  582. "errorResponses": [
  583. {
  584. "code": 400,
  585. "reason": "Invalid parameters"
  586. },
  587. {
  588. "code": 404,
  589. "reason": "Bridge not found"
  590. },
  591. {
  592. "code": 409,
  593. "reason": "Bridge is not in a Stasis application; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail"
  594. },
  595. {
  596. "code": 422,
  597. "reason": "The format specified is unknown on this system"
  598. }
  599. ]
  600. }
  601. ]
  602. }
  603. ],
  604. "models": {
  605. "Bridge": {
  606. "id": "Bridge",
  607. "description": "The merging of media from one or more channels.\n\nEveryone on the bridge receives the same audio.",
  608. "properties": {
  609. "id": {
  610. "type": "string",
  611. "description": "Unique identifier for this bridge",
  612. "required": true
  613. },
  614. "technology": {
  615. "type": "string",
  616. "description": "Name of the current bridging technology",
  617. "required": true
  618. },
  619. "bridge_type": {
  620. "type": "string",
  621. "description": "Type of bridge technology",
  622. "required": true,
  623. "allowableValues": {
  624. "valueType": "LIST",
  625. "values": [
  626. "mixing",
  627. "holding"
  628. ]
  629. }
  630. },
  631. "bridge_class": {
  632. "type": "string",
  633. "description": "Bridging class",
  634. "required": true
  635. },
  636. "creator": {
  637. "type": "string",
  638. "description": "Entity that created the bridge",
  639. "required": true
  640. },
  641. "name": {
  642. "type": "string",
  643. "description": "Name the creator gave the bridge",
  644. "required": true
  645. },
  646. "channels": {
  647. "type": "List[string]",
  648. "description": "Ids of channels participating in this bridge",
  649. "required": true
  650. }
  651. }
  652. }
  653. }
  654. }