Call out in the diffrerent host

I had setup two asterisk system. Host1 for iax user register and host1 installer with a 4 port PRI card. How can i use PRI port in host2 for iax user in host1 to make outgoing call?

who can help me

The first step is getting an IAX2 connection up between your servers.

THESE ARE MY IAX2.CONF settings for the two servers:

IAX2.CONF for 1st server

[pbx1]
username=pbx1
type=friend
secret=mysecret
host=192.168.100.10
allow=ulaw

[pbx2]
username=pbx2
type=user
secret=mysecret
host=192.168.100.10
context=from-internal
allow=ulaw

IAX2.CONF for 2nd server

[pbx1]
username=pbx1
type=user
secret=mysecret
host=192.168.0.10
context=from-internal
allow=ulaw

[pbx2]
username=pbx2
type=friend
secret=mysecret
host=192.168.0.10
allow=ulaw

I am using extensions 1XX on one of the servers and extensions 2XX, 4XX, and 5XX on the other server. I setup outbound routes for those extensions to use the IAX2 trunk to go to the other server. So, on the server that houses the 1XX extensions I setup an outbound rule that include 2XX, 4XX, and 5XX to use my IAX2 trunk. All of my ZAP trunks use 9| on the first server and 2| 4| 5| for outbound on the second server. On the opposing server, I setup outbound rules such as 9NXXXXX to dial out using the IAX2 trunk so that the call gets routed.

I am using FreePBX so it is easy to set this up. Because of I use FreePBX, the above IAX2 settings are actually in iax_additional.conf.

Could you please attache your extensions.conf samples for my reference?
Thank for your help.

I can call to second asterisk server now. But I have another problem now.
My 2th asterisk conneted to a PBX which will authenticate the ANI of incoming call. I find that call made from IAX trunk not provide ANI. How can to do?

my configuration as follow:

Receiving Server (iax.conf)
[REC_SERVER]
type=user
callerid=12345678
host=my.calling.server.ca
secret=mysecret
context=local
trunk=yes

Sending Server (iax.conf)
[REMOTE_SERVER]
type=peer
host=my.receiving.server.ca
secret=mysecret
context=local

Sending Server (extensions.conf)
[mycontext]
exten => 5XXX,1,Dial(IAX2/REMOTE_SERVER/${EXTEN})
exten => _5XXX,2,Hangup
exten => _5XXX,102,Hangup

I am wondering if users of two different Asterisk SIP severs can call one another if the caller knows the FQDN or IP address of the recipient?

For example, user1 at Asterisk1 call user2 at Asterisk using SIP by dialing user2@sip2.domain.com.

Here are the contexts I’m using. Going the other direction is fairly identical.

[outbound-allroutes]
include => outrt-004-TOBRENT

[outrt-004-TOBRENT]
exten => _**1XX,1,Macro(dialout-trunk,5,${EXTEN},)
exten => _**1XX,n,Macro(outisbusy,)
exten => _*1XX,1,Macro(dialout-trunk,5,${EXTEN},)
exten => _*1XX,n,Macro(outisbusy,)
exten => _1XX,1,Macro(dialout-trunk,5,${EXTEN},)
exten => _1XX,n,Macro(outisbusy,)
exten => _91800NXXXXXX,1,Macro(dialout-trunk,5,${EXTEN},)
exten => _91800NXXXXXX,n,Macro(outisbusy,)
exten => _91866NXXXXXX,1,Macro(dialout-trunk,5,${EXTEN},)
exten => _91866NXXXXXX,n,Macro(outisbusy,)
exten => _91877NXXXXXX,1,Macro(dialout-trunk,5,${EXTEN},)
exten => _91877NXXXXXX,n,Macro(outisbusy,)
exten => _91888NXXXXXX,1,Macro(dialout-trunk,5,${EXTEN},)
exten => _91888NXXXXXX,n,Macro(outisbusy,)
exten => _91NXXNXXXXXX,1,Macro(dialout-trunk,5,${EXTEN},)
exten => _91NXXNXXXXXX,n,Macro(outisbusy,)
exten => _9NXXNXXXXXX,1,Macro(dialout-trunk,5,${EXTEN},)
exten => _9NXXNXXXXXX,n,Macro(outisbusy,)
exten => _9NXXXXXX,1,Macro(dialout-trunk,5,${EXTEN},)
exten => _9NXXXXXX,n,Macro(outisbusy,)

The **EXT is for a context which dials intercom with autoanswer using another context.

I can call to second asterisk server now. But I have another problem now.
My 2th asterisk conneted to a PBX which will authenticate the ANI of incoming call. I find that call made from IAX trunk not provide ANI. How to do?