<html>
<head>
<base href="https://wiki.asterisk.org/wiki">
<link rel="stylesheet" href="/wiki/s/en/2176/25/9/_/styles/combined.css?spaceKey=AST&forWysiwyg=true" type="text/css">
</head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
<h2><a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+Channels+REST+API">Asterisk 12 Channels REST API</a></h2>
<h4>Page <b>added</b> by <a href="https://wiki.asterisk.org/wiki/display/~dlee">David M. Lee</a>
</h4>
<br/>
<div class="notificationGreySide">
<div>
<ul>
<li><a href='#Asterisk12ChannelsRESTAPI-Channels'>Channels</a></li>
<ul>
<li><a href='#Asterisk12ChannelsRESTAPI-GET%2Fchannels'>GET /channels</a></li>
<li><a href='#Asterisk12ChannelsRESTAPI-POST%2Fchannels'>POST /channels</a></li>
<ul>
<li><a href='#Asterisk12ChannelsRESTAPI-Queryparameters'>Query parameters</a></li>
</ul>
<li><a href='#Asterisk12ChannelsRESTAPI-GET%2Fchannels%2F%5C'>GET /channels/{channelId}</a></li>
<ul>
<li><a href='#Asterisk12ChannelsRESTAPI-Pathparameters'>Path parameters</a></li>
</ul>
<li><a href='#Asterisk12ChannelsRESTAPI-DELETE%2Fchannels%2F%5C'>DELETE /channels/{channelId}</a></li>
<ul>
<li><a href='#Asterisk12ChannelsRESTAPI-Pathparameters'>Path parameters</a></li>
</ul>
<li><a href='#Asterisk12ChannelsRESTAPI-POST%2Fchannels%2F%5C%2Fdial'>POST /channels/{channelId}/dial</a></li>
<ul>
<li><a href='#Asterisk12ChannelsRESTAPI-Pathparameters'>Path parameters</a></li>
<li><a href='#Asterisk12ChannelsRESTAPI-Queryparameters'>Query parameters</a></li>
</ul>
<li><a href='#Asterisk12ChannelsRESTAPI-POST%2Fchannels%2F%5C%2Fcontinue'>POST /channels/{channelId}/continue</a></li>
<ul>
<li><a href='#Asterisk12ChannelsRESTAPI-Pathparameters'>Path parameters</a></li>
</ul>
<li><a href='#Asterisk12ChannelsRESTAPI-POST%2Fchannels%2F%5C%2Freject'>POST /channels/{channelId}/reject</a></li>
<ul>
<li><a href='#Asterisk12ChannelsRESTAPI-Pathparameters'>Path parameters</a></li>
</ul>
<li><a href='#Asterisk12ChannelsRESTAPI-POST%2Fchannels%2F%5C%2Fanswer'>POST /channels/{channelId}/answer</a></li>
<ul>
<li><a href='#Asterisk12ChannelsRESTAPI-Pathparameters'>Path parameters</a></li>
</ul>
<li><a href='#Asterisk12ChannelsRESTAPI-POST%2Fchannels%2F%5C%2Fmute'>POST /channels/{channelId}/mute</a></li>
<ul>
<li><a href='#Asterisk12ChannelsRESTAPI-Pathparameters'>Path parameters</a></li>
<li><a href='#Asterisk12ChannelsRESTAPI-Queryparameters'>Query parameters</a></li>
</ul>
<li><a href='#Asterisk12ChannelsRESTAPI-POST%2Fchannels%2F%5C%2Funmute'>POST /channels/{channelId}/unmute</a></li>
<ul>
<li><a href='#Asterisk12ChannelsRESTAPI-Pathparameters'>Path parameters</a></li>
<li><a href='#Asterisk12ChannelsRESTAPI-Queryparameters'>Query parameters</a></li>
</ul>
<li><a href='#Asterisk12ChannelsRESTAPI-POST%2Fchannels%2F%5C%2Frecord'>POST /channels/{channelId}/record</a></li>
<ul>
<li><a href='#Asterisk12ChannelsRESTAPI-Pathparameters'>Path parameters</a></li>
<li><a href='#Asterisk12ChannelsRESTAPI-Queryparameters'>Query parameters</a></li>
</ul>
</ul>
</ul></div>
<h1><a name="Asterisk12ChannelsRESTAPI-Channels"></a>Channels</h1>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Method </th>
<th class='confluenceTh'> Path </th>
<th class='confluenceTh'> Return Model </th>
<th class='confluenceTh'> Summary </th>
</tr>
<tr>
<td class='confluenceTd'> GET </td>
<td class='confluenceTd'> <a href="#Asterisk12ChannelsRESTAPI-getChannels">/channels</a> </td>
<td class='confluenceTd'> List[Channel] </td>
<td class='confluenceTd'> List active channels </td>
</tr>
<tr>
<td class='confluenceTd'> POST </td>
<td class='confluenceTd'> <a href="#Asterisk12ChannelsRESTAPI-originate">/channels</a> </td>
<td class='confluenceTd'> Originated </td>
<td class='confluenceTd'> Create a new channel (originate) </td>
</tr>
<tr>
<td class='confluenceTd'> GET </td>
<td class='confluenceTd'> <a href="#Asterisk12ChannelsRESTAPI-getChannel">/channels/{channelId}</a> </td>
<td class='confluenceTd'> Channel </td>
<td class='confluenceTd'> Channel details </td>
</tr>
<tr>
<td class='confluenceTd'> DELETE </td>
<td class='confluenceTd'> <a href="#Asterisk12ChannelsRESTAPI-deleteChannel">/channels/{channelId}</a> </td>
<td class='confluenceTd'> </td>
<td class='confluenceTd'> Delete (i.e. hangup) a channel </td>
</tr>
<tr>
<td class='confluenceTd'> POST </td>
<td class='confluenceTd'> <a href="#Asterisk12ChannelsRESTAPI-dial">/channels/{channelId}/dial</a> </td>
<td class='confluenceTd'> Dialed </td>
<td class='confluenceTd'> Create a new channel (originate) and bridge to this channel </td>
</tr>
<tr>
<td class='confluenceTd'> POST </td>
<td class='confluenceTd'> <a href="#Asterisk12ChannelsRESTAPI-continueInDialplan">/channels/{channelId}/continue</a> </td>
<td class='confluenceTd'> </td>
<td class='confluenceTd'> Exit application; continue execution in the dialplan </td>
</tr>
<tr>
<td class='confluenceTd'> POST </td>
<td class='confluenceTd'> <a href="#Asterisk12ChannelsRESTAPI-rejectChannel">/channels/{channelId}/reject</a> </td>
<td class='confluenceTd'> </td>
<td class='confluenceTd'> Reject a channel </td>
</tr>
<tr>
<td class='confluenceTd'> POST </td>
<td class='confluenceTd'> <a href="#Asterisk12ChannelsRESTAPI-answerChannel">/channels/{channelId}/answer</a> </td>
<td class='confluenceTd'> </td>
<td class='confluenceTd'> Answer a channel </td>
</tr>
<tr>
<td class='confluenceTd'> POST </td>
<td class='confluenceTd'> <a href="#Asterisk12ChannelsRESTAPI-muteChannel">/channels/{channelId}/mute</a> </td>
<td class='confluenceTd'> </td>
<td class='confluenceTd'> Mute a channel </td>
</tr>
<tr>
<td class='confluenceTd'> POST </td>
<td class='confluenceTd'> <a href="#Asterisk12ChannelsRESTAPI-unmuteChannel">/channels/{channelId}/unmute</a> </td>
<td class='confluenceTd'> </td>
<td class='confluenceTd'> Unmute a channel </td>
</tr>
<tr>
<td class='confluenceTd'> POST </td>
<td class='confluenceTd'> <a href="#Asterisk12ChannelsRESTAPI-recordChannel">/channels/{channelId}/record</a> </td>
<td class='confluenceTd'> </td>
<td class='confluenceTd'> Start a recording </td>
</tr>
</tbody></table>
</div>
<p><a name="Asterisk12ChannelsRESTAPI-getChannels"></a></p>
<h2><a name="Asterisk12ChannelsRESTAPI-GET%2Fchannels"></a>GET /channels</h2>
<p>List active channels</p>
<p><a name="Asterisk12ChannelsRESTAPI-originate"></a></p>
<h2><a name="Asterisk12ChannelsRESTAPI-POST%2Fchannels"></a>POST /channels</h2>
<p>Create a new channel (originate)</p>
<h3><a name="Asterisk12ChannelsRESTAPI-Queryparameters"></a>Query parameters</h3>
<ul>
        <li>endpoint: string- Endpoint to call. If not specified, originate is routed via dialplan</li>
        <li>extension: string- Extension to dial</li>
        <li>context: string- When routing via dialplan, the context use. If omitted, uses 'default'</li>
