2 Asterisk boxes linked using IAX2, one party can not dial

i have used below guide to connect two Asterisk boxes together. box 1 is a Trixbox v2.8.0.4 , box 2 is FreePBX 2.9.0.12. I can dial from box 1 to box 2 with no problem! box 2 however can not use the original route to call box 1. the setting (both IAX2 and Outgoing routes) are identical.

when i was messing around i created a second trunk, with the following setting.
type=friend
trustrpid=yes
qualify=yes
nat=yes
host=192.168.3.2
Strangely enough when i use this trunk with outgoing trunk, box 2 can place a call to box 1. what can be the reason for this?

http://www.freepbx.org/news/2006-10-25/connecting-two-freepbx-mac
p.s. please let me know if you need the IAX2 and Routes setting.
many thanks

You need context=from-internal

SkykingOH i have the following PEER Detail on both boxes as suggested in the guide.
deny=all
allow=g729&alaw
type=friend
host=office2
qualify=yes
context=from-internal

user context and details are empty!

sorry above link is broken, here is the good one
http://www.freepbx.org/news/2006-10-25/connecting-two-freepbx-machines-together

Can you show the full log, normally it throws iax2 errors there…

Do you have the g.729 CODEC ocnfigured?

Also is the name spelled (case sensitive) the same on both ends.

Please send a copy of “iax2 show peer xxx” from both ends please.

sanjayws, im kind of new to FreePBX! what command do i have to run to get the log for IAX2

hi

do a tail -f /var/log/asterisk/full

Here’s what you should use:

Trunk Name: IOTRUNK

Peer Details:
username=IOTRUNK
type=friend
trunk=yes
transfer=no
secret=PASSWORD
host=IPADDRESS
context=from-internal

The above is all you need. Note that the “Trunk Name” above the Peer Details is critical, and must match the username used on the other end.

So, for example, instead of IOTRUNK, you could do

Office #1:

Trunk Name: OfficeA

Peer Details:
username: OfficeB
… (continue with above)

Office #2:

Trunk Name: OfficeB

Peer Details:
username: OfficeA
… (continue with above).

This assumes that both boxes are configured to use the same CODECs via IAX. If you aren’t sure, you can add:

disallow=all
allow=ulaw

to the trunk settings in the Peer Details on both ends.

Also, are you behind a NAT on either end, if so, you’ll find that the trunk will fail as your ports close.

AdHominem,
thansk for your reply! what is the password in this case? i suppose i must make 1 extension on each machine which is the same as the trunk name, and then use the secret as password or not?

Not sure what you mean, you build trunks on both ends and use outbound routes to move the traffic.

Well i found it confusing to include a password as there is no password created for the trunk. But i removed the secret=password line and it works.

But i still have the same problem! i can call office B but office B can not call me! they get a “All circuits are busy now” message!
one question about context=from-internal line! does anything need to be set for this? i remember setting something like this in the .conf files!

You need to post your config and some log capture from when the call fails.

here are the peer settings
username=Site1
type=friend
trunk=yes
transfer=no
host=10.10.100.200
disallow=all
context=from-internal
allow=ulaw&alaw

here is the iax2 show peers
Name/Username Host Mask Port Status
Site1/Site2 10.10.100.200 (S) 255.255.255.255 4569 (T) Unmonitored
1 iax2 peers [0 online, 0 offline, 1 unmonitored]

here is the iax2 show peers
Name/Username Host Mask Port Status
Site2/Site1 192.168.3.241 (S) 255.255.255.255 4569 (T) Unmonitored
1 iax2 peers [0 online, 0 offline, 1 unmonitored]

and the log of the call when it fails

Jun 6 12:48:46] VERBOSE[22052] logger.c: – Executing [[email protected]:5] Congestion(“SIP/103-0847d038”, “20”) in new stack
[Jun 6 12:48:46] VERBOSE[22052] logger.c: == Spawn extension (macro-outisbusy, s, 5) exited non-zero on ‘SIP/103-0847d038’ in macro ‘outisbusy’
[Jun 6 12:48:46] VERBOSE[22052] logger.c: == Spawn extension (from-internal, 8333, 6) exited non-zero on ‘SIP/103-0847d038’
[Jun 6 12:48:46] VERBOSE[22052] logger.c: – Executing [[email protected]:1] Hangup(“SIP/103-0847d038”, “”) in new stack
[Jun 6 12:48:46] VERBOSE[22052] logger.c: == Spawn extension (from-internal, h, 1) exited non-zero on ‘SIP/103-0847d038’