<div dir="ltr">Paul,<div><br></div><div>Let me give it a try here. I'm just showing you what works for me. And, my application is an answering service so this might not work for anyone else:</div><div><br></div><div>My extensions.conf has an entry like this:</div><div><br></div><div><div>exten => s,1,Answer()</div><div>same => n,Stasis(xxx_xxx,external)</div><div>same => n,Hangup()</div></div><div><br></div><div>All external calls come into that routine. You can see that the first thing I do is answer the call which solves a bunch of problems I had (early media? etc).</div><div><br></div><div>(BTW, I'm using Node.js for all of the stasis interface and websockets to the clients. I'm using ZeroMQ and PHP workers to do all the heavy lifting.)</div><div><br></div><div>In Node I then get the StasisStart event. I "answer" the call again so that I have control of the call. I found that if I didn't that I would lose the call after a couple of rings. If this is the wrong method please let me know!! I know it's an external call from args[0] = 'external'.</div><div><br></div><div>Yes, the caller no longer hears ringing so I do channels.ring() to that channel. Solves that problem.</div><div><br></div><div>I then do a bunch of stuff internally to let the operators know a call is incoming and what company it's for, how long it's been ringing, etc.</div><div><br></div><div>One of the operators (who already has an open channel and bridge) chooses the call. The ringing is turned off, the incoming channel is connected to the operator's bridge and the operator gets a beep to let them know the call is on the line.</div><div><br></div><div>Obviously, I also display information about the company being called so that the operator can answer the phone properly, etc.</div><div><br></div><div>But that's all there is to it. I've got other routines to make outbound calls, to transfer calls (both transfer and announce and just straight blind transfer). I can easily put the call on hold, etc.</div><div><br></div><div>Each of these options above take a few lines of JS code to the Asterisk routine and that's it. So far, except for a bad softphone, I've had little to no problems. And, the folks at Digium solved the softphone problem also!</div><div><br></div><div>Hope this helps a little. It's very easy. My biggest problem was getting over trying to make it too complex. It isn't.</div><div><br></div><div>Phil M</div><div> </div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 19, 2014 at 1:01 PM, Joshua Colp <span dir="ltr"><<a href="mailto:jcolp@digium.com" target="_blank">jcolp@digium.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Paul Belanger wrote:<br>
<br>
<snip><span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
So, how would that look in ARI?<br>
<br>
Answer channel<br>
invoke originate (far end answers)<br>
create bridge<br>
move channel A and B into bridge<br>
<br>
Right?<br>
<br>
Some differences I can see right from the start, in the ARI example<br>
caller A does not hear ringback, with app_dial they would. So my<br>
questions are:<br>
<br>
When does app_dial indicate ringing to the channel?<br>
</blockquote>
<br></span>
When ringing is received from the dialed end it is then indicated to the caller within app_dial. Of course if there are multiple dialed parties then it uses a bit more intelligence.<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
When does app_dial create the bridge? Does caller A live in the bridge<br>
before Caller B is answered?<br>
</blockquote>
<br></span>
app_dial creates a bridge upon answer and bridges the two. HOWEVER before the remote end has answered there is a pseudo bridge implemented inside of app_dial which exchanges media so early media works.<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
If you had to do this in ARI, how would you do it? Because, what I'd<br>
like to do, is come up with the spec for it, write it, then see about<br>
making a few simple demos for different languanges.<br>
</blockquote>
<br></span>
Right now you can't directly replace app_dial with an ARI equivalent because of early media. There is no way to do anything with a channel until it has answered and no way to exchange early media.<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Joshua Colp<br>
Digium, Inc. | Senior Software Developer<br>
445 Jan Davis Drive NW - Huntsville, AL 35806 - US<br>
Check us out at: <a href="http://www.digium.com" target="_blank">www.digium.com</a> & <a href="http://www.asterisk.org" target="_blank">www.asterisk.org</a></font></span><div class="HOEnZb"><div class="h5"><br>
<br>
______________________________<u></u>_________________<br>
asterisk-app-dev mailing list<br>
<a href="mailto:asterisk-app-dev@lists.digium.com" target="_blank">asterisk-app-dev@lists.digium.<u></u>com</a><br>
<a href="http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev" target="_blank">http://lists.digium.com/cgi-<u></u>bin/mailman/listinfo/asterisk-<u></u>app-dev</a><br>
</div></div></blockquote></div></div>