</ul>
<p><a name="Asterisk12ChannelsRESTAPI-getChannel"></a></p>
<h2><a name="Asterisk12ChannelsRESTAPI-GET%2Fchannels%2F%5C"></a>GET /channels/{channelId}</h2>
<p>Channel details</p>
<h3><a name="Asterisk12ChannelsRESTAPI-Pathparameters"></a>Path parameters</h3>
<ul>
        <li>channelId: string- Channel's id</li>
</ul>
<p><a name="Asterisk12ChannelsRESTAPI-deleteChannel"></a></p>
<h2><a name="Asterisk12ChannelsRESTAPI-DELETE%2Fchannels%2F%5C"></a>DELETE /channels/{channelId}</h2>
<p>Delete (i.e. hangup) a channel</p>
<h3><a name="Asterisk12ChannelsRESTAPI-Pathparameters"></a>Path parameters</h3>
<ul>
        <li>channelId: string- Channel's id</li>
</ul>
<p><a name="Asterisk12ChannelsRESTAPI-dial"></a></p>
<h2><a name="Asterisk12ChannelsRESTAPI-POST%2Fchannels%2F%5C%2Fdial"></a>POST /channels/{channelId}/dial</h2>
<p>Create a new channel (originate) and bridge to this channel</p>
<h3><a name="Asterisk12ChannelsRESTAPI-Pathparameters"></a>Path parameters</h3>
<ul>
        <li>channelId: string- Channel's id</li>
