Asterisk-13-Channels-REST-API_29394321.html 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Asterisk Project : Asterisk 13 Channels 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 Channels REST API
  28. </span>
  29. </h1>
  30. </div>
  31. <div id="content" class="view">
  32. <div class="page-metadata">
  33. Created and last modified by <span class='author'> wikibot</span> on Aug 11, 2014
  34. </div>
  35. <div id="main-content" class="wiki-content group">
  36. <h1 id="Asterisk13ChannelsRESTAPI-Channels">Channels</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-Channels-REST-API_29394321.html">/channels</a> </p></td>
  47. <td class="confluenceTd"><p> <a href="Asterisk-13-REST-Data-Models_29394316.html#Asterisk13RESTDataModels-Channel">List[Channel]</a> </p></td>
  48. <td class="confluenceTd"><p> List all active channels 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-Channels-REST-API_29394321.html">/channels</a> </p></td>
  53. <td class="confluenceTd"><p> <a href="Asterisk-13-REST-Data-Models_29394316.html#Asterisk13RESTDataModels-Channel">Channel</a> </p></td>
  54. <td class="confluenceTd"><p> Create a new channel (originate). </p></td>
  55. </tr>
  56. <tr>
  57. <td class="confluenceTd"><p> GET </p></td>
  58. <td class="confluenceTd"><p> <a href="Asterisk-13-Channels-REST-API_29394321.html">/channels/{channelId}</a> </p></td>
  59. <td class="confluenceTd"><p> <a href="Asterisk-13-REST-Data-Models_29394316.html#Asterisk13RESTDataModels-Channel">Channel</a> </p></td>
  60. <td class="confluenceTd"><p> Channel details. </p></td>
  61. </tr>
  62. <tr>
  63. <td class="confluenceTd"><p> POST </p></td>
  64. <td class="confluenceTd"><p> <a href="Asterisk-13-Channels-REST-API_29394321.html">/channels/{channelId}</a> </p></td>
  65. <td class="confluenceTd"><p> <a href="Asterisk-13-REST-Data-Models_29394316.html#Asterisk13RESTDataModels-Channel">Channel</a> </p></td>
  66. <td class="confluenceTd"><p> Create a new channel (originate with id). </p></td>
  67. </tr>
  68. <tr>
  69. <td class="confluenceTd"><p> DELETE </p></td>
  70. <td class="confluenceTd"><p> <a href="Asterisk-13-Channels-REST-API_29394321.html">/channels/{channelId}</a> </p></td>
  71. <td class="confluenceTd"><p> void </p></td>
  72. <td class="confluenceTd"><p> Delete (i.e. hangup) a channel. </p></td>
  73. </tr>
  74. <tr>
  75. <td class="confluenceTd"><p> POST </p></td>
  76. <td class="confluenceTd"><p> <a href="Asterisk-13-Channels-REST-API_29394321.html">/channels/{channelId}/continue</a> </p></td>
  77. <td class="confluenceTd"><p> void </p></td>
  78. <td class="confluenceTd"><p> Exit application; continue execution in the dialplan. </p></td>
  79. </tr>
  80. <tr>
  81. <td class="confluenceTd"><p> POST </p></td>
  82. <td class="confluenceTd"><p> <a href="Asterisk-13-Channels-REST-API_29394321.html">/channels/{channelId}/answer</a> </p></td>
  83. <td class="confluenceTd"><p> void </p></td>
  84. <td class="confluenceTd"><p> Answer a channel. </p></td>
  85. </tr>
  86. <tr>
  87. <td class="confluenceTd"><p> POST </p></td>
  88. <td class="confluenceTd"><p> <a href="Asterisk-13-Channels-REST-API_29394321.html">/channels/{channelId}/ring</a> </p></td>
  89. <td class="confluenceTd"><p> void </p></td>
  90. <td class="confluenceTd"><p> Indicate ringing to a channel. </p></td>
  91. </tr>
  92. <tr>
  93. <td class="confluenceTd"><p> DELETE </p></td>
  94. <td class="confluenceTd"><p> <a href="Asterisk-13-Channels-REST-API_29394321.html">/channels/{channelId}/ring</a> </p></td>
  95. <td class="confluenceTd"><p> void </p></td>
  96. <td class="confluenceTd"><p> Stop ringing indication on a channel if locally generated. </p></td>
  97. </tr>
  98. <tr>
  99. <td class="confluenceTd"><p> POST </p></td>
  100. <td class="confluenceTd"><p> <a href="Asterisk-13-Channels-REST-API_29394321.html">/channels/{channelId}/dtmf</a> </p></td>
  101. <td class="confluenceTd"><p> void </p></td>
  102. <td class="confluenceTd"><p> Send provided DTMF to a given channel. </p></td>
  103. </tr>
  104. <tr>
  105. <td class="confluenceTd"><p> POST </p></td>
  106. <td class="confluenceTd"><p> <a href="Asterisk-13-Channels-REST-API_29394321.html">/channels/{channelId}/mute</a> </p></td>
  107. <td class="confluenceTd"><p> void </p></td>
  108. <td class="confluenceTd"><p> Mute a channel. </p></td>
  109. </tr>
  110. <tr>
  111. <td class="confluenceTd"><p> DELETE </p></td>
  112. <td class="confluenceTd"><p> <a href="Asterisk-13-Channels-REST-API_29394321.html">/channels/{channelId}/mute</a> </p></td>
  113. <td class="confluenceTd"><p> void </p></td>
  114. <td class="confluenceTd"><p> Unmute a channel. </p></td>
  115. </tr>
  116. <tr>
  117. <td class="confluenceTd"><p> POST </p></td>
  118. <td class="confluenceTd"><p> <a href="Asterisk-13-Channels-REST-API_29394321.html">/channels/{channelId}/hold</a> </p></td>
  119. <td class="confluenceTd"><p> void </p></td>
  120. <td class="confluenceTd"><p> Hold a channel. </p></td>
  121. </tr>
  122. <tr>
  123. <td class="confluenceTd"><p> DELETE </p></td>
  124. <td class="confluenceTd"><p> <a href="Asterisk-13-Channels-REST-API_29394321.html">/channels/{channelId}/hold</a> </p></td>
  125. <td class="confluenceTd"><p> void </p></td>
  126. <td class="confluenceTd"><p> Remove a channel from hold. </p></td>
  127. </tr>
  128. <tr>
  129. <td class="confluenceTd"><p> POST </p></td>
  130. <td class="confluenceTd"><p> <a href="Asterisk-13-Channels-REST-API_29394321.html">/channels/{channelId}/moh</a> </p></td>
  131. <td class="confluenceTd"><p> void </p></td>
  132. <td class="confluenceTd"><p> Play music on hold to a channel. </p></td>
  133. </tr>
  134. <tr>
  135. <td class="confluenceTd"><p> DELETE </p></td>
  136. <td class="confluenceTd"><p> <a href="Asterisk-13-Channels-REST-API_29394321.html">/channels/{channelId}/moh</a> </p></td>
  137. <td class="confluenceTd"><p> void </p></td>
  138. <td class="confluenceTd"><p> Stop playing music on hold to a channel. </p></td>
  139. </tr>
  140. <tr>
  141. <td class="confluenceTd"><p> POST </p></td>
  142. <td class="confluenceTd"><p> <a href="Asterisk-13-Channels-REST-API_29394321.html">/channels/{channelId}/silence</a> </p></td>
  143. <td class="confluenceTd"><p> void </p></td>
  144. <td class="confluenceTd"><p> Play silence to a channel. </p></td>
  145. </tr>
  146. <tr>
  147. <td class="confluenceTd"><p> DELETE </p></td>
  148. <td class="confluenceTd"><p> <a href="Asterisk-13-Channels-REST-API_29394321.html">/channels/{channelId}/silence</a> </p></td>
  149. <td class="confluenceTd"><p> void </p></td>
  150. <td class="confluenceTd"><p> Stop playing silence to a channel. </p></td>
  151. </tr>
  152. <tr>
  153. <td class="confluenceTd"><p> POST </p></td>
  154. <td class="confluenceTd"><p> <a href="Asterisk-13-Channels-REST-API_29394321.html">/channels/{channelId}/play</a> </p></td>
  155. <td class="confluenceTd"><p> <a href="Asterisk-13-REST-Data-Models_29394316.html#Asterisk13RESTDataModels-Playback">Playback</a> </p></td>
  156. <td class="confluenceTd"><p> Start playback of media. </p></td>
  157. </tr>
  158. <tr>
  159. <td class="confluenceTd"><p> POST </p></td>
  160. <td class="confluenceTd"><p> <a href="Asterisk-13-Channels-REST-API_29394321.html">/channels/{channelId}/play/{playbackId}</a> </p></td>
  161. <td class="confluenceTd"><p> <a href="Asterisk-13-REST-Data-Models_29394316.html#Asterisk13RESTDataModels-Playback">Playback</a> </p></td>
  162. <td class="confluenceTd"><p> Start playback of media and specify the playbackId. </p></td>
  163. </tr>
  164. <tr>
  165. <td class="confluenceTd"><p> POST </p></td>
  166. <td class="confluenceTd"><p> <a href="Asterisk-13-Channels-REST-API_29394321.html">/channels/{channelId}/record</a> </p></td>
  167. <td class="confluenceTd"><p> <a href="Asterisk-13-REST-Data-Models_29394316.html#Asterisk13RESTDataModels-LiveRecording">LiveRecording</a> </p></td>
  168. <td class="confluenceTd"><p> Start a recording. </p></td>
  169. </tr>
  170. <tr>
  171. <td class="confluenceTd"><p> GET </p></td>
  172. <td class="confluenceTd"><p> <a href="Asterisk-13-Channels-REST-API_29394321.html">/channels/{channelId}/variable</a> </p></td>
  173. <td class="confluenceTd"><p> <a href="Asterisk-13-REST-Data-Models_29394316.html#Asterisk13RESTDataModels-Variable">Variable</a> </p></td>
  174. <td class="confluenceTd"><p> Get the value of a channel variable or function. </p></td>
  175. </tr>
  176. <tr>
  177. <td class="confluenceTd"><p> POST </p></td>
  178. <td class="confluenceTd"><p> <a href="Asterisk-13-Channels-REST-API_29394321.html">/channels/{channelId}/variable</a> </p></td>
  179. <td class="confluenceTd"><p> void </p></td>
  180. <td class="confluenceTd"><p> Set the value of a channel variable or function. </p></td>
  181. </tr>
  182. <tr>
  183. <td class="confluenceTd"><p> POST </p></td>
  184. <td class="confluenceTd"><p> <a href="Asterisk-13-Channels-REST-API_29394321.html">/channels/{channelId}/snoop</a> </p></td>
  185. <td class="confluenceTd"><p> <a href="Asterisk-13-REST-Data-Models_29394316.html#Asterisk13RESTDataModels-Channel">Channel</a> </p></td>
  186. <td class="confluenceTd"><p> Start snooping. </p></td>
  187. </tr>
  188. <tr>
  189. <td class="confluenceTd"><p> POST </p></td>
  190. <td class="confluenceTd"><p> <a href="Asterisk-13-Channels-REST-API_29394321.html">/channels/{channelId}/snoop/{snoopId}</a> </p></td>
  191. <td class="confluenceTd"><p> <a href="Asterisk-13-REST-Data-Models_29394316.html#Asterisk13RESTDataModels-Channel">Channel</a> </p></td>
  192. <td class="confluenceTd"><p> Start snooping. </p></td>
  193. </tr>
  194. </tbody></table></div>
  195. <p><span class="confluence-anchor-link" id="Asterisk13ChannelsRESTAPI-list"></span></p>
  196. <h2 id="Asterisk13ChannelsRESTAPI-GET/channels">GET /channels</h2>
  197. <p>List all active channels in Asterisk.</p>
  198. <p><span class="confluence-anchor-link" id="Asterisk13ChannelsRESTAPI-originate"></span></p>
  199. <h2 id="Asterisk13ChannelsRESTAPI-POST/channels">POST /channels</h2>
  200. <p>Create a new channel (originate). 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.</p>
  201. <h3 id="Asterisk13ChannelsRESTAPI-Queryparameters">Query parameters</h3>
  202. <ul>
  203. <li>endpoint: string - <strong>(required)</strong> Endpoint to call.</li>
  204. <li>extension: string - The extension to dial after the endpoint answers</li>
  205. <li>context: string - The context to dial after the endpoint answers. If omitted, uses 'default'</li>
  206. <li>priority: long - The priority to dial after the endpoint answers. If omitted, uses 1</li>
  207. <li>app: string - The application that is subscribed to the originated channel, and passed to the Stasis application.</li>
  208. <li>appArgs: string - The application arguments to pass to the Stasis application.</li>
  209. <li>callerId: string - CallerID to use when dialing the endpoint or extension.</li>
  210. <li>timeout: int = 30 - Timeout (in seconds) before giving up dialing, or -1 for no timeout.</li>
  211. <li>channelId: string - The unique id to assign the channel on creation.</li>
  212. <li>otherChannelId: string - The unique id to assign the second channel when using local channels.</li>
  213. </ul>
  214. <h3 id="Asterisk13ChannelsRESTAPI-Bodyparameter">Body parameter</h3>
  215. <ul>
  216. <li>variables: containers - The &quot;variables&quot; 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. { &quot;endpoint&quot;: &quot;SIP/Alice&quot;, &quot;variables&quot;: { &quot;CALLERID(name)&quot;: &quot;Alice&quot; } }</li>
  217. </ul>
  218. <h3 id="Asterisk13ChannelsRESTAPI-ErrorResponses">Error Responses</h3>
  219. <ul>
  220. <li>400 - Invalid parameters for originating a channel.</li>
  221. </ul>
  222. <p><span class="confluence-anchor-link" id="Asterisk13ChannelsRESTAPI-get"></span></p>
  223. <h2 id="Asterisk13ChannelsRESTAPI-GET/channels/{channelId}">GET /channels/{channelId}</h2>
  224. <p>Channel details.</p>
  225. <h3 id="Asterisk13ChannelsRESTAPI-Pathparameters">Path parameters</h3>
  226. <ul>
  227. <li>channelId: string - Channel's id</li>
  228. </ul>
  229. <h3 id="Asterisk13ChannelsRESTAPI-ErrorResponses.1">Error Responses</h3>
  230. <ul>
  231. <li>404 - Channel not found</li>
  232. </ul>
  233. <p><span class="confluence-anchor-link" id="Asterisk13ChannelsRESTAPI-originateWithId"></span></p>
  234. <h2 id="Asterisk13ChannelsRESTAPI-POST/channels/{channelId}">POST /channels/{channelId}</h2>
  235. <p>Create a new channel (originate with id). 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.</p>
  236. <h3 id="Asterisk13ChannelsRESTAPI-Pathparameters.1">Path parameters</h3>
  237. <ul>
  238. <li>channelId: string - The unique id to assign the channel on creation.</li>
  239. </ul>
  240. <h3 id="Asterisk13ChannelsRESTAPI-Queryparameters.1">Query parameters</h3>
  241. <ul>
  242. <li>endpoint: string - <strong>(required)</strong> Endpoint to call.</li>
  243. <li>extension: string - The extension to dial after the endpoint answers</li>
  244. <li>context: string - The context to dial after the endpoint answers. If omitted, uses 'default'</li>
  245. <li>priority: long - The priority to dial after the endpoint answers. If omitted, uses 1</li>
  246. <li>app: string - The application that is subscribed to the originated channel, and passed to the Stasis application.</li>
  247. <li>appArgs: string - The application arguments to pass to the Stasis application.</li>
  248. <li>callerId: string - CallerID to use when dialing the endpoint or extension.</li>
  249. <li>timeout: int = 30 - Timeout (in seconds) before giving up dialing, or -1 for no timeout.</li>
  250. <li>otherChannelId: string - The unique id to assign the second channel when using local channels.</li>
  251. </ul>
  252. <h3 id="Asterisk13ChannelsRESTAPI-Bodyparameter.1">Body parameter</h3>
  253. <ul>
  254. <li>variables: containers - The &quot;variables&quot; 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. { &quot;endpoint&quot;: &quot;SIP/Alice&quot;, &quot;variables&quot;: { &quot;CALLERID(name)&quot;: &quot;Alice&quot; } }</li>
  255. </ul>
  256. <h3 id="Asterisk13ChannelsRESTAPI-ErrorResponses.2">Error Responses</h3>
  257. <ul>
  258. <li>400 - Invalid parameters for originating a channel.</li>
  259. </ul>
  260. <p><span class="confluence-anchor-link" id="Asterisk13ChannelsRESTAPI-hangup"></span></p>
  261. <h2 id="Asterisk13ChannelsRESTAPI-DELETE/channels/{channelId}">DELETE /channels/{channelId}</h2>
  262. <p>Delete (i.e. hangup) a channel.</p>
  263. <h3 id="Asterisk13ChannelsRESTAPI-Pathparameters.2">Path parameters</h3>
  264. <ul>
  265. <li>channelId: string - Channel's id</li>
  266. </ul>
  267. <h3 id="Asterisk13ChannelsRESTAPI-Queryparameters.2">Query parameters</h3>
  268. <ul>
  269. <li>reason: string - Reason for hanging up the channel</li>
  270. </ul>
  271. <h3 id="Asterisk13ChannelsRESTAPI-ErrorResponses.3">Error Responses</h3>
  272. <ul>
  273. <li>400 - Invalid reason for hangup provided</li>
  274. <li>404 - Channel not found</li>
  275. </ul>
  276. <p><span class="confluence-anchor-link" id="Asterisk13ChannelsRESTAPI-continueInDialplan"></span></p>
  277. <h2 id="Asterisk13ChannelsRESTAPI-POST/channels/{channelId}/continue">POST /channels/{channelId}/continue</h2>
  278. <p>Exit application; continue execution in the dialplan.</p>
  279. <h3 id="Asterisk13ChannelsRESTAPI-Pathparameters.3">Path parameters</h3>
  280. <ul>
  281. <li>channelId: string - Channel's id</li>
  282. </ul>
  283. <h3 id="Asterisk13ChannelsRESTAPI-Queryparameters.3">Query parameters</h3>
  284. <ul>
  285. <li>context: string - The context to continue to.</li>
  286. <li>extension: string - The extension to continue to.</li>
  287. <li>priority: int - The priority to continue to.</li>
  288. </ul>
  289. <h3 id="Asterisk13ChannelsRESTAPI-ErrorResponses.4">Error Responses</h3>
  290. <ul>
  291. <li>404 - Channel not found</li>
  292. <li>409 - Channel not in a Stasis application</li>
  293. </ul>
  294. <p><span class="confluence-anchor-link" id="Asterisk13ChannelsRESTAPI-answer"></span></p>
  295. <h2 id="Asterisk13ChannelsRESTAPI-POST/channels/{channelId}/answer">POST /channels/{channelId}/answer</h2>
  296. <p>Answer a channel.</p>
  297. <h3 id="Asterisk13ChannelsRESTAPI-Pathparameters.4">Path parameters</h3>
  298. <ul>
  299. <li>channelId: string - Channel's id</li>
  300. </ul>
  301. <h3 id="Asterisk13ChannelsRESTAPI-ErrorResponses.5">Error Responses</h3>
  302. <ul>
  303. <li>404 - Channel not found</li>
  304. <li>409 - Channel not in a Stasis application</li>
  305. </ul>
  306. <p><span class="confluence-anchor-link" id="Asterisk13ChannelsRESTAPI-ring"></span></p>
  307. <h2 id="Asterisk13ChannelsRESTAPI-POST/channels/{channelId}/ring">POST /channels/{channelId}/ring</h2>
  308. <p>Indicate ringing to a channel.</p>
  309. <h3 id="Asterisk13ChannelsRESTAPI-Pathparameters.5">Path parameters</h3>
  310. <ul>
  311. <li>channelId: string - Channel's id</li>
  312. </ul>
  313. <h3 id="Asterisk13ChannelsRESTAPI-ErrorResponses.6">Error Responses</h3>
  314. <ul>
  315. <li>404 - Channel not found</li>
  316. <li>409 - Channel not in a Stasis application</li>
  317. </ul>
  318. <p><span class="confluence-anchor-link" id="Asterisk13ChannelsRESTAPI-ringStop"></span></p>
  319. <h2 id="Asterisk13ChannelsRESTAPI-DELETE/channels/{channelId}/ring">DELETE /channels/{channelId}/ring</h2>
  320. <p>Stop ringing indication on a channel if locally generated.</p>
  321. <h3 id="Asterisk13ChannelsRESTAPI-Pathparameters.6">Path parameters</h3>
  322. <ul>
  323. <li>channelId: string - Channel's id</li>
  324. </ul>
  325. <h3 id="Asterisk13ChannelsRESTAPI-ErrorResponses.7">Error Responses</h3>
  326. <ul>
  327. <li>404 - Channel not found</li>
  328. <li>409 - Channel not in a Stasis application</li>
  329. </ul>
  330. <p><span class="confluence-anchor-link" id="Asterisk13ChannelsRESTAPI-sendDTMF"></span></p>
  331. <h2 id="Asterisk13ChannelsRESTAPI-POST/channels/{channelId}/dtmf">POST /channels/{channelId}/dtmf</h2>
  332. <p>Send provided DTMF to a given channel.</p>
  333. <h3 id="Asterisk13ChannelsRESTAPI-Pathparameters.7">Path parameters</h3>
  334. <ul>
  335. <li>channelId: string - Channel's id</li>
  336. </ul>
  337. <h3 id="Asterisk13ChannelsRESTAPI-Queryparameters.4">Query parameters</h3>
  338. <ul>
  339. <li>dtmf: string - DTMF To send.</li>
  340. <li>before: int - Amount of time to wait before DTMF digits (specified in milliseconds) start.</li>
  341. <li>between: int = 100 - Amount of time in between DTMF digits (specified in milliseconds).</li>
  342. <li>duration: int = 100 - Length of each DTMF digit (specified in milliseconds).</li>
  343. <li>after: int - Amount of time to wait after DTMF digits (specified in milliseconds) end.</li>
  344. </ul>
  345. <h3 id="Asterisk13ChannelsRESTAPI-ErrorResponses.8">Error Responses</h3>
  346. <ul>
  347. <li>400 - DTMF is required</li>
  348. <li>404 - Channel not found</li>
  349. <li>409 - Channel not in a Stasis application</li>
  350. </ul>
  351. <p><span class="confluence-anchor-link" id="Asterisk13ChannelsRESTAPI-mute"></span></p>
  352. <h2 id="Asterisk13ChannelsRESTAPI-POST/channels/{channelId}/mute">POST /channels/{channelId}/mute</h2>
  353. <p>Mute a channel.</p>
  354. <h3 id="Asterisk13ChannelsRESTAPI-Pathparameters.8">Path parameters</h3>
  355. <ul>
  356. <li>channelId: string - Channel's id</li>
  357. </ul>
  358. <h3 id="Asterisk13ChannelsRESTAPI-Queryparameters.5">Query parameters</h3>
  359. <ul>
  360. <li>direction: string = both - Direction in which to mute audio</li>
  361. </ul>
  362. <h3 id="Asterisk13ChannelsRESTAPI-ErrorResponses.9">Error Responses</h3>
  363. <ul>
  364. <li>404 - Channel not found</li>
  365. <li>409 - Channel not in a Stasis application</li>
  366. </ul>
  367. <p><span class="confluence-anchor-link" id="Asterisk13ChannelsRESTAPI-unmute"></span></p>
  368. <h2 id="Asterisk13ChannelsRESTAPI-DELETE/channels/{channelId}/mute">DELETE /channels/{channelId}/mute</h2>
  369. <p>Unmute a channel.</p>
  370. <h3 id="Asterisk13ChannelsRESTAPI-Pathparameters.9">Path parameters</h3>
  371. <ul>
  372. <li>channelId: string - Channel's id</li>
  373. </ul>
  374. <h3 id="Asterisk13ChannelsRESTAPI-Queryparameters.6">Query parameters</h3>
  375. <ul>
  376. <li>direction: string = both - Direction in which to unmute audio</li>
  377. </ul>
  378. <h3 id="Asterisk13ChannelsRESTAPI-ErrorResponses.10">Error Responses</h3>
  379. <ul>
  380. <li>404 - Channel not found</li>
  381. <li>409 - Channel not in a Stasis application</li>
  382. </ul>
  383. <p><span class="confluence-anchor-link" id="Asterisk13ChannelsRESTAPI-hold"></span></p>
  384. <h2 id="Asterisk13ChannelsRESTAPI-POST/channels/{channelId}/hold">POST /channels/{channelId}/hold</h2>
  385. <p>Hold a channel.</p>
  386. <h3 id="Asterisk13ChannelsRESTAPI-Pathparameters.10">Path parameters</h3>
  387. <ul>
  388. <li>channelId: string - Channel's id</li>
  389. </ul>
  390. <h3 id="Asterisk13ChannelsRESTAPI-ErrorResponses.11">Error Responses</h3>
  391. <ul>
  392. <li>404 - Channel not found</li>
  393. <li>409 - Channel not in a Stasis application</li>
  394. </ul>
  395. <p><span class="confluence-anchor-link" id="Asterisk13ChannelsRESTAPI-unhold"></span></p>
  396. <h2 id="Asterisk13ChannelsRESTAPI-DELETE/channels/{channelId}/hold">DELETE /channels/{channelId}/hold</h2>
  397. <p>Remove a channel from hold.</p>
  398. <h3 id="Asterisk13ChannelsRESTAPI-Pathparameters.11">Path parameters</h3>
  399. <ul>
  400. <li>channelId: string - Channel's id</li>
  401. </ul>
  402. <h3 id="Asterisk13ChannelsRESTAPI-ErrorResponses.12">Error Responses</h3>
  403. <ul>
  404. <li>404 - Channel not found</li>
  405. <li>409 - Channel not in a Stasis application</li>
  406. </ul>
  407. <p><span class="confluence-anchor-link" id="Asterisk13ChannelsRESTAPI-startMoh"></span></p>
  408. <h2 id="Asterisk13ChannelsRESTAPI-POST/channels/{channelId}/moh">POST /channels/{channelId}/moh</h2>
  409. <p>Play music on hold to a channel. 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.</p>
  410. <h3 id="Asterisk13ChannelsRESTAPI-Pathparameters.12">Path parameters</h3>
  411. <ul>
  412. <li>channelId: string - Channel's id</li>
  413. </ul>
  414. <h3 id="Asterisk13ChannelsRESTAPI-Queryparameters.7">Query parameters</h3>
  415. <ul>
  416. <li>mohClass: string - Music on hold class to use</li>
  417. </ul>
  418. <h3 id="Asterisk13ChannelsRESTAPI-ErrorResponses.13">Error Responses</h3>
  419. <ul>
  420. <li>404 - Channel not found</li>
  421. <li>409 - Channel not in a Stasis application</li>
  422. </ul>
  423. <p><span class="confluence-anchor-link" id="Asterisk13ChannelsRESTAPI-stopMoh"></span></p>
  424. <h2 id="Asterisk13ChannelsRESTAPI-DELETE/channels/{channelId}/moh">DELETE /channels/{channelId}/moh</h2>
  425. <p>Stop playing music on hold to a channel.</p>
  426. <h3 id="Asterisk13ChannelsRESTAPI-Pathparameters.13">Path parameters</h3>
  427. <ul>
  428. <li>channelId: string - Channel's id</li>
  429. </ul>
  430. <h3 id="Asterisk13ChannelsRESTAPI-ErrorResponses.14">Error Responses</h3>
  431. <ul>
  432. <li>404 - Channel not found</li>
  433. <li>409 - Channel not in a Stasis application</li>
  434. </ul>
  435. <p><span class="confluence-anchor-link" id="Asterisk13ChannelsRESTAPI-startSilence"></span></p>
  436. <h2 id="Asterisk13ChannelsRESTAPI-POST/channels/{channelId}/silence">POST /channels/{channelId}/silence</h2>
  437. <p>Play silence to a channel. Using media operations such as /play on a channel playing silence in this manner will suspend silence without resuming automatically.</p>
  438. <h3 id="Asterisk13ChannelsRESTAPI-Pathparameters.14">Path parameters</h3>
  439. <ul>
  440. <li>channelId: string - Channel's id</li>
  441. </ul>
  442. <h3 id="Asterisk13ChannelsRESTAPI-ErrorResponses.15">Error Responses</h3>
  443. <ul>
  444. <li>404 - Channel not found</li>
  445. <li>409 - Channel not in a Stasis application</li>
  446. </ul>
  447. <p><span class="confluence-anchor-link" id="Asterisk13ChannelsRESTAPI-stopSilence"></span></p>
  448. <h2 id="Asterisk13ChannelsRESTAPI-DELETE/channels/{channelId}/silence">DELETE /channels/{channelId}/silence</h2>
  449. <p>Stop playing silence to a channel.</p>
  450. <h3 id="Asterisk13ChannelsRESTAPI-Pathparameters.15">Path parameters</h3>
  451. <ul>
  452. <li>channelId: string - Channel's id</li>
  453. </ul>
  454. <h3 id="Asterisk13ChannelsRESTAPI-ErrorResponses.16">Error Responses</h3>
  455. <ul>
  456. <li>404 - Channel not found</li>
  457. <li>409 - Channel not in a Stasis application</li>
  458. </ul>
  459. <p><span class="confluence-anchor-link" id="Asterisk13ChannelsRESTAPI-play"></span></p>
  460. <h2 id="Asterisk13ChannelsRESTAPI-POST/channels/{channelId}/play">POST /channels/{channelId}/play</h2>
  461. <p>Start playback of media. 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>
  462. <h3 id="Asterisk13ChannelsRESTAPI-Pathparameters.16">Path parameters</h3>
  463. <ul>
  464. <li>channelId: string - Channel's id</li>
  465. </ul>
  466. <h3 id="Asterisk13ChannelsRESTAPI-Queryparameters.8">Query parameters</h3>
  467. <ul>
  468. <li>media: string - <strong>(required)</strong> Media's URI to play.</li>
  469. <li>lang: string - For sounds, selects language for sound.</li>
  470. <li>offsetms: int - Number of media to skip before playing.</li>
  471. <li>skipms: int = 3000 - Number of milliseconds to skip for forward/reverse operations.</li>
  472. <li>playbackId: string - Playback ID.</li>
  473. </ul>
  474. <h3 id="Asterisk13ChannelsRESTAPI-ErrorResponses.17">Error Responses</h3>
  475. <ul>
  476. <li>404 - Channel not found</li>
  477. <li>409 - Channel not in a Stasis application</li>
  478. </ul>
  479. <p><span class="confluence-anchor-link" id="Asterisk13ChannelsRESTAPI-playWithId"></span></p>
  480. <h2 id="Asterisk13ChannelsRESTAPI-POST/channels/{channelId}/play/{playbackId}">POST /channels/{channelId}/play/{playbackId}</h2>
  481. <p>Start playback of media and specify the playbackId. 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>
  482. <h3 id="Asterisk13ChannelsRESTAPI-Pathparameters.17">Path parameters</h3>
  483. <ul>
  484. <li>channelId: string - Channel's id</li>
  485. <li>playbackId: string - Playback ID.</li>
  486. </ul>
  487. <h3 id="Asterisk13ChannelsRESTAPI-Queryparameters.9">Query parameters</h3>
  488. <ul>
  489. <li>media: string - <strong>(required)</strong> Media's URI to play.</li>
  490. <li>lang: string - For sounds, selects language for sound.</li>
  491. <li>offsetms: int - Number of media to skip before playing.</li>
  492. <li>skipms: int = 3000 - Number of milliseconds to skip for forward/reverse operations.</li>
  493. </ul>
  494. <h3 id="Asterisk13ChannelsRESTAPI-ErrorResponses.18">Error Responses</h3>
  495. <ul>
  496. <li>404 - Channel not found</li>
  497. <li>409 - Channel not in a Stasis application</li>
  498. </ul>
  499. <p><span class="confluence-anchor-link" id="Asterisk13ChannelsRESTAPI-record"></span></p>
  500. <h2 id="Asterisk13ChannelsRESTAPI-POST/channels/{channelId}/record">POST /channels/{channelId}/record</h2>
  501. <p>Start a recording. 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.</p>
  502. <h3 id="Asterisk13ChannelsRESTAPI-Pathparameters.18">Path parameters</h3>
  503. <ul>
  504. <li>channelId: string - Channel's id</li>
  505. </ul>
  506. <h3 id="Asterisk13ChannelsRESTAPI-Queryparameters.10">Query parameters</h3>
  507. <ul>
  508. <li>name: string - <strong>(required)</strong> Recording's filename</li>
  509. <li>format: string - <strong>(required)</strong> Format to encode audio in</li>
  510. <li>maxDurationSeconds: int - Maximum duration of the recording, in seconds. 0 for no limit</li>
  511. <li>maxSilenceSeconds: int - Maximum duration of silence, in seconds. 0 for no limit</li>
  512. <li>ifExists: string = fail - Action to take if a recording with the same name already exists.</li>
  513. <li>beep: boolean - Play beep when recording begins</li>
  514. <li>terminateOn: string = none - DTMF input to terminate recording</li>
  515. </ul>
  516. <h3 id="Asterisk13ChannelsRESTAPI-ErrorResponses.19">Error Responses</h3>
  517. <ul>
  518. <li>400 - Invalid parameters</li>
  519. <li>404 - Channel not found</li>
  520. <li>409 - 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</li>
  521. <li>422 - The format specified is unknown on this system</li>
  522. </ul>
  523. <p><span class="confluence-anchor-link" id="Asterisk13ChannelsRESTAPI-getChannelVar"></span></p>
  524. <h2 id="Asterisk13ChannelsRESTAPI-GET/channels/{channelId}/variable">GET /channels/{channelId}/variable</h2>
  525. <p>Get the value of a channel variable or function.</p>
  526. <h3 id="Asterisk13ChannelsRESTAPI-Pathparameters.19">Path parameters</h3>
  527. <ul>
  528. <li>channelId: string - Channel's id</li>
  529. </ul>
  530. <h3 id="Asterisk13ChannelsRESTAPI-Queryparameters.11">Query parameters</h3>
  531. <ul>
  532. <li>variable: string - <strong>(required)</strong> The channel variable or function to get</li>
  533. </ul>
  534. <h3 id="Asterisk13ChannelsRESTAPI-ErrorResponses.20">Error Responses</h3>
  535. <ul>
  536. <li>400 - Missing variable parameter.</li>
  537. <li>404 - Channel not found</li>
  538. <li>409 - Channel not in a Stasis application</li>
  539. </ul>
  540. <p><span class="confluence-anchor-link" id="Asterisk13ChannelsRESTAPI-setChannelVar"></span></p>
  541. <h2 id="Asterisk13ChannelsRESTAPI-POST/channels/{channelId}/variable">POST /channels/{channelId}/variable</h2>
  542. <p>Set the value of a channel variable or function.</p>
  543. <h3 id="Asterisk13ChannelsRESTAPI-Pathparameters.20">Path parameters</h3>
  544. <ul>
  545. <li>channelId: string - Channel's id</li>
  546. </ul>
  547. <h3 id="Asterisk13ChannelsRESTAPI-Queryparameters.12">Query parameters</h3>
  548. <ul>
  549. <li>variable: string - <strong>(required)</strong> The channel variable or function to set</li>
  550. <li>value: string - The value to set the variable to</li>
  551. </ul>
  552. <h3 id="Asterisk13ChannelsRESTAPI-ErrorResponses.21">Error Responses</h3>
  553. <ul>
  554. <li>400 - Missing variable parameter.</li>
  555. <li>404 - Channel not found</li>
  556. <li>409 - Channel not in a Stasis application</li>
  557. </ul>
  558. <p><span class="confluence-anchor-link" id="Asterisk13ChannelsRESTAPI-snoopChannel"></span></p>
  559. <h2 id="Asterisk13ChannelsRESTAPI-POST/channels/{channelId}/snoop">POST /channels/{channelId}/snoop</h2>
  560. <p>Start snooping. Snoop (spy/whisper) on a specific channel.</p>
  561. <h3 id="Asterisk13ChannelsRESTAPI-Pathparameters.21">Path parameters</h3>
  562. <ul>
  563. <li>channelId: string - Channel's id</li>
  564. </ul>
  565. <h3 id="Asterisk13ChannelsRESTAPI-Queryparameters.13">Query parameters</h3>
  566. <ul>
  567. <li>spy: string = none - Direction of audio to spy on</li>
  568. <li>whisper: string = none - Direction of audio to whisper into</li>
  569. <li>app: string - <strong>(required)</strong> Application the snooping channel is placed into</li>
  570. <li>appArgs: string - The application arguments to pass to the Stasis application</li>
  571. <li>snoopId: string - Unique ID to assign to snooping channel</li>
  572. </ul>
  573. <h3 id="Asterisk13ChannelsRESTAPI-ErrorResponses.22">Error Responses</h3>
  574. <ul>
  575. <li>400 - Invalid parameters</li>
  576. <li>404 - Channel not found</li>
  577. </ul>
  578. <p><span class="confluence-anchor-link" id="Asterisk13ChannelsRESTAPI-snoopChannelWithId"></span></p>
  579. <h2 id="Asterisk13ChannelsRESTAPI-POST/channels/{channelId}/snoop/{snoopId}">POST /channels/{channelId}/snoop/{snoopId}</h2>
  580. <p>Start snooping. Snoop (spy/whisper) on a specific channel.</p>
  581. <h3 id="Asterisk13ChannelsRESTAPI-Pathparameters.22">Path parameters</h3>
  582. <ul>
  583. <li>channelId: string - Channel's id</li>
  584. <li>snoopId: string - Unique ID to assign to snooping channel</li>
  585. </ul>
  586. <h3 id="Asterisk13ChannelsRESTAPI-Queryparameters.14">Query parameters</h3>
  587. <ul>
  588. <li>spy: string = none - Direction of audio to spy on</li>
  589. <li>whisper: string = none - Direction of audio to whisper into</li>
  590. <li>app: string - <strong>(required)</strong> Application the snooping channel is placed into</li>
  591. <li>appArgs: string - The application arguments to pass to the Stasis application</li>
  592. </ul>
  593. <h3 id="Asterisk13ChannelsRESTAPI-ErrorResponses.23">Error Responses</h3>
  594. <ul>
  595. <li>400 - Invalid parameters</li>
  596. <li>404 - Channel not found</li>
  597. </ul>
  598. </div>
  599. </div> </div>
  600. <div id="footer">
  601. <section class="footer-body">
  602. <p>Document generated by Confluence on Aug 11, 2014 13:40</p>
  603. </section>
  604. </div>
  605. </div> </body>
  606. </html>