Ring incoming call, dial new outgoing call, then merge two

We have a need of just that.

I need to let an incoming call ring, not answer it in any way.
Dial an outgoing call based on the DID of the ringing incoming call.
Then when/if the outgoing call is answered, answer the incoming call and merge the two calls into one conversation.

I THINK this may be done using .cal files. I’m not sure, still in the research phase. We are under a time constraint on this one though. Any help would be greatly appreciated!


a .call file is just the mechanism to establish the connection between two endpoints through the asterisk server.

until you answer the inbound, i am unclear as to where you will get the number for the other end of the call. to create a bridge, you have to have two calls established and then bridge them, but you are trying to do this without answering the inbound first.

if you did not have an inbound call to worry about but had two numbers you wanted to bridge, the .call file would be the ideal solution. i am not sure i can think of a solution to what you are trying to do.

I assumed you would get the incoming DID from the address as the call comes in. The calls come in as 1XXXXXXXXXX@sip.somewhere.com. This will provide the number. It’s the same way calls are routed to extensions before answering now.

My current theroy on how to do this would be something like this.

  1. As the call comes in, route it to a virtual extension to just ring.
  2. Dial the outgoing number.
  3. When outgoing answered, answer the call on the virtual extension and merge the two.

I just don’t know enough asterisk to guess if this can be done.

Yes it can be done, here you can find an example quite close to what you need and from it you should be able to build your service: blog.gramels.info/blog/index.php … ation.html .

Marco Bruni