Dial vs Originate + Bridge

1,200 views
Skip to first unread message

SR

unread,
Feb 10, 2012, 1:25:05 PM2/10/12
to Adhearsion
Hi folks,
I know this is more an Asterisk-specific question than an Ahn-specific
one, but I thought I will anyways ask the experts in this forum as
well..

A call comes in from Alice. It is picked up and I need to connect her
to Bob. I could either

1. Do a call.dial which calls Bob and patches him to Alice immediately
as soon as he picks up
OR
2. Do an Originate to Bob and Bridge his channel to Alice's

Definitely #2 is more flexible - in that I can do other things on
Bob's channel (like play a music, collect DTMF etc.) before I bridge
the two channels together.

I wanted to know if there was a difference between the two approaches
- from a reliability perspective (Ex: is Originate as reliable as
Dial?)
- from a performance perspective

Is any one preferable over the other? If so, why?

Cheers,
-Sid

Ben Klang

unread,
Feb 10, 2012, 1:34:31 PM2/10/12
to adhea...@googlegroups.com
On Feb 10, 2012, at 1:25 PM, SR wrote:

Hi folks,
I know this is more an Asterisk-specific question than an Ahn-specific
one, but I thought I will anyways ask the experts in this forum as
well..

A call comes in from Alice. It is picked up and I need to connect her
to Bob. I could either

1. Do a call.dial which calls Bob and patches him to Alice immediately
as soon as he picks up
 OR
2. Do an Originate to Bob and Bridge his channel to Alice's

Definitely #2 is more flexible - in that I can do other things on
Bob's channel (like play a music, collect DTMF etc.) before I bridge
the two channels together.

I wanted to know if there was a difference between the two approaches
- from a reliability perspective    (Ex: is Originate as reliable as
Dial?)

I would say there is not any big difference from a reliability perspective.  In all cases, your Asterisk server will place the call if it can, assuming you've sent it the correct instructions (destination channel, etc).  Using Originate does grant you the extra flexibility, but comes at the cost of additional code complexity, since you now effectively have two threads to manage. 

- from a performance perspective
There should be negligible performance difference from the Asterisk side.  As I mentioned above, you will have to watch for AMI events coming back on the Originate so you will have some small overhead there.  At small to medium scale (below 100 concurrent calls) there should not be any issue.  Note that you WILL want to use the "ASYNC" header with Originate to make sure you don't block the AMI Actions thread.

It probably goes without saying, but the Originate method only works if you have AMI enabled in Adhearsion and Asterisk.

Is any one preferable over the other? If so, why?

Most people end up using call.dial just for the simplicity of it, but that is the only preference I can think of.


/BAK/
-- 
Ben Klang

Mojo Lingo -- Voice applications that work like magic
Twitter: @MojoLingo


Cheers,
-Sid

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To post to this group, send email to adhea...@googlegroups.com.
To unsubscribe from this group, send email to adhearsion+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/adhearsion?hl=en.


Ben Langfeld

unread,
Feb 13, 2012, 3:30:18 AM2/13/12
to adhea...@googlegroups.com
Indeed, Adhearsion 2 takes the originate + bridge approach, but hides
it all from you behind the CallController#dial method. It will, in the
future, allow such things as specifying a controller for the new call
to use before being bridged (handy for confirmations, etc), along with
other things.

Regards,
Ben Langfeld

Siddharth Ramesh

unread,
Feb 13, 2012, 7:28:13 AM2/13/12
to adhea...@googlegroups.com
Thanks Ben - it is indeed good to know what Adhearsion 2 is doing this only.

Cheers,
-Sid
Reply all
Reply to author
Forward
0 new messages