Hi guys,
I’m trying to connect my 2 FreePBX boxes together.
Both are FreePBX 14.0.1rc1.17
On server1, I have extensions 2xxx
On server2, I have extensions 4xxx
External calls go only to server1 (server2 cannot receive external calls, only from internal on system1 (extensions 2xxx))
Server2 cannot make any outgoing calls, not even to server1
I setup the IAX2 Trunks on both servers, with Outbound Route on server1, but when I call from server1 to any 4xxx extension, I get "all circuits busy now"
Here is the CLI output:
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Executing [[email protected]:1] Macro(“SIP/1010-00000008”, “user-callerid,LIMIT”) in new stack
– Executing [[email protected]:1] Set(“SIP/1010-00000008”, “TOUCH_MONITOR=1497453103.15”) in new stack
– Executing [[email protected]:2] Set(“SIP/1010-00000008”, “AMPUSER=1010”) in new stack
– Executing [[email protected]:3] GotoIf(“SIP/1010-00000008”, “0?report”) in new stack
– Executing [[email protected]:4] ExecIf(“SIP/1010-00000008”, “1?Set(__REALCALLERIDNUM=1010)”) in new stack
– Executing [[email protected]:5] Set(“SIP/1010-00000008”, “AMPUSER=1010”) in new stack
– Executing [[email protected]:6] GotoIf(“SIP/1010-00000008”, “0?limit”) in new stack
– Executing [[email protected]:7] Set(“SIP/1010-00000008”, “AMPUSERCIDNAME=1010”) in new stack
– Executing [[email protected]:8] GotoIf(“SIP/1010-00000008”, “0?report”) in new stack
– Executing [[email protected]:9] Set(“SIP/1010-00000008”, “AMPUSERCID=1010”) in new stack
– Executing [[email protected]:10] Set(“SIP/1010-00000008”, “__DIAL_OPTIONS=Ttr”) in new stack
– Executing [[email protected]:11] Set(“SIP/1010-00000008”, “CALLERID(all)=“1010” <1010>”) in new stack
– Executing [[email protected]:12] GotoIf(“SIP/1010-00000008”, “0?limit”) in new stack
– Executing [[email protected]:13] ExecIf(“SIP/1010-00000008”, “1?Set(GROUP(concurrency_limit)=1010)”) in new stack
– Executing [[email protected]:14] ExecIf(“SIP/1010-00000008”, “0?Set(CHANNEL(language)=)”) in new stack
– Executing [[email protected]:15] GotoIf(“SIP/1010-00000008”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,29)
– Executing [[email protected]:29] Set(“SIP/1010-00000008”, “CALLERID(number)=1010”) in new stack
– Executing [[email protected]:30] Set(“SIP/1010-00000008”, “CALLERID(name)=1010”) in new stack
– Executing [[email protected]:31] GotoIf(“SIP/1010-00000008”, “0?cnum”) in new stack
– Executing [[email protected]:32] Set(“SIP/1010-00000008”, “CDR(cnam)=1010”) in new stack
– Executing [[email protected]:33] Set(“SIP/1010-00000008”, “CDR(cnum)=1010”) in new stack
– Executing [[email protected]:34] Set(“SIP/1010-00000008”, “CHANNEL(language)=en”) in new stack
– Executing [[email protected]:35] GosubIf(“SIP/1010-00000008”, “0?app-check-classofservce,s,1()”) in new stack
– Executing [[email protected]:2] Set(“SIP/1010-00000008”, “ROUTEUSER=1010”) in new stack
– Executing [[email protected]:3] GotoIf(“SIP/1010-00000008”, “1?notblind”) in new stack
– Goto (from-internal,4701,6)
– Executing [[email protected]:6] GotoIf(“SIP/1010-00000008”, “1?restrictedroute-13cee27a2bd93915479f049378cffdd3,4701,2:outbound-allroutes,4701,2”) in new stack
– Goto (restrictedroute-13cee27a2bd93915479f049378cffdd3,4701,2)
– Executing [[email protected]:2] Gosub(“SIP/1010-00000008”, “sub-record-check,s,1(out,4701,never)”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/1010-00000008”, “0?initialized”) in new stack
– Executing [[email protected]:2] Set(“SIP/1010-00000008”, “__REC_STATUS=INITIALIZED”) in new stack
– Executing [[email protected]:3] Set(“SIP/1010-00000008”, “NOW=1497453103”) in new stack
– Executing [[email protected]:4] Set(“SIP/1010-00000008”, “__DAY=14”) in new stack
– Executing [[email protected]:5] Set(“SIP/1010-00000008”, “__MONTH=06”) in new stack
– Executing [[email protected]:6] Set(“SIP/1010-00000008”, “__YEAR=2017”) in new stack
– Executing [[email protected]:7] Set(“SIP/1010-00000008”, “__TIMESTR=20170614-151143”) in new stack
– Executing [[email protected]:8] Set(“SIP/1010-00000008”, “__FROMEXTEN=1010”) in new stack
– Executing [[email protected]:9] Set(“SIP/1010-00000008”, “__MON_FMT=wav”) in new stack
– Executing [[email protected]:10] NoOp(“SIP/1010-00000008”, “Recordings initialized”) in new stack
– Executing [[email protected]:11] ExecIf(“SIP/1010-00000008”, “0?Set(ARG3=dontcare)”) in new stack
– Executing [[email protected]:12] Set(“SIP/1010-00000008”, “REC_POLICY_MODE_SAVE=”) in new stack
– Executing [[email protected]:13] ExecIf(“SIP/1010-00000008”, “0?Set(REC_STATUS=NO)”) in new stack
– Executing [[email protected]:14] GotoIf(“SIP/1010-00000008”, “3?checkaction”) in new stack
– Goto (sub-record-check,s,17)
– Executing [[email protected]:17] GotoIf(“SIP/1010-00000008”, “1?sub-record-check,out,1”) in new stack
– Goto (sub-record-check,out,1)
– Executing [[email protected]:1] NoOp(“SIP/1010-00000008”, “Outbound Recording Check from 1010 to 4701”) in new stack
– Executing [[email protected]:2] Set(“SIP/1010-00000008”, “RECMODE=dontcare”) in new stack
– Executing [[email protected]:3] ExecIf(“SIP/1010-00000008”, “1?Goto(routewins)”) in new stack
– Goto (sub-record-check,out,7)
– Executing [[email protected]:7] Gosub(“SIP/1010-00000008”, “recordcheck,1(never,out,4701)”) in new stack
– Executing [[email protected]:1] NoOp(“SIP/1010-00000008”, “Starting recording check against never”) in new stack
– Executing [[email protected]:2] Goto(“SIP/1010-00000008”, “never”) in new stack
– Goto (sub-record-check,recordcheck,14)
– Executing [[email protected]:14] Set(“SIP/1010-00000008”, “__REC_POLICY_MODE=NEVER”) in new stack
– Executing [[email protected]:15] Goto(“SIP/1010-00000008”, “stoprec”) in new stack
– Goto (sub-record-check,recordcheck,25)
– Executing [[email protected]:25] NoOp(“SIP/1010-00000008”, “Stopping recording: out, 4701”) in new stack
– Executing [[email protected]:26] Set(“SIP/1010-00000008”, “__REC_STATUS=STOPPED”) in new stack
– Executing [[email protected]:27] System(“SIP/1010-00000008”, "/var/lib/asterisk/bin/stoprecording.php “SIP/1010-00000008"”) in new stack
– Executing [[email protected]:28] Return(“SIP/1010-00000008”, “”) in new stack
– Executing [[email protected]:8] Return(“SIP/1010-00000008”, “”) in new stack
– Executing [[email protected]:3] ExecIf(“SIP/1010-00000008”, “0 ?Set(CDR(accountcode)=)”) in new stack
– Executing [[email protected]:4] Set(“SIP/1010-00000008”, “INTRACOMPANYROUTE=YES”) in new stack
– Executing [[email protected]:5] Set(“SIP/1010-00000008”, “MOHCLASS=default”) in new stack
– Executing [[email protected]:6] Set(“SIP/1010-00000008”, “_NODEST=”) in new stack
– Executing [[email protected]:7] Macro(“SIP/1010-00000008”, “dialout-trunk,3,4701,off”) in new stack
– Executing [[email protected]:1] Set(“SIP/1010-00000008”, “DIAL_TRUNK=3”) in new stack
– Executing [[email protected]:2] GosubIf(“SIP/1010-00000008”, “0?sub-pincheck,s,1()”) in new stack
– Executing [[email protected]:3] GotoIf(“SIP/1010-00000008”, “0?disabletrunk,1”) in new stack
– Executing [[email protected]:4] Set(“SIP/1010-00000008”, “DIAL_NUMBER=4701”) in new stack
– Executing [[email protected]:5] Set(“SIP/1010-00000008”, “DIAL_TRUNK_OPTIONS=Ttr”) in new stack
– Executing [[email protected]:6] Set(“SIP/1010-00000008”, “OUTBOUND_GROUP=OUT_3”) in new stack
– Executing [[email protected]:7] GotoIf(“SIP/1010-00000008”, “1?nomax”) in new stack
– Goto (macro-dialout-trunk,s,9)
– Executing [[email protected]:9] GotoIf(“SIP/1010-00000008”, “1?skipoutcid”) in new stack
– Goto (macro-dialout-trunk,s,12)
– Executing [[email protected]:12] GosubIf(“SIP/1010-00000008”, “0?sub-flp-3,s,1()”) in new stack
– Executing [[email protected]:13] Set(“SIP/1010-00000008”, “OUTNUM=4701”) in new stack
– Executing [[email protected]:14] Set(“SIP/1010-00000008”, “custom=IAX2/VOIP_CONNECTION”) in new stack
– Executing [[email protected]:15] ExecIf(“SIP/1010-00000008”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)Ttr)”) in new stack
– Executing [[email protected]:16] ExecIf(“SIP/1010-00000008”, “0?Set(DIAL_TRUNK_OPTIONS=TtrM(confirm))”) in new stack
– Executing [[email protected]:17] Macro(“SIP/1010-00000008”, “dialout-trunk-predial-hook,”) in new stack
– Executing [[email protected]:1] MacroExit(“SIP/1010-00000008”, “”) in new stack
– Executing [[email protected]:18] GotoIf(“SIP/1010-00000008”, “0?skipcrm”) in new stack
– Executing [[email protected]:19] Set(“SIP/1010-00000008”, “__CRM_DIRECTION=OUTBOUND”) in new stack
– Executing [[email protected]:20] Set(“SIP/1010-00000008”, “__CRM_DESTINATION=4701”) in new stack
– Executing [[email protected]:21] Set(“SIP/1010-00000008”, “__CRM_SOURCE=1010”) in new stack
– Executing [[email protected]:22] AGI(“SIP/1010-00000008”, “sangomacrm.agi”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/sangomacrm.agi
– <SIP/1010-00000008>AGI Script sangomacrm.agi completed, returning 0
– Executing [[email protected]:23] Set(“SIP/1010-00000008”, “CHANNEL(hangup_handler_push)=crm-hangup,s,1”) in new stack
– Executing [[email protected]:24] NoOp(“SIP/1010-00000008”, “CRM Finished”) in new stack
– Executing [[email protected]:25] GotoIf(“SIP/1010-00000008”, “0?bypass,1”) in new stack
– Executing [[email protected]:26] ExecIf(“SIP/1010-00000008”, “1?Set(CONNECTEDLINE(num,i)=4701)”) in new stack
– Executing [[email protected]:27] ExecIf(“SIP/1010-00000008”, “1?Set(CONNECTEDLINE(name,i)=CID:1010)”) in new stack
– Executing [[email protected]:28] ExecIf(“SIP/1010-00000008”, “0?Set(CONNECTEDLINE(name,i)=CID:(Hidden)1010)”) in new stack
– Executing [[email protected]:29] GotoIf(“SIP/1010-00000008”, “0?customtrunk”) in new stack
– Executing [[email protected]:30] Dial(“SIP/1010-00000008”, “IAX2/VOIP_CONNECTION/4701,300,Ttr”) in new stack
– Called IAX2/VOIP_CONNECTION/4701
– Hungup ‘IAX2/VOIP_CONNECTION-17597’
== Everyone is busy/congested at this time (1:0/0/1)
– Executing [[email protected]:31] NoOp(“SIP/1010-00000008”, “Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 50”) in new stack
– Executing [[email protected]:32] GotoIf(“SIP/1010-00000008”, “0?continue,1:s-CHANUNAVAIL,1”) in new stack
– Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
– Executing [[email protected]:1] Set(“SIP/1010-00000008”, “RC=50”) in new stack
– Executing [[email protected]:2] Goto(“SIP/1010-00000008”, “50,1”) in new stack
– Goto (macro-dialout-trunk,50,1)
– Executing [[email protected]:1] Goto(“SIP/1010-00000008”, “continue,1”) in new stack
– Goto (macro-dialout-trunk,continue,1)
– Executing [[email protected]:1] NoOp(“SIP/1010-00000008”, “TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 50 - failing through to other trunks”) in new stack
– Executing [[email protected]:2] ExecIf(“SIP/1010-00000008”, “1?Set(CALLERID(number)=1010)”) in new stack
– Executing [[email protected]:8] Macro(“SIP/1010-00000008”, “outisbusy,”) in new stack
– Executing [[email protected]:1] Progress(“SIP/1010-00000008”, “”) in new stack
– Executing [[email protected]:2] GotoIf(“SIP/1010-00000008”, “0?emergency,1”) in new stack
– Executing [[email protected]:3] GotoIf(“SIP/1010-00000008”, “1?intracompany,1”) in new stack
– Goto (macro-outisbusy,intracompany,1)
– Executing [[email protected]:1] Playback(“SIP/1010-00000008”, “all-circuits-busy-now&please-try-call-later, noanswer”) in new stack
– <SIP/1010-00000008> Playing ‘all-circuits-busy-now.ulaw’ (language ‘en’)
> 0x7f40d80168f0 – Probation passed - setting RTP source address to 192.168.111.56:16432
– <SIP/1010-00000008> Playing ‘please-try-call-later.ulaw’ (language ‘en’)
– Executing [[email protected]:2] Congestion(“SIP/1010-00000008”, “20”) in new stack
[2017-06-14 15:11:47] WARNING[8560][C-00000009]: channel.c:4991 ast_prod: Prodding channel ‘SIP/1010-00000008’ failed
== Spawn extension (macro-outisbusy, intracompany, 2) exited non-zero on ‘SIP/1010-00000008’ in macro ‘outisbusy’
== Spawn extension (restrictedroute-13cee27a2bd93915479f049378cffdd3, 4701, 8) exited non-zero on ‘SIP/1010-00000008’
– Executing [[email protected]:1] Hangup(“SIP/1010-00000008”, “”) in new stack
== Spawn extension (restrictedroute-13cee27a2bd93915479f049378cffdd3, h, 1) exited non-zero on ‘SIP/1010-00000008’
– SIP/1010-00000008 Internal Gosub(crm-hangup,s,1) start
– Executing [[email protected]:1] NoOp(“SIP/1010-00000008”, “Sending Hangup to CRM”) in new stack
– Executing [[email protected]:2] NoOp(“SIP/1010-00000008”, “HANGUP CAUSE: 34”) in new stack
– Executing [[email protected]:3] ExecIf(“SIP/1010-00000008”, “0?Set(__CRM_VOICEMAIL=)”) in new stack
– Executing [[email protected]:4] NoOp(“SIP/1010-00000008”, “MASTER CHANNEL: 1497453103.15 = 1497453103.15”) in new stack
– Executing [[email protected]:5] GotoIf(“SIP/1010-00000008”, “0?return”) in new stack
– Executing [[email protected]:6] Set(“SIP/1010-00000008”, “__CRM_HANGUP=1”) in new stack
– Executing [[email protected]:7] AGI(“SIP/1010-00000008”, “sangomacrm.agi”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/sangomacrm.agi
– <SIP/1010-00000008>AGI Script sangomacrm.agi completed, returning 0
– Executing [[email protected]:8] Return(“SIP/1010-00000008”, “”) in new stack
== Spawn extension (restrictedroute-13cee27a2bd93915479f049378cffdd3, h, 1) exited non-zero on ‘SIP/1010-00000008’
– SIP/1010-00000008 Internal Gosub(crm-hangup,s,1) complete GOSUB_RETVAL=
Here is the IAX2 Trunk configuration:
Server1:
General:
Trunk Name = VOIP_CONNECTION
Hide CallerID = No
Outbound CallerID = Blank
CID Options = Allow Any CID
Maximum Channels = Blank
Asterisk Trunk Dial Options = T (this field is grayed out, I can’t change it) and the button is on System
Continue if Busy = No
Disable Trunk = No
Dial Number Manipulation Rules = Blank
IAX Settings:
Outgoing:
Trunk Name = VOIP_CONNECTION
PEER Details =
username=admin
secret=password
host=ip-of-server2
type=friend
context=from-internal
qualify=yes
qualifyfreqok=25000
transfer=no
trunk=yes
forceencryption=yes
encryption=yes
auth=md5
requirecalltoken=no
Server2 is exactly the same, with 1 difference:
in PEER Details, host=ip-of-server1
On both servers:
CLI> iax2 show peers
Server1:
Name/Username Host Mask Port Status Description
VOIP_CONNECTION ip-of-server2 (S) 255.255.255.255 4569 (T) (E) OK (3 ms)
1 iax2 peers [1 online, 0 offline, 0 unmonitored]
Server2:
Name/Username Host Mask Port Status Description
VOIP_CONNECTION ip-of-server1 (S) 255.255.255.255 4569 (T) (E) OK (1 ms)
1 iax2 peers [1 online, 0 offline, 0 unmonitored]
Can anyone help here?
Thanks