Scheduling 2 outbound calls and then joining them

I have a client that is looking for a way to make Asterisk call a sales rep, then call the client. Is there a way to make a entry in the dialplan to place 2 calls then transfer one to the other? I have the scheduleing and tracking part all figured out, just not placing and joining the 2 calls.

Heres the breakdown of what we want:

  1. call sales rep. If he answers the phone then:
  2. call the client. When client answers,
  3. connect the 2 together.

I will need to log the call and record it too, but I have all that figured out.


Hi, No problem, write a small c program keep these in a packet and send to asterisk server. Assume that there are two extensions A and B.

First asterisk will make a call to the A and when A picks it makes a call to B when B picks, A and B are connected.

Enjoy!!! Budy … +Originate

I guess the good news is I know it can be done! The bad news is, I’m not sure what you meant by “c”.

Do you mean a C program or a CLI program? Unfortunately, I know nothing about C (as in C, C+, or C Sharp for that matter), but understand basic BASH scripting. Is there another way around this or did I miss understand what language you were talking about?

My first attempt was by making an bash script and sending asterisk commands via “asterisk -rx “console dial 100@internal”” and so on… Unfortunately, there was no way for asterisk to let the bash script know to not run the next line until the line was answered, always resulting in “No call to transfer”.

Thanks for your response. It is very helpful. Any more would be appreciated.


You can do this with a php web page sending commands to the asterisk manager interface too, if you like more.


make a .call file and then mv the call file into the asterisk spool and the call will get made. this can be done using any program that can build a little text file [e.g. a php script from a web page, nano from the command line etc.]

Don’t try building the .call file in the spool otherwise asterisk will try to execute it while you build it… not good. So build it in some temp folder and move it when finished.

When it executes, it will call one end of the call and when that it picked up it will then call the other end.

I think with some adjustments you can use the example of another post of me for explanation.

You will need a routine to enter the numbers that has to be called and then just let Asterisk set up the call or make extensions for typacal costumer/account manager combinations if you don’t have to much of them. You can make it as complex as you can handle. Hope you can use this.