Re: ARI dial application

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Paul,

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:

My extensions.conf has an entry like this:

exten => s,1,Answer()
same => n,Stasis(xxx_xxx,external)
same => n,Hangup()

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).

(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.)

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'.

Yes, the caller no longer hears ringing so I do channels.ring() to that channel.  Solves that problem.

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.

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.

Obviously, I also display information about the company being called so that the operator can answer the phone properly, etc.

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.

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!

Hope this helps a little.  It's very easy.  My biggest problem was getting over trying to make it too complex.  It isn't.

Phil M
  



On Fri, Dec 19, 2014 at 1:01 PM, Joshua Colp <jcolp@xxxxxxxxxx> wrote:
Paul Belanger wrote:

<snip>


So, how would that look in ARI?

Answer channel
invoke originate (far end answers)
create bridge
move channel A and B into bridge

Right?

Some differences I can see right from the start, in the ARI example
caller A does not hear ringback, with app_dial they would. So my
questions are:

When does app_dial indicate ringing to the channel?

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.

When does app_dial create the bridge? Does caller A live in the bridge
before Caller B is answered?

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.


If you had to do this in ARI, how would you do it? Because, what I'd
like to do, is come up with the spec for it, write it, then see about
making a few simple demos for different languanges.

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.

--
Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org


_______________________________________________
asterisk-app-dev mailing list
asterisk-app-dev@lists.digium.com
http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev
_______________________________________________
asterisk-app-dev mailing list
asterisk-app-dev@xxxxxxxxxxxxxxxx
http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev

[Index of Archives]     [Asterisk SS7]     [Asterisk Announcements]     [Asterisk Users]     [PJ SIP]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Linux API]

  Powered by Linux