Needing help with branch location - No external calls

I am a noob so please bare with me. I have a central server that all external calls are routed through. SIP phones work perfect on this server. We added a server at a branch location and connected the two using a IAX2 trunk.

From the branch location, we can call the internal extensions at the central location (and vice-versa) and everything works fine. When the branch location attempts to make a external call, they get two rings and the “all circuits are busy, try again later” message.

I have scoured the internet and tried all kinds of changes but all end with teh same result. Any help will be GREATLY appreciated.

Many thanks!!!

Sorry for not including this information:

We are running FreePBX 2.8.1 Release 16, our central server is using a Sangoma A200 card and a single analog connection for testing purposes.

Maybe a call log and a detailed description of how the IAX2 tie-line is set up?

I have the following configuration for IAX2:
Central location (Edison328) Branch Location (Edison316)
Trunk name: edison316 edison328
Peer Details: username=888 username=888
type=peer type=peer
secret=xxxxxx secret=xxxxxx
qualify=yes qualify=yes
host=10.103.8.65 host=10.113.8.61
context=from-internal context=from-internal
trunk=yes trunk=yes
disallow=all disallow=all
allow=ulaw allow=ulaw
User Context: edison328 edison316

User details: type=user type=user
secret=xxxxxx secret=xxxxxx
host=10.103.8.65 host=10.113.8.61
context=from-internal context=from-internal
disallow=all disallow=all
allow=ulaw allow=ulaw
Registration string: None None

Call log from branch location:

Apr 16 13:06:19

VERBOSE

[2913] netsock2.c:

== Using SIP RTP TOS bits 184

Apr 16 13:06:19

VERBOSE

[2913] netsock2.c:

== Using SIP RTP CoS mark 5

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [92607020@from-internal:1] Macro("SIP/7800-0000003a", "user-callerid,SKIPTTL,") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-user-callerid:1] Set("SIP/7800-0000003a", "AMPUSER=7800") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-user-callerid:2] GotoIf("SIP/7800-0000003a", "0?report") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-user-callerid:3] ExecIf("SIP/7800-0000003a", "1?Set(REALCALLERIDNUM=7800)") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-user-callerid:4] Set("SIP/7800-0000003a", "AMPUSER=7800") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-user-callerid:5] Set("SIP/7800-0000003a", "AMPUSERCIDNAME=CES Testphone") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-user-callerid:6] GotoIf("SIP/7800-0000003a", "0?report") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-user-callerid:7] Set("SIP/7800-0000003a", "AMPUSERCID=7800") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-user-callerid:8] Set("SIP/7800-0000003a", "CALLERID(all)="CES Testphone" <7800>") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-user-callerid:9] ExecIf("SIP/7800-0000003a", "0?Set(CHANNEL(language)=)") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-user-callerid:10] GotoIf("SIP/7800-0000003a", "1?continue") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Goto (macro-user-callerid,s,19)

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-user-callerid:19] Set("SIP/7800-0000003a", "CALLERID(number)=7800") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-user-callerid:20] Set("SIP/7800-0000003a", "CALLERID(name)=CES Testphone") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-user-callerid:21] NoOp("SIP/7800-0000003a", "Using CallerID "CES Testphone" <7800>") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [92607020@from-internal:2] NoOp("SIP/7800-0000003a", "Calling Out Route: Cranberry_External") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [92607020@from-internal:3] Set("SIP/7800-0000003a", "INTRACOMPANYROUTE=YES") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [92607020@from-internal:4] Set("SIP/7800-0000003a", "MOHCLASS=default") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [92607020@from-internal:5] Set("SIP/7800-0000003a", "_NODEST=") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [92607020@from-internal:6] Macro("SIP/7800-0000003a", "record-enable,7800,OUT,") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-record-enable:1] GotoIf("SIP/7800-0000003a", "1?check") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Goto (macro-record-enable,s,4)

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-record-enable:4] ExecIf("SIP/7800-0000003a", "0?MacroExit()") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-record-enable:5] GotoIf("SIP/7800-0000003a", "0?Group:OUT") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Goto (macro-record-enable,s,15)

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-record-enable:15] GotoIf("SIP/7800-0000003a", "0?IN") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-record-enable:16] ExecIf("SIP/7800-0000003a", "1?MacroExit()") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [92607020@from-internal:7] Macro("SIP/7800-0000003a", "dialout-trunk,2,2607020,") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-dialout-trunk:1] Set("SIP/7800-0000003a", "DIAL_TRUNK=2") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-dialout-trunk:2] GosubIf("SIP/7800-0000003a", "0?sub-pincheck,s,1") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-dialout-trunk:3] GotoIf("SIP/7800-0000003a", "0?disabletrunk,1") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-dialout-trunk:4] Set("SIP/7800-0000003a", "DIAL_NUMBER=2607020") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-dialout-trunk:5] Set("SIP/7800-0000003a", "DIAL_TRUNK_OPTIONS=tr") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-dialout-trunk:6] Set("SIP/7800-0000003a", "OUTBOUND_GROUP=OUT_2") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-dialout-trunk:7] GotoIf("SIP/7800-0000003a", "1?nomax") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Goto (macro-dialout-trunk,s,9)

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-dialout-trunk:9] GotoIf("SIP/7800-0000003a", "1?skipoutcid") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Goto (macro-dialout-trunk,s,12)

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-dialout-trunk:12] GosubIf("SIP/7800-0000003a", "0?sub-flp-2,s,1") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-dialout-trunk:13] Set("SIP/7800-0000003a", "OUTNUM=2607020") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-dialout-trunk:14] Set("SIP/7800-0000003a", "custom=IAX2/edison328") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-dialout-trunk:15] ExecIf("SIP/7800-0000003a", "0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)tr)") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-dialout-trunk:16] Macro("SIP/7800-0000003a", "dialout-trunk-predial-hook,") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit("SIP/7800-0000003a", "") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-dialout-trunk:17] GotoIf("SIP/7800-0000003a", "0?bypass,1") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-dialout-trunk:18] GotoIf("SIP/7800-0000003a", "0?customtrunk") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-dialout-trunk:19] Dial("SIP/7800-0000003a", "IAX2/edison328/2607020,300,tr") in new stack

Apr 16 13:06:19

VERBOSE

[24153] app_dial.c:

-- Called IAX2/edison328/2607020

Apr 16 13:06:19

NOTICE

[2903] chan_iax2.c:

Host 10.116.8.65 failed to authenticate as 888

Apr 16 13:06:19

WARNING

[2908] chan_iax2.c:

Call rejected by 10.116.8.65: No authority found

Apr 16 13:06:19

VERBOSE

[24153] chan_iax2.c:

-- Hungup 'IAX2/edison328-18989'

Apr 16 13:06:19

VERBOSE

[24153] app_dial.c:

== Everyone is busy/congested at this time (1:0/0/1)

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-dialout-trunk:20] NoOp("SIP/7800-0000003a", "Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 50") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-dialout-trunk:21] Goto("SIP/7800-0000003a", "s-CHANUNAVAIL,1") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s-CHANUNAVAIL@macro-dialout-trunk:1] Set("SIP/7800-0000003a", "RC=50") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s-CHANUNAVAIL@macro-dialout-trunk:2] Goto("SIP/7800-0000003a", "50,1") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Goto (macro-dialout-trunk,50,1)

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [50@macro-dialout-trunk:1] Goto("SIP/7800-0000003a", "continue,1") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Goto (macro-dialout-trunk,continue,1)

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [continue@macro-dialout-trunk:1] GotoIf("SIP/7800-0000003a", "1?noreport") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Goto (macro-dialout-trunk,continue,3)

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [continue@macro-dialout-trunk:3] NoOp("SIP/7800-0000003a", "TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 50 - failing through to other trunks") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [continue@macro-dialout-trunk:4] Set("SIP/7800-0000003a", "CALLERID(number)=7800") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [92607020@from-internal:8] Macro("SIP/7800-0000003a", "outisbusy,") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-outisbusy:1] Progress("SIP/7800-0000003a", "") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-outisbusy:2] GotoIf("SIP/7800-0000003a", "0?emergency,1") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-outisbusy:3] GotoIf("SIP/7800-0000003a", "1?intracompany,1") in new stack

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Goto (macro-outisbusy,intracompany,1)

