Transfer calls between to asterisk machines

I should know this but I guess my age is beginning to show.

I have the following scenario

  1. inbound sip call to pbx 1 (freepbx)
  2. caller needs to be routed to another asterisk pbx (pbx2) via an iax trunk. the caller deals with an ivr on pbx2 (IVR cannot be moved to pbx1 it must run on pbx2) to retrieve information from a database and is given the option to return to the main menu
  3. the main menu is on pbx1
  4. the caller is then given an option to connect to a sip phone connected to the pbx1

the issue is that it appears that this scenario creates four active channels :
pbx1->sip phone

this of course creates a rather long path and impacts voice quality. Ideally I want to transfer the call carrying along the original caller id.
my questions are

  1. will using transfer=yes in the iax config accomplish the transfer and reduce the final step to just two channels caller->pbx1 and pbx1->sip phone?
  2. does this allow the original caller id to be passed to the sip phone?
    Any help would be greatly appreciated

So many times it is stated here and elsewhere , Asterisk is a “back to back user agent” that means exactly what it says, you need a real proxy to do what you want.

so that I don’t run off in the wrong direction I should use something like kamailio instead of asterisk for processing the calls?

can you or someone give me some pointers on how to set up a proxy to solve this?

My preference is Kamailio, would be a good place to start.

you could indeed, it’s not as pretty as FreePBX though :slight_smile:

I could use it for the pbx we control but the second pbx is an asterisk pbx that I have no control over. that means I think that the call would still route through the 2nd pbx. it does reduce the call path somewhat but not to where it needs to be. correct?

You can largely control the calls you have control over, there is little you can do about a “black box” in the path :wink:

this will be a tough one to sort out. thanks for the help