</ul>
<h3><a name="Asterisk12ChannelsRESTAPI-Queryparameters"></a>Query parameters</h3>
<ul>
        <li>endpoint: string- Endpoint to call. If not specified, dial is routed via dialplan</li>
        <li>extension: string- Extension to dial</li>
        <li>context: string- When routing via dialplan, the context use. If omitted, uses 'default'</li>
</ul>
<p><a name="Asterisk12ChannelsRESTAPI-continueInDialplan"></a></p>
<h2><a name="Asterisk12ChannelsRESTAPI-POST%2Fchannels%2F%5C%2Fcontinue"></a>POST /channels/{channelId}/continue</h2>
<p>Exit application; continue execution in the dialplan</p>
<h3><a name="Asterisk12ChannelsRESTAPI-Pathparameters"></a>Path parameters</h3>
<ul>
        <li>channelId: string- Channel's id</li>
</ul>
<p><a name="Asterisk12ChannelsRESTAPI-rejectChannel"></a></p>
<h2><a name="Asterisk12ChannelsRESTAPI-POST%2Fchannels%2F%5C%2Freject"></a>POST /channels/{channelId}/reject</h2>
<p>Reject a channel</p>
<h3><a name="Asterisk12ChannelsRESTAPI-Pathparameters"></a>Path parameters</h3>
<ul>
        <li>channelId: string- Channel's id</li>
</ul>
<p><a name="Asterisk12ChannelsRESTAPI-answerChannel"></a></p>
<h2><a name="Asterisk12ChannelsRESTAPI-POST%2Fchannels%2F%5C%2Fanswer"></a>POST /channels/{channelId}/answer</h2>
<p>Answer a channel</p>
<h3><a name="Asterisk12ChannelsRESTAPI-Pathparameters"></a>Path parameters</h3>
<ul>
        <li>channelId: string- Channel's id</li>
</ul>
<p><a name="Asterisk12ChannelsRESTAPI-muteChannel"></a></p>
<h2><a name="Asterisk12ChannelsRESTAPI-POST%2Fchannels%2F%5C%2Fmute"></a>POST /channels/{channelId}/mute</h2>
<p>Mute a channel</p>
<h3><a name="Asterisk12ChannelsRESTAPI-Pathparameters"></a>Path parameters</h3>
<ul>
        <li>channelId: string- Channel's id</li>
</ul>
<h3><a name="Asterisk12ChannelsRESTAPI-Queryparameters"></a>Query parameters</h3>
<ul>
        <li>direction: string= "both"- Direction in which to unmute audio</li>
</ul>
<p><a name="Asterisk12ChannelsRESTAPI-unmuteChannel"></a></p>
<h2><a name="Asterisk12ChannelsRESTAPI-POST%2Fchannels%2F%5C%2Funmute"></a>POST /channels/{channelId}/unmute</h2>
<p>Unmute a channel</p>
<h3><a name="Asterisk12ChannelsRESTAPI-Pathparameters"></a>Path parameters</h3>
<ul>
        <li>channelId: string- Channel's id</li>
</ul>
<h3><a name="Asterisk12ChannelsRESTAPI-Queryparameters"></a>Query parameters</h3>
<ul>
        <li>direction: string= "both"- Direction in which to unmute audio</li>
</ul>
<p><a name="Asterisk12ChannelsRESTAPI-recordChannel"></a></p>
<h2><a name="Asterisk12ChannelsRESTAPI-POST%2Fchannels%2F%5C%2Frecord"></a>POST /channels/{channelId}/record</h2>
<p>Start a recording</p>
<h3><a name="Asterisk12ChannelsRESTAPI-Pathparameters"></a>Path parameters</h3>
<ul>
        <li>channelId: string- Channel's id</li>
</ul>
<h3><a name="Asterisk12ChannelsRESTAPI-Queryparameters"></a>Query parameters</h3>
<ul>
        <li>name: string- Recording's filename</li>
        <li>maxDurationSeconds: int= 0- Maximum duration of the recording, in seconds. 0 for no limit</li>
        <li>maxSilenceSeconds: int= 0- Maximum duration of silence, in seconds. 0 for no limit</li>
        <li>append: boolean- If true, and recording already exists, append to recording</li>
        <li>beep: boolean- Play beep when recording begins</li>
        <li>terminateOn: string= "none"- DTMF input to terminate recording</li>
</ul>
</div>
<div id="commentsSection" class="wiki-content pageSection">
<div style="float: right;" class="grey">
<a href="https://wiki.asterisk.org/wiki/users/removespacenotification.action?spaceKey=AST">Stop watching space</a>
<span style="padding: 0px 5px;">|</span>
<a href="https://wiki.asterisk.org/wiki/users/editmyemailsettings.action">Change email notification preferences</a>
</div>
<a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+Channels+REST+API">View Online</a>
|
<a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+Channels+REST+API?showComments=true&showCommentArea=true#addcomment">Add Comment</a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>