Apr 16 13:06:19

VERBOSE

[24153] pbx.c:

-- Executing [intracompany@macro-outisbusy:1] Playback("SIP/7800-0000003a", "all-circuits-busy-now&pls-try-call-later, noanswer") in new stack

Apr 16 13:06:19

VERBOSE

[24153] file.c:

-- Playing 'all-circuits-busy-now.gsm' (language 'en')

Apr 16 13:06:21

VERBOSE

[24153] file.c:

-- Playing 'pls-try-call-later.gsm' (language 'en')

Apr 16 13:06:23

VERBOSE

[24153] pbx.c:

-- Executing [intracompany@macro-outisbusy:2] Congestion("SIP/7800-0000003a", "20") in new stack

Apr 16 13:06:23

WARNING

[24153] channel.c:

Prodding channel 'SIP/7800-0000003a' failed

Apr 16 13:06:23

VERBOSE

[24153] app_macro.c:

== Spawn extension (macro-outisbusy, intracompany, 2) exited non-zero on 'SIP/7800-0000003a' in macro 'outisbusy'

Apr 16 13:06:23

VERBOSE

[24153] pbx.c:

== Spawn extension (from-internal, 92607020, 8) exited non-zero on 'SIP/7800-0000003a'

Apr 16 13:06:23

VERBOSE

[24153] pbx.c:

-- Executing [h@from-internal:1] Macro("SIP/7800-0000003a", "hangupcall") in new stack

Apr 16 13:06:23

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-hangupcall:1] GotoIf("SIP/7800-0000003a", "1?endmixmoncheck") in new stack

Apr 16 13:06:23

VERBOSE

[24153] pbx.c:

-- Goto (macro-hangupcall,s,9)

Apr 16 13:06:23

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-hangupcall:9] NoOp("SIP/7800-0000003a", "End of MIXMON check") in new stack

Apr 16 13:06:23

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-hangupcall:10] GotoIf("SIP/7800-0000003a", "1?nomeetmemon") in new stack

Apr 16 13:06:23

VERBOSE

[24153] pbx.c:

-- Goto (macro-hangupcall,s,28)

Apr 16 13:06:23

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-hangupcall:28] NoOp("SIP/7800-0000003a", "End of MEETME check") in new stack

Apr 16 13:06:23

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-hangupcall:29] GotoIf("SIP/7800-0000003a", "1?noautomon") in new stack

Apr 16 13:06:23

VERBOSE

[24153] pbx.c:

-- Goto (macro-hangupcall,s,34)

Apr 16 13:06:23

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-hangupcall:34] NoOp("SIP/7800-0000003a", "TOUCH_MONITOR_OUTPUT=") in new stack

Apr 16 13:06:23

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-hangupcall:35] GotoIf("SIP/7800-0000003a", "1?noautomon2") in new stack

Apr 16 13:06:23

VERBOSE

[24153] pbx.c:

-- Goto (macro-hangupcall,s,41)

Apr 16 13:06:23

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-hangupcall:41] NoOp("SIP/7800-0000003a", "MONITOR_FILENAME=") in new stack

Apr 16 13:06:23

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-hangupcall:42] GotoIf("SIP/7800-0000003a", "1?skiprg") in new stack

Apr 16 13:06:23

VERBOSE

[24153] pbx.c:

-- Goto (macro-hangupcall,s,45)

Apr 16 13:06:23

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-hangupcall:45] GotoIf("SIP/7800-0000003a", "1?skipblkvm") in new stack

Apr 16 13:06:23

VERBOSE

[24153] pbx.c:

-- Goto (macro-hangupcall,s,48)

Apr 16 13:06:23

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-hangupcall:48] GotoIf("SIP/7800-0000003a", "1?theend") in new stack

Apr 16 13:06:23

VERBOSE

[24153] pbx.c:

-- Goto (macro-hangupcall,s,50)

Apr 16 13:06:23

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-hangupcall:50] AGI("SIP/7800-0000003a", "hangup.agi") in new stack

Apr 16 13:06:23

VERBOSE

[24153] res_agi.c:

-- Launched AGI Script /var/lib/asterisk/agi-bin/hangup.agi

Apr 16 13:06:23

VERBOSE

[24153] res_agi.c:

-- AGI Script hangup.agi completed, returning 0

Apr 16 13:06:23

VERBOSE

[24153] pbx.c:

-- Executing [s@macro-hangupcall:51] Hangup("SIP/7800-0000003a", "") in new stack

Apr 16 13:06:23

VERBOSE

[24153] app_macro.c:

== Spawn extension (macro-hangupcall, s, 51) exited non-zero on 'SIP/7800-0000003a' in macro 'hangupcall'

Apr 16 13:06:23

VERBOSE

[24153] pbx.c:

== Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/7800-0000003a'

Pretty obvious here if you had actually read your logs, have you checked your calltoken setup?

Apr 16 13:06:19

NOTICE

[2903] chan_iax2.c:

Host 10.116.8.65 failed to authenticate as 888

Apr 16 13:06:19

WARNING

[2908] chan_iax2.c:

Call rejected by 10.116.8.65: No authority found

Apr 16 13:06:19

VERBOSE

[24153] chan_iax2.c:

– Hungup ‘IAX2/edison328-18989’

All that and the only line that mattered was this:

Host 10.116.8.65 failed to authenticate as 888

Apr 16 13:06:19

WARNING

[2908] chan_iax2.c:

Call rejected by 10.116.8.65: No authority found

Do you have those repetitive lines in the server? You also don’t want two duplicate trunks, leave incoming trunk blank (that’s only for a different server).

Use type = friend

Only one allow statement.

You need a username that matches.

You need to name the trunks the same in both systems (not the FreePBX name, the one right above the trunk settings page.

You also need to setup global IAX with the maxsessions and auth stuff (don’t know by heart, in docs)

I have checked my iax_general config files and they look good. What should I be looking for?

Thanks for the help

SkykingOH

  The layout of my earlier post got meshed, I do not have the repetitive lines as it would appear. The table view would have shown that it is the IAX2 configurations on both the branch and central locations.

  I have made the changes that you recommended but am still having the same issue. Our primary goal is to have all external calls pipe through our central location, using two PRI lines that will be moved to the FreePBX server. Since internal extensions between the branch and central location work, I have proved proof of concept there but getting the two servers to communicate for external calls is killing me. :-)

  I have been told that using a SIP trunk would be easier but from what I have read, since I am using the same version of Asterisk, IAX would be better. Is there any truth to this? 

  Many thanks to everyone for there help and please continue to point me in the right direction.

IAX is much easier and only requires a single port.

You can worry about call routing later. Right now you can’t use the trunk.

You have not told me what you have setup. You should not be editing iax_general config.

Send the entire contents of both iax_additional config files please. If you are using public IP’s please redact them.

While reviewing my settings, I found the issue. The dialed number manipulation rule, from the branch location, was configured incorrectly. Once I corrected that, I could make external calls from the branch location.

This now proves two of my proof-of-concept items, so I am on my way. I am sure I will have additional questions soon. :slight_smile:

By far this is the most responsive and cooperative forum I have had the pleasure to work with. Many thanks.

That doesn’t explain why your IAX is showing authentication errors. That still needs to be resolved.

Glad you like the team