<div dir="ltr"><div><div><div>Ben Langfeld asked an excellent question at AdhearsionConf about channel creation in ARI. Currently, when a channel is created via ARI, the response contains the channel that was created in the message body. Asterisk will then immediately begin running the channel (that is, dialling the specified endpoint) while the response is being sent back to the client. While "speedy", this creates the situation where the client can potentially receive events for a channel before it has received the successful response to the channel creation.<br>
<br></div>That seems less than ideal.<br><br></div>Ideally, you would create the channel and receive a response indicating what channel you just created. Once you've done that, you'd initiate another request to start running the channel. This is really the only way to keep events from showing up until after you've received the handle to the channel.<br>
<br></div><div>Something like:<br><br></div><div>POST /channels?endpoint=PJSIP/matt&app=hello-world<br></div><div> => Returns 200 OK with channel 12345<br></div><div>POST /channels/12345/run<br></div><div><div><div>
<div><div><br></div><div></div><div>Thoughts?<br><br></div><div>-- <br><div dir="ltr"><div>Matthew Jordan<br></div><div>Digium, Inc. | Engineering Manager</div><div>445 Jan Davis Drive NW - Huntsville, AL 35806 - USA</div>
<div>Check us out at: <a href="http://digium.com" target="_blank">http://digium.com</a> & <a href="http://asterisk.org" target="_blank">http://asterisk.org</a></div></div>
</div></div></div></div></div></div>