Asterisk-13-Bridges-REST-API_29394327.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Asterisk Project : Asterisk 13 Bridges REST API</title>
  5. <link rel="stylesheet" href="styles/site.css" type="text/css" />
  6. <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
  7. </head>
  8. <body class="theme-default aui-theme-default">
  9. <div id="page">
  10. <div id="main" class="aui-page-panel">
  11. <div id="main-header">
  12. <div id="breadcrumb-section">
  13. <ol id="breadcrumbs">
  14. <li class="first">
  15. <span><a href="index.html">Asterisk Project</a></span>
  16. </li>
  17. <li>
  18. <span><a href="Asterisk-13-Command-Reference_29394274.html">Asterisk 13 Command Reference</a></span>
  19. </li>
  20. <li>
  21. <span><a href="Asterisk-13-ARI_29394283.html">Asterisk 13 ARI</a></span>
  22. </li>
  23. </ol>
  24. </div>
  25. <h1 id="title-heading" class="pagetitle">
  26. <span id="title-text">
  27. Asterisk Project : Asterisk 13 Bridges REST API
  28. </span>
  29. </h1>
  30. </div>
  31. <div id="content" class="view">
  32. <div class="page-metadata">
  33. Created by <span class='author'> wikibot</span> on Aug 08, 2014
  34. </div>
  35. <div id="main-content" class="wiki-content group">
  36. <h1 id="Asterisk13BridgesRESTAPI-Bridges">Bridges</h1>
  37. <div class="table-wrap"><table class="confluenceTable"><tbody>
  38. <tr>
  39. <th class="confluenceTh"><p> Method </p></th>
  40. <th class="confluenceTh"><p> Path </p></th>
  41. <th class="confluenceTh"><p> Return Model </p></th>
  42. <th class="confluenceTh"><p> Summary </p></th>
  43. </tr>
  44. <tr>
  45. <td class="confluenceTd"><p> GET </p></td>
  46. <td class="confluenceTd"><p> <a href="Asterisk-13-Bridges-REST-API_29394327.html">/bridges</a> </p></td>
  47. <td class="confluenceTd"><p> <a href="Asterisk-13-REST-Data-Models_29394316.html#Asterisk13RESTDataModels-Bridge">List[Bridge]</a> </p></td>
  48. <td class="confluenceTd"><p> List all active bridges in Asterisk. </p></td>
  49. </tr>
  50. <tr>
  51. <td class="confluenceTd"><p> POST </p></td>
  52. <td class="confluenceTd"><p> <a href="Asterisk-13-Bridges-REST-API_29394327.html">/bridges</a> </p></td>
  53. <td class="confluenceTd"><p> <a href="Asterisk-13-REST-Data-Models_29394316.html#Asterisk13RESTDataModels-Bridge">Bridge</a> </p></td>
  54. <td class="confluenceTd"><p> Create a new bridge. </p></td>
  55. </tr>
  56. <tr>
  57. <td class="confluenceTd"><p> POST </p></td>
  58. <td class="confluenceTd"><p> <a href="Asterisk-13-Bridges-REST-API_29394327.html">/bridges/{bridgeId}</a> </p></td>
  59. <td class="confluenceTd"><p> <a href="Asterisk-13-REST-Data-Models_29394316.html#Asterisk13RESTDataModels-Bridge">Bridge</a> </p></td>
  60. <td class="confluenceTd"><p> Create a new bridge or updates an existing one. </p></td>
  61. </tr>
  62. <tr>
  63. <td class="confluenceTd"><p> GET </p></td>
  64. <td class="confluenceTd"><p> <a href="Asterisk-13-Bridges-REST-API_29394327.html">/bridges/{bridgeId}</a> </p></td>
  65. <td class="confluenceTd"><p> <a href="Asterisk-13-REST-Data-Models_29394316.html#Asterisk13RESTDataModels-Bridge">Bridge</a> </p></td>
  66. <td class="confluenceTd"><p> Get bridge details. </p></td>
  67. </tr>
  68. <tr>
  69. <td class="confluenceTd"><p> DELETE </p></td>
  70. <td class="confluenceTd"><p> <a href="Asterisk-13-Bridges-REST-API_29394327.html">/bridges/{bridgeId}</a> </p></td>
  71. <td class="confluenceTd"><p> void </p></td>
  72. <td class="confluenceTd"><p> Shut down a bridge. </p></td>
  73. </tr>
  74. <tr>
  75. <td class="confluenceTd"><p> POST </p></td>
  76. <td class="confluenceTd"><p> <a href="Asterisk-13-Bridges-REST-API_29394327.html">/bridges/{bridgeId}/addChannel</a> </p></td>
  77. <td class="confluenceTd"><p> void </p></td>
  78. <td class="confluenceTd"><p> Add a channel to a bridge. </p></td>
  79. </tr>
  80. <tr>
  81. <td class="confluenceTd"><p> POST </p></td>
  82. <td class="confluenceTd"><p> <a href="Asterisk-13-Bridges-REST-API_29394327.html">/bridges/{bridgeId}/removeChannel</a> </p></td>
  83. <td class="confluenceTd"><p> void </p></td>
  84. <td class="confluenceTd"><p> Remove a channel from a bridge. </p></td>
  85. </tr>
  86. <tr>
  87. <td class="confluenceTd"><p> POST </p></td>
  88. <td class="confluenceTd"><p> <a href="Asterisk-13-Bridges-REST-API_29394327.html">/bridges/{bridgeId}/moh</a> </p></td>
  89. <td class="confluenceTd"><p> void </p></td>
  90. <td class="confluenceTd"><p> Play music on hold to a bridge or change the MOH class that is playing. </p></td>
  91. </tr>
  92. <tr>
  93. <td class="confluenceTd"><p> DELETE </p></td>
  94. <td class="confluenceTd"><p> <a href="Asterisk-13-Bridges-REST-API_29394327.html">/bridges/{bridgeId}/moh</a> </p></td>
  95. <td class="confluenceTd"><p> void </p></td>
  96. <td class="confluenceTd"><p> Stop playing music on hold to a bridge. </p></td>
  97. </tr>
  98. <tr>
  99. <td class="confluenceTd"><p> POST </p></td>
  100. <td class="confluenceTd"><p> <a href="Asterisk-13-Bridges-REST-API_29394327.html">/bridges/{bridgeId}/play</a> </p></td>
  101. <td class="confluenceTd"><p> <a href="Asterisk-13-REST-Data-Models_29394316.html#Asterisk13RESTDataModels-Playback">Playback</a> </p></td>
  102. <td class="confluenceTd"><p> Start playback of media on a bridge. </p></td>
  103. </tr>
  104. <tr>
  105. <td class="confluenceTd"><p> POST </p></td>
  106. <td class="confluenceTd"><p> <a href="Asterisk-13-Bridges-REST-API_29394327.html">/bridges/{bridgeId}/play/{playbackId}</a> </p></td>
  107. <td class="confluenceTd"><p> <a href="Asterisk-13-REST-Data-Models_29394316.html#Asterisk13RESTDataModels-Playback">Playback</a> </p></td>
  108. <td class="confluenceTd"><p> Start playback of media on a bridge. </p></td>
  109. </tr>
  110. <tr>
  111. <td class="confluenceTd"><p> POST </p></td>
  112. <td class="confluenceTd"><p> <a href="Asterisk-13-Bridges-REST-API_29394327.html">/bridges/{bridgeId}/record</a> </p></td>
  113. <td class="confluenceTd"><p> <a href="Asterisk-13-REST-Data-Models_29394316.html#Asterisk13RESTDataModels-LiveRecording">LiveRecording</a> </p></td>
  114. <td class="confluenceTd"><p> Start a recording. </p></td>
  115. </tr>
  116. </tbody></table></div>
  117. <p><span class="confluence-anchor-link" id="Asterisk13BridgesRESTAPI-list"></span></p>
  118. <h2 id="Asterisk13BridgesRESTAPI-GET/bridges">GET /bridges</h2>
  119. <p>List all active bridges in Asterisk.</p>
  120. <p><span class="confluence-anchor-link" id="Asterisk13BridgesRESTAPI-create"></span></p>
  121. <h2 id="Asterisk13BridgesRESTAPI-POST/bridges">POST /bridges</h2>
  122. <p>Create a new bridge. This bridge persists until it has been shut down, or Asterisk has been shut down.</p>
  123. <h3 id="Asterisk13BridgesRESTAPI-Queryparameters">Query parameters</h3>
  124. <ul>
  125. <li>type: string - Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media).</li>
  126. <li>bridgeId: string - Unique ID to give to the bridge being created.</li>
  127. <li>name: string - Name to give to the bridge being created.</li>
  128. </ul>
  129. <p><span class="confluence-anchor-link" id="Asterisk13BridgesRESTAPI-create_or_update_with_id"></span></p>
  130. <h2 id="Asterisk13BridgesRESTAPI-POST/bridges/{bridgeId}">POST /bridges/{bridgeId}</h2>
  131. <p>Create a new bridge or updates an existing one. This bridge persists until it has been shut down, or Asterisk has been shut down.</p>
  132. <h3 id="Asterisk13BridgesRESTAPI-Pathparameters">Path parameters</h3>
  133. <ul>
  134. <li>bridgeId: string - Unique ID to give to the bridge being created.</li>
  135. </ul>
  136. <h3 id="Asterisk13BridgesRESTAPI-Queryparameters.1">Query parameters</h3>
  137. <ul>
  138. <li>type: string - Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media) to set.</li>
  139. <li>name: string - Set the name of the bridge.</li>
  140. </ul>
  141. <p><span class="confluence-anchor-link" id="Asterisk13BridgesRESTAPI-get"></span></p>
  142. <h2 id="Asterisk13BridgesRESTAPI-GET/bridges/{bridgeId}">GET /bridges/{bridgeId}</h2>
  143. <p>Get bridge details.</p>
  144. <h3 id="Asterisk13BridgesRESTAPI-Pathparameters.1">Path parameters</h3>
  145. <ul>
  146. <li>bridgeId: string - Bridge's id</li>
  147. </ul>
  148. <h3 id="Asterisk13BridgesRESTAPI-ErrorResponses">Error Responses</h3>
  149. <ul>
  150. <li>404 - Bridge not found</li>
  151. </ul>
  152. <p><span class="confluence-anchor-link" id="Asterisk13BridgesRESTAPI-destroy"></span></p>
  153. <h2 id="Asterisk13BridgesRESTAPI-DELETE/bridges/{bridgeId}">DELETE /bridges/{bridgeId}</h2>
  154. <p>Shut down a bridge. If any channels are in this bridge, they will be removed and resume whatever they were doing beforehand.</p>
  155. <h3 id="Asterisk13BridgesRESTAPI-Pathparameters.2">Path parameters</h3>
  156. <ul>
  157. <li>bridgeId: string - Bridge's id</li>
  158. </ul>
  159. <h3 id="Asterisk13BridgesRESTAPI-ErrorResponses.1">Error Responses</h3>
  160. <ul>
  161. <li>404 - Bridge not found</li>
  162. </ul>
  163. <p><span class="confluence-anchor-link" id="Asterisk13BridgesRESTAPI-addChannel"></span></p>
  164. <h2 id="Asterisk13BridgesRESTAPI-POST/bridges/{bridgeId}/addChannel">POST /bridges/{bridgeId}/addChannel</h2>
  165. <p>Add a channel to a bridge.</p>
  166. <h3 id="Asterisk13BridgesRESTAPI-Pathparameters.3">Path parameters</h3>
  167. <ul>
  168. <li>bridgeId: string - Bridge's id</li>
  169. </ul>
  170. <h3 id="Asterisk13BridgesRESTAPI-Queryparameters.2">Query parameters</h3>
  171. <ul>
  172. <li>channel: string - <strong>(required)</strong> Ids of channels to add to bridge
  173. <ul>
  174. <li>Allows comma separated values.</li>
  175. </ul>
  176. </li>
  177. <li>role: string - Channel's role in the bridge</li>
  178. </ul>
  179. <h3 id="Asterisk13BridgesRESTAPI-ErrorResponses.2">Error Responses</h3>
  180. <ul>
  181. <li>400 - Channel not found</li>
  182. <li>404 - Bridge not found</li>
  183. <li>409 - Bridge not in Stasis application; Channel currently recording</li>
  184. <li>422 - Channel not in Stasis application</li>
  185. </ul>
  186. <p><span class="confluence-anchor-link" id="Asterisk13BridgesRESTAPI-removeChannel"></span></p>
  187. <h2 id="Asterisk13BridgesRESTAPI-POST/bridges/{bridgeId}/removeChannel">POST /bridges/{bridgeId}/removeChannel</h2>
  188. <p>Remove a channel from a bridge.</p>
  189. <h3 id="Asterisk13BridgesRESTAPI-Pathparameters.4">Path parameters</h3>
  190. <ul>
  191. <li>bridgeId: string - Bridge's id</li>
  192. </ul>
  193. <h3 id="Asterisk13BridgesRESTAPI-Queryparameters.3">Query parameters</h3>
  194. <ul>
  195. <li>channel: string - <strong>(required)</strong> Ids of channels to remove from bridge
  196. <ul>
  197. <li>Allows comma separated values.</li>
  198. </ul>
  199. </li>
  200. </ul>
  201. <h3 id="Asterisk13BridgesRESTAPI-ErrorResponses.3">Error Responses</h3>
  202. <ul>
  203. <li>400 - Channel not found</li>
  204. <li>404 - Bridge not found</li>
  205. <li>409 - Bridge not in Stasis application</li>
  206. <li>422 - Channel not in this bridge</li>
  207. </ul>
  208. <p><span class="confluence-anchor-link" id="Asterisk13BridgesRESTAPI-startMoh"></span></p>
  209. <h2 id="Asterisk13BridgesRESTAPI-POST/bridges/{bridgeId}/moh">POST /bridges/{bridgeId}/moh</h2>
  210. <p>Play music on hold to a bridge or change the MOH class that is playing.</p>
  211. <h3 id="Asterisk13BridgesRESTAPI-Pathparameters.5">Path parameters</h3>
  212. <ul>
  213. <li>bridgeId: string - Bridge's id</li>
  214. </ul>
  215. <h3 id="Asterisk13BridgesRESTAPI-Queryparameters.4">Query parameters</h3>
  216. <ul>
  217. <li>mohClass: string - Channel's id</li>
  218. </ul>
  219. <h3 id="Asterisk13BridgesRESTAPI-ErrorResponses.4">Error Responses</h3>
  220. <ul>
  221. <li>404 - Bridge not found</li>
  222. <li>409 - Bridge not in Stasis application</li>
  223. </ul>
  224. <p><span class="confluence-anchor-link" id="Asterisk13BridgesRESTAPI-stopMoh"></span></p>
  225. <h2 id="Asterisk13BridgesRESTAPI-DELETE/bridges/{bridgeId}/moh">DELETE /bridges/{bridgeId}/moh</h2>
  226. <p>Stop playing music on hold to a bridge. This will only stop music on hold being played via POST bridges/{bridgeId}/moh.</p>
  227. <h3 id="Asterisk13BridgesRESTAPI-Pathparameters.6">Path parameters</h3>
  228. <ul>
  229. <li>bridgeId: string - Bridge's id</li>
  230. </ul>
  231. <h3 id="Asterisk13BridgesRESTAPI-ErrorResponses.5">Error Responses</h3>
  232. <ul>
  233. <li>404 - Bridge not found</li>
  234. <li>409 - Bridge not in Stasis application</li>
  235. </ul>
  236. <p><span class="confluence-anchor-link" id="Asterisk13BridgesRESTAPI-play"></span></p>
  237. <h2 id="Asterisk13BridgesRESTAPI-POST/bridges/{bridgeId}/play">POST /bridges/{bridgeId}/play</h2>
  238. <p>Start playback of media on a bridge. 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.)</p>
  239. <h3 id="Asterisk13BridgesRESTAPI-Pathparameters.7">Path parameters</h3>
  240. <ul>
  241. <li>bridgeId: string - Bridge's id</li>
  242. </ul>
  243. <h3 id="Asterisk13BridgesRESTAPI-Queryparameters.5">Query parameters</h3>
  244. <ul>
  245. <li>media: string - <strong>(required)</strong> Media's URI to play.</li>
  246. <li>lang: string - For sounds, selects language for sound.</li>
  247. <li>offsetms: int - Number of media to skip before playing.</li>
  248. <li>skipms: int = 3000 - Number of milliseconds to skip for forward/reverse operations.</li>
  249. <li>playbackId: string - Playback Id.</li>
  250. </ul>
  251. <h3 id="Asterisk13BridgesRESTAPI-ErrorResponses.6">Error Responses</h3>
  252. <ul>
  253. <li>404 - Bridge not found</li>
  254. <li>409 - Bridge not in a Stasis application</li>
  255. </ul>
  256. <p><span class="confluence-anchor-link" id="Asterisk13BridgesRESTAPI-playWithId"></span></p>
  257. <h2 id="Asterisk13BridgesRESTAPI-POST/bridges/{bridgeId}/play/{playbackId}">POST /bridges/{bridgeId}/play/{playbackId}</h2>
  258. <p>Start playback of media on a bridge. 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.)</p>
  259. <h3 id="Asterisk13BridgesRESTAPI-Pathparameters.8">Path parameters</h3>
  260. <ul>
  261. <li>bridgeId: string - Bridge's id</li>
  262. <li>playbackId: string - Playback ID.</li>
  263. </ul>
  264. <h3 id="Asterisk13BridgesRESTAPI-Queryparameters.6">Query parameters</h3>
  265. <ul>
  266. <li>media: string - <strong>(required)</strong> Media's URI to play.</li>
  267. <li>lang: string - For sounds, selects language for sound.</li>
  268. <li>offsetms: int - Number of media to skip before playing.</li>
  269. <li>skipms: int = 3000 - Number of milliseconds to skip for forward/reverse operations.</li>
  270. </ul>
  271. <h3 id="Asterisk13BridgesRESTAPI-ErrorResponses.7">Error Responses</h3>
  272. <ul>
  273. <li>404 - Bridge not found</li>
  274. <li>409 - Bridge not in a Stasis application</li>
  275. </ul>
  276. <p><span class="confluence-anchor-link" id="Asterisk13BridgesRESTAPI-record"></span></p>
  277. <h2 id="Asterisk13BridgesRESTAPI-POST/bridges/{bridgeId}/record">POST /bridges/{bridgeId}/record</h2>
  278. <p>Start a recording. This records the mixed audio from all channels participating in this bridge.</p>
  279. <h3 id="Asterisk13BridgesRESTAPI-Pathparameters.9">Path parameters</h3>
  280. <ul>
  281. <li>bridgeId: string - Bridge's id</li>
  282. </ul>
  283. <h3 id="Asterisk13BridgesRESTAPI-Queryparameters.7">Query parameters</h3>
  284. <ul>
  285. <li>name: string - <strong>(required)</strong> Recording's filename</li>
  286. <li>format: string - <strong>(required)</strong> Format to encode audio in</li>
  287. <li>maxDurationSeconds: int - Maximum duration of the recording, in seconds. 0 for no limit.</li>
  288. <li>maxSilenceSeconds: int - Maximum duration of silence, in seconds. 0 for no limit.</li>
  289. <li>ifExists: string = fail - Action to take if a recording with the same name already exists.</li>
  290. <li>beep: boolean - Play beep when recording begins</li>
  291. <li>terminateOn: string = none - DTMF input to terminate recording.</li>
  292. </ul>
  293. <h3 id="Asterisk13BridgesRESTAPI-ErrorResponses.8">Error Responses</h3>
  294. <ul>
  295. <li>400 - Invalid parameters</li>
  296. <li>404 - Bridge not found</li>
  297. <li>409 - 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</li>
  298. <li>422 - The format specified is unknown on this system</li>
  299. </ul>
  300. </div>
  301. </div> </div>
  302. <div id="footer">
  303. <section class="footer-body">
  304. <p>Document generated by Confluence on Aug 11, 2014 13:40</p>
  305. </section>
  306. </div>
  307. </div> </body>
  308. </html>