Not dialing out to trunks from ext within LAN

Hi! I have Asterisk set up to work within LAN as well as from WAN. I’ve used Cisco 7960, Aastra 480i, Grandstream BT201, x-lite softphones and Bria on iPhone. Cisco and Aastra are witin LAN configured with local ip address of pbx ; x-lite, Grandstream and Bria are configured WAN ip address of pbx. All phones are registered and online. I can call extension, recieve calls from extensions, recieve calls from trunks. But phones in LAN can not make outgoing calls via trunks. When I connect Grandstream and Bria to LAN they work fine. When I program Cisco and Aastra with WAN ip address of pbx they dont register as they don’t support STUN I think. But the issue is they dont dial out to trunk.I have 3 trunks in Outbound Route and non of them is being picked up. I was checking debug logs and I can’t find any error. Is there anythink I’m missing? Its Asterisk (Ver. 1.6.2.20) with FreePBX Ver. 2.10

localhost*CLI> sip set debug peer 202
SIP Debugging Enabled for IP: 10.0.1.18:5060
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5

<— Reliably Transmitting (no NAT) to 10.0.1.18:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 10.0.1.18:5060;branch=z9hG4bK7bc38661;received=10.0.1.18
From: “202” sip:[email protected];tag=003094c2678c00257f470880-7d2e99ad
To: sip:[email protected];tag=as32d49056
Call-ID: [email protected]
CSeq: 101 INVITE
Server: FPBX-2.10.0(1.6.2.20)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce="387128a7"
Content-Length: 0

<------------>
Scheduling destruction of SIP dialog ‘[email protected]’ in 6400 ms (Method: INVITE)
Sending to 10.0.1.18 : 5060 (no NAT)
Using INVITE request as basis request - [email protected]
Found RTP audio format 0
Found RTP audio format 8
Found RTP audio format 18
Found RTP audio format 101
Found audio description format PCMU for ID 0
Found audio description format PCMA for ID 8
Found audio description format G729 for ID 18
Found audio description format telephone-event for ID 101
Capabilities: us - 0x191f (g723|gsm|ulaw|alaw|g726|g729|g726aal2|g722), peer - audio=0x10c (ulaw|alaw|g729)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0x10c (ulaw|alaw|g729)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1 (telephone-event), combined - 0x1 (telephone-event)
Peer audio RTP is at port 10.0.1.18:18616
Looking for 9815356789 in from-internal (domain 10.0.1.11)
list_route: hop: sip:[email protected]:5060;transport=udp

<— Transmitting (no NAT) to 10.0.1.18:5060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.0.1.18:5060;branch=z9hG4bK3c192c36;received=10.0.1.18
From: “202” sip:[email protected];tag=003094c2678c00257f470880-7d2e99ad
To: sip:[email protected]
Call-ID: [email protected]
CSeq: 102 INVITE
Server: FPBX-2.10.0(1.6.2.20)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Contact: sip:[email protected]
Content-Length: 0

<------------>
– Executing [9815356789@from-internal:1] Macro(“SIP/202-000000e4”, “user-callerid,LIMIT,”) in new stack
– Executing [s@macro-user-callerid:1] Set(“SIP/202-000000e4”, “AMPUSER=202”) in new stack
– Executing [s@macro-user-callerid:2] GotoIf(“SIP/202-000000e4”, “0?report”) in new stack
– Executing [s@macro-user-callerid:3] ExecIf(“SIP/202-000000e4”, “1?Set(REALCALLERIDNUM=202)”) in new stack
– Executing [s@macro-user-callerid:4] Set(“SIP/202-000000e4”, “AMPUSER=202”) in new stack
– Executing [s@macro-user-callerid:5] Set(“SIP/202-000000e4”, “AMPUSERCIDNAME=Cisco”) in new stack
– Executing [s@macro-user-callerid:6] GotoIf(“SIP/202-000000e4”, “0?report”) in new stack
– Executing [s@macro-user-callerid:7] Set(“SIP/202-000000e4”, “AMPUSERCID=202”) in new stack
– Executing [s@macro-user-callerid:8] Set(“SIP/202-000000e4”, “CALLERID(all)=“Cisco” <202>”) in new stack
– Executing [s@macro-user-callerid:9] GotoIf(“SIP/202-000000e4”, “0?limit”) in new stack
– Executing [s@macro-user-callerid:10] ExecIf(“SIP/202-000000e4”, “1?Set(GROUP(concurrency_limit)=202)”) in new stack
– Executing [s@macro-user-callerid:11] ExecIf(“SIP/202-000000e4”, “1?Set(CHANNEL(language)=en)”) in new stack
– Executing [s@macro-user-callerid:12] GotoIf(“SIP/202-000000e4”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,25)
– Executing [s@macro-user-callerid:25] Set(“SIP/202-000000e4”, “CALLERID(number)=202”) in new stack
– Executing [s@macro-user-callerid:26] Set(“SIP/202-000000e4”, “CALLERID(name)=Cisco”) in new stack
– Executing [9815356789@from-internal:2] Set(“SIP/202-000000e4”, “MOHCLASS=default”) in new stack
– Executing [9815356789@from-internal:3] Set(“SIP/202-000000e4”, “_NODEST=”) in new stack
– Executing [9815356789@from-internal:4] Gosub(“SIP/202-000000e4”, “sub-record-check,s,1(out,9815356789,)”) in new stack
– Executing [s@sub-record-check:1] GotoIf(“SIP/202-000000e4”, “1?check”) in new stack
– Goto (sub-record-check,s,6)
– Executing [s@sub-record-check:6] Set(“SIP/202-000000e4”, “__MON_FMT=wav”) in new stack
– Executing [s@sub-record-check:7] GotoIf(“SIP/202-000000e4”, “1?next”) in new stack
– Goto (sub-record-check,s,10)
– Executing [s@sub-record-check:10] ExecIf(“SIP/202-000000e4”, “0?Return()”) in new stack
– Executing [s@sub-record-check:11] GotoIf(“SIP/202-000000e4”, “0?out,1”) in new stack
– Executing [s@sub-record-check:12] Set(“SIP/202-000000e4”, “__REC_STATUS=INITIALIZED”) in new stack
– Executing [s@sub-record-check:13] ExecIf(“SIP/202-000000e4”, “0?Set(__REC_POLICY_MODE=)”) in new stack
– Executing [s@sub-record-check:14] Set(“SIP/202-000000e4”, “NOW=1339942747”) in new stack
– Executing [s@sub-record-check:15] Set(“SIP/202-000000e4”, “__DAY=17”) in new stack
– Executing [s@sub-record-check:16] Set(“SIP/202-000000e4”, “__MONTH=06”) in new stack
– Executing [s@sub-record-check:17] Set(“SIP/202-000000e4”, “__YEAR=2012”) in new stack
– Executing [s@sub-record-check:18] Set(“SIP/202-000000e4”, “__TIMESTR=20120617-151907”) in new stack
– Executing [s@sub-record-check:19] Set(“SIP/202-000000e4”, “__FROMEXTEN=202”) in new stack
– Executing [s@sub-record-check:20] Set(“SIP/202-000000e4”, “__CALLFILENAME=out-9815356789-202-20120617-151907-1339942747.3002”) in new stack
– Executing [s@sub-record-check:21] Goto(“SIP/202-000000e4”, “out,1”) in new stack
– Goto (sub-record-check,out,1)
– Executing [out@sub-record-check:1] ExecIf(“SIP/202-000000e4”, “1?Set(__REC_POLICY_MODE=always)”) in new stack
– Executing [out@sub-record-check:2] GosubIf(“SIP/202-000000e4”, “1?record,1(exten,9815356789,202)”) in new stack
– Executing [record@sub-record-check:1] Set(“SIP/202-000000e4”, “AUDIOHOOK_INHERIT(MixMonitor)=yes”) in new stack
– Executing [record@sub-record-check:2] MixMonitor(“SIP/202-000000e4”, “2012/06/17/out-9815356789-202-20120617-151907-1339942747.3002.wav,”) in new stack
– Executing [record@sub-record-check:3] Set(“SIP/202-000000e4”, “__REC_STATUS=RECORDING”) in new stack
– Executing [record@sub-record-check:4] Set(“SIP/202-000000e4”, “CDR(recordingfile)=out-9815356789-202-20120617-151907-1339942747.3002.wav”) in new stack
– Executing [record@sub-record-check:5] Return(“SIP/202-000000e4”, “”) in new stack
– Executing [out@sub-record-check:3] Return(“SIP/202-000000e4”, “”) in new stack
– Executing [9815356789@from-internal:5] Macro(“SIP/202-000000e4”, “dialout-trunk,3,815356789,”) in new stack
– Executing [s@macro-dialout-trunk:1] Set(“SIP/202-000000e4”, “DIAL_TRUNK=3”) in new stack
– Executing [s@macro-dialout-trunk:2] GosubIf(“SIP/202-000000e4”, “0?sub-pincheck,s,1()”) in new stack
– Executing [s@macro-dialout-trunk:3] GotoIf(“SIP/202-000000e4”, “0?disabletrunk,1”) in new stack
– Executing [s@macro-dialout-trunk:4] Set(“SIP/202-000000e4”, “DIAL_NUMBER=815356789”) in new stack
– Executing [s@macro-dialout-trunk:5] Set(“SIP/202-000000e4”, “DIAL_TRUNK_OPTIONS=tr”) in new stack
– Executing [s@macro-dialout-trunk:6] Set(“SIP/202-000000e4”, “OUTBOUND_GROUP=OUT_3”) in new stack
– Executing [s@macro-dialout-trunk:7] GotoIf(“SIP/202-000000e4”, “0?nomax”) in new stack
– Executing [s@macro-dialout-trunk:8] GotoIf(“SIP/202-000000e4”, “0?chanfull”) in new stack
– Executing [s@macro-dialout-trunk:9] GotoIf(“SIP/202-000000e4”, “0?skipoutcid”) in new stack
– Executing [s@macro-dialout-trunk:10] Set(“SIP/202-000000e4”, “DIAL_TRUNK_OPTIONS=t”) in new stack
– Executing [s@macro-dialout-trunk:11] Macro(“SIP/202-000000e4”, “outbound-callerid,3”) in new stack
– Executing [s@macro-outbound-callerid:1] ExecIf(“SIP/202-000000e4”, “0?Set(CALLERPRES()=)”) in new stack
– Executing [s@macro-outbound-callerid:2] ExecIf(“SIP/202-000000e4”, “0?Set(REALCALLERIDNUM=202)”) in new stack
– Executing [s@macro-outbound-callerid:3] GotoIf(“SIP/202-000000e4”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,6)
– Executing [s@macro-outbound-callerid:6] Set(“SIP/202-000000e4”, “USEROUTCID=”) in new stack
– Executing [s@macro-outbound-callerid:7] Set(“SIP/202-000000e4”, “EMERGENCYCID=”) in new stack
– Executing [s@macro-outbound-callerid:8] Set(“SIP/202-000000e4”, “TRUNKOUTCID=48556202023”) in new stack
– Executing [s@macro-outbound-callerid:9] GotoIf(“SIP/202-000000e4”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,12)
– Executing [s@macro-outbound-callerid:12] ExecIf(“SIP/202-000000e4”, “1?Set(CALLERID(all)=48556202023)”) in new stack
– Executing [s@macro-outbound-callerid:13] ExecIf(“SIP/202-000000e4”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:14] ExecIf(“SIP/202-000000e4”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:15] ExecIf(“SIP/202-000000e4”, “0?Set(CALLERPRES()=prohib_passed_screen)”) in new stack
– Executing [s@macro-dialout-trunk:12] GosubIf(“SIP/202-000000e4”, “0?sub-flp-3,s,1()”) in new stack
– Executing [s@macro-dialout-trunk:13] Set(“SIP/202-000000e4”, “OUTNUM=815356789”) in new stack
– Executing [s@macro-dialout-trunk:14] Set(“SIP/202-000000e4”, “custom=SIP/actio”) in new stack
– Executing [s@macro-dialout-trunk:15] ExecIf(“SIP/202-000000e4”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)t)”) in new stack
– Executing [s@macro-dialout-trunk:16] ExecIf(“SIP/202-000000e4”, “0?Set(DIAL_TRUNK_OPTIONS=tM(confirm))”) in new stack
– Executing [s@macro-dialout-trunk:17] Macro(“SIP/202-000000e4”, “dialout-trunk-predial-hook,”) in new stack
– Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit(“SIP/202-000000e4”, “”) in new stack
– Executing [s@macro-dialout-trunk:18] GotoIf(“SIP/202-000000e4”, “0?bypass,1”) in new stack
– Executing [s@macro-dialout-trunk:19] GotoIf(“SIP/202-000000e4”, “0?customtrunk”) in new stack
– Executing [s@macro-dialout-trunk:20] Dial(“SIP/202-000000e4”, “SIP/actio/815356789,300,t”) in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Couldn’t call actio/815356789
== Everyone is busy/congested at this time (0:0/0/0)
– Executing [s@macro-dialout-trunk:21] NoOp(“SIP/202-000000e4”, “Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 0”) in new stack
– Executing [s@macro-dialout-trunk:22] Goto(“SIP/202-000000e4”, “s-CHANUNAVAIL,1”) in new stack
– Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
– Executing [s-CHANUNAVAIL@macro-dialout-trunk:1] Set(“SIP/202-000000e4”, “RC=0”) in new stack
– Executing [s-CHANUNAVAIL@macro-dialout-trunk:2] Goto(“SIP/202-000000e4”, “0,1”) in new stack
– Goto (macro-dialout-trunk,0,1)
– Executing [0@macro-dialout-trunk:1] Goto(“SIP/202-000000e4”, “continue,1”) in new stack
– Goto (macro-dialout-trunk,continue,1)
– Executing [continue@macro-dialout-trunk:1] GotoIf(“SIP/202-000000e4”, “1?noreport”) in new stack
– Goto (macro-dialout-trunk,continue,3)
– Executing [continue@macro-dialout-trunk:3] NoOp(“SIP/202-000000e4”, “TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 0 - failing through to other trunks”) in new stack
– Executing [continue@macro-dialout-trunk:4] Set(“SIP/202-000000e4”, “CALLERID(number)=202”) in new stack
– Executing [9815356789@from-internal:6] Macro(“SIP/202-000000e4”, “dialout-trunk,2,815356789,”) in new stack
– Executing [s@macro-dialout-trunk:1] Set(“SIP/202-000000e4”, “DIAL_TRUNK=2”) in new stack
– Executing [s@macro-dialout-trunk:2] GosubIf(“SIP/202-000000e4”, “0?sub-pincheck,s,1()”) in new stack
– Executing [s@macro-dialout-trunk:3] GotoIf(“SIP/202-000000e4”, “0?disabletrunk,1”) in new stack
– Executing [s@macro-dialout-trunk:4] Set(“SIP/202-000000e4”, “DIAL_NUMBER=815356789”) in new stack
– Executing [s@macro-dialout-trunk:5] Set(“SIP/202-000000e4”, “DIAL_TRUNK_OPTIONS=tr”) in new stack
– Executing [s@macro-dialout-trunk:6] Set(“SIP/202-000000e4”, “OUTBOUND_GROUP=OUT_2”) in new stack
– Executing [s@macro-dialout-trunk:7] GotoIf(“SIP/202-000000e4”, “0?nomax”) in new stack
– Executing [s@macro-dialout-trunk:8] GotoIf(“SIP/202-000000e4”, “0?chanfull”) in new stack
– Executing [s@macro-dialout-trunk:9] GotoIf(“SIP/202-000000e4”, “0?skipoutcid”) in new stack
– Executing [s@macro-dialout-trunk:10] Set(“SIP/202-000000e4”, “DIAL_TRUNK_OPTIONS=t”) in new stack
– Executing [s@macro-dialout-trunk:11] Macro(“SIP/202-000000e4”, “outbound-callerid,2”) in new stack
– Executing [s@macro-outbound-callerid:1] ExecIf(“SIP/202-000000e4”, “0?Set(CALLERPRES()=)”) in new stack
– Executing [s@macro-outbound-callerid:2] ExecIf(“SIP/202-000000e4”, “0?Set(REALCALLERIDNUM=202)”) in new stack
– Executing [s@macro-outbound-callerid:3] GotoIf(“SIP/202-000000e4”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,6)
– Executing [s@macro-outbound-callerid:6] Set(“SIP/202-000000e4”, “USEROUTCID=”) in new stack
– Executing [s@macro-outbound-callerid:7] Set(“SIP/202-000000e4”, “EMERGENCYCID=”) in new stack
– Executing [s@macro-outbound-callerid:8] Set(“SIP/202-000000e4”, “TRUNKOUTCID=0556119119”) in new stack
– Executing [s@macro-outbound-callerid:9] GotoIf(“SIP/202-000000e4”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,12)
– Executing [s@macro-outbound-callerid:12] ExecIf(“SIP/202-000000e4”, “1?Set(CALLERID(all)=0556119119)”) in new stack
– Executing [s@macro-outbound-callerid:13] ExecIf(“SIP/202-000000e4”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:14] ExecIf(“SIP/202-000000e4”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:15] ExecIf(“SIP/202-000000e4”, “0?Set(CALLERPRES()=prohib_passed_screen)”) in new stack
– Executing [s@macro-dialout-trunk:12] GosubIf(“SIP/202-000000e4”, “0?sub-flp-2,s,1()”) in new stack
– Executing [s@macro-dialout-trunk:13] Set(“SIP/202-000000e4”, “OUTNUM=815356789”) in new stack
– Executing [s@macro-dialout-trunk:14] Set(“SIP/202-000000e4”, “custom=SIP/newfon”) in new stack
– Executing [s@macro-dialout-trunk:15] ExecIf(“SIP/202-000000e4”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)t)”) in new stack
– Executing [s@macro-dialout-trunk:16] ExecIf(“SIP/202-000000e4”, “0?Set(DIAL_TRUNK_OPTIONS=tM(confirm))”) in new stack
– Executing [s@macro-dialout-trunk:17] Macro(“SIP/202-000000e4”, “dialout-trunk-predial-hook,”) in new stack
== Begin MixMonitor Recording SIP/202-000000e4
– Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit(“SIP/202-000000e4”, “”) in new stack
– Executing [s@macro-dialout-trunk:18] GotoIf(“SIP/202-000000e4”, “0?bypass,1”) in new stack
– Executing [s@macro-dialout-trunk:19] GotoIf(“SIP/202-000000e4”, “0?customtrunk”) in new stack
– Executing [s@macro-dialout-trunk:20] Dial(“SIP/202-000000e4”, “SIP/newfon/815356789,300,t”) in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Called newfon/815356789
– SIP/newfon-000000e6 is circuit-busy
== Everyone is busy/congested at this time (1:0/1/0)
– Executing [s@macro-dialout-trunk:21] NoOp(“SIP/202-000000e4”, “Dial failed for some reason with DIALSTATUS = CONGESTION and HANGUPCAUSE = 21”) in new stack
– Executing [s@macro-dialout-trunk:22] Goto(“SIP/202-000000e4”, “s-CONGESTION,1”) in new stack
– Goto (macro-dialout-trunk,s-CONGESTION,1)
– Executing [s-CONGESTION@macro-dialout-trunk:1] Set(“SIP/202-000000e4”, “RC=21”) in new stack
– Executing [s-CONGESTION@macro-dialout-trunk:2] Goto(“SIP/202-000000e4”, “21,1”) in new stack
– Goto (macro-dialout-trunk,21,1)
– Executing [21@macro-dialout-trunk:1] Goto(“SIP/202-000000e4”, “continue,1”) in new stack
– Goto (macro-dialout-trunk,continue,1)
– Executing [continue@macro-dialout-trunk:1] GotoIf(“SIP/202-000000e4”, “1?noreport”) in new stack
– Goto (macro-dialout-trunk,continue,3)
– Executing [continue@macro-dialout-trunk:3] NoOp(“SIP/202-000000e4”, “TRUNK Dial failed due to CONGESTION HANGUPCAUSE: 21 - failing through to other trunks”) in new stack
– Executing [continue@macro-dialout-trunk:4] Set(“SIP/202-000000e4”, “CALLERID(number)=202”) in new stack
– Executing [9815356789@from-internal:7] Macro(“SIP/202-000000e4”, “dialout-trunk,4,815356789,”) in new stack
– Executing [s@macro-dialout-trunk:1] Set(“SIP/202-000000e4”, “DIAL_TRUNK=4”) in new stack
– Executing [s@macro-dialout-trunk:2] GosubIf(“SIP/202-000000e4”, “0?sub-pincheck,s,1()”) in new stack
– Executing [s@macro-dialout-trunk:3] GotoIf(“SIP/202-000000e4”, “0?disabletrunk,1”) in new stack
– Executing [s@macro-dialout-trunk:4] Set(“SIP/202-000000e4”, “DIAL_NUMBER=815356789”) in new stack
– Executing [s@macro-dialout-trunk:5] Set(“SIP/202-000000e4”, “DIAL_TRUNK_OPTIONS=tr”) in new stack
– Executing [s@macro-dialout-trunk:6] Set(“SIP/202-000000e4”, “OUTBOUND_GROUP=OUT_4”) in new stack
– Executing [s@macro-dialout-trunk:7] GotoIf(“SIP/202-000000e4”, “0?nomax”) in new stack
– Executing [s@macro-dialout-trunk:8] GotoIf(“SIP/202-000000e4”, “0?chanfull”) in new stack
– Executing [s@macro-dialout-trunk:9] GotoIf(“SIP/202-000000e4”, “0?skipoutcid”) in new stack
– Executing [s@macro-dialout-trunk:10] Set(“SIP/202-000000e4”, “DIAL_TRUNK_OPTIONS=t”) in new stack
– Executing [s@macro-dialout-trunk:11] Macro(“SIP/202-000000e4”, “outbound-callerid,4”) in new stack
– Executing [s@macro-outbound-callerid:1] ExecIf(“SIP/202-000000e4”, “0?Set(CALLERPRES()=)”) in new stack
– Executing [s@macro-outbound-callerid:2] ExecIf(“SIP/202-000000e4”, “0?Set(REALCALLERIDNUM=202)”) in new stack
– Executing [s@macro-outbound-callerid:3] GotoIf(“SIP/202-000000e4”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,6)
– Executing [s@macro-outbound-callerid:6] Set(“SIP/202-000000e4”, “USEROUTCID=”) in new stack
– Executing [s@macro-outbound-callerid:7] Set(“SIP/202-000000e4”, “EMERGENCYCID=”) in new stack
– Executing [s@macro-outbound-callerid:8] Set(“SIP/202-000000e4”, “TRUNKOUTCID=02035828265”) in new stack
– Executing [s@macro-outbound-callerid:9] GotoIf(“SIP/202-000000e4”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,12)
– Executing [s@macro-outbound-callerid:12] ExecIf(“SIP/202-000000e4”, “1?Set(CALLERID(all)=02035828265)”) in new stack
– Executing [s@macro-outbound-callerid:13] ExecIf(“SIP/202-000000e4”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:14] ExecIf(“SIP/202-000000e4”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:15] ExecIf(“SIP/202-000000e4”, “0?Set(CALLERPRES()=prohib_passed_screen)”) in new stack
– Executing [s@macro-dialout-trunk:12] GosubIf(“SIP/202-000000e4”, “0?sub-flp-4,s,1()”) in new stack
– Executing [s@macro-dialout-trunk:13] Set(“SIP/202-000000e4”, “OUTNUM=815356789”) in new stack
– Executing [s@macro-dialout-trunk:14] Set(“SIP/202-000000e4”, “custom=SIP/sipgate”) in new stack
– Executing [s@macro-dialout-trunk:15] ExecIf(“SIP/202-000000e4”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)t)”) in new stack
– Executing [s@macro-dialout-trunk:16] ExecIf(“SIP/202-000000e4”, “0?Set(DIAL_TRUNK_OPTIONS=tM(confirm))”) in new stack
– Executing [s@macro-dialout-trunk:17] Macro(“SIP/202-000000e4”, “dialout-trunk-predial-hook,”) in new stack
– Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit(“SIP/202-000000e4”, “”) in new stack
– Executing [s@macro-dialout-trunk:18] GotoIf(“SIP/202-000000e4”, “0?bypass,1”) in new stack
– Executing [s@macro-dialout-trunk:19] GotoIf(“SIP/202-000000e4”, “0?customtrunk”) in new stack
– Executing [s@macro-dialout-trunk:20] Dial(“SIP/202-000000e4”, “SIP/sipgate/815356789,300,t”) in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Couldn’t call sipgate/815356789
== Everyone is busy/congested at this time (0:0/0/0)
– Executing [s@macro-dialout-trunk:21] NoOp(“SIP/202-000000e4”, “Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 21”) in new stack
– Executing [s@macro-dialout-trunk:22] Goto(“SIP/202-000000e4”, “s-CHANUNAVAIL,1”) in new stack
– Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
– Executing [s-CHANUNAVAIL@macro-dialout-trunk:1] Set(“SIP/202-000000e4”, “RC=21”) in new stack
– Executing [s-CHANUNAVAIL@macro-dialout-trunk:2] Goto(“SIP/202-000000e4”, “21,1”) in new stack
– Goto (macro-dialout-trunk,21,1)
– Executing [21@macro-dialout-trunk:1] Goto(“SIP/202-000000e4”, “continue,1”) in new stack
– Goto (macro-dialout-trunk,continue,1)
– Executing [continue@macro-dialout-trunk:1] GotoIf(“SIP/202-000000e4”, “1?noreport”) in new stack
– Goto (macro-dialout-trunk,continue,3)
– Executing [continue@macro-dialout-trunk:3] NoOp(“SIP/202-000000e4”, “TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 21 - failing through to other trunks”) in new stack
– Executing [continue@macro-dialout-trunk:4] Set(“SIP/202-000000e4”, “CALLERID(number)=202”) in new stack
– Executing [9815356789@from-internal:8] Macro(“SIP/202-000000e4”, “outisbusy,”) in new stack
– Executing [s@macro-outisbusy:1] Progress(“SIP/202-000000e4”, “”) in new stack
Audio is at 10.0.1.11 port 15118
Adding codec 0x100 (g729) to SDP
Adding codec 0x4 (ulaw) to SDP
Adding codec 0x8 (alaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP

<— Transmitting (no NAT) to 10.0.1.18:5060 —>
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP 10.0.1.18:5060;branch=z9hG4bK3c192c36;received=10.0.1.18
From: “202” sip:[email protected];tag=003094c2678c00257f470880-7d2e99ad
To: sip:[email protected];tag=as572dc1e3
Call-ID: [email protected]
CSeq: 102 INVITE
Server: FPBX-2.10.0(1.6.2.20)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Contact: sip:[email protected]
Content-Type: application/sdp
Content-Length: 300

v=0
o=root 822482170 822482170 IN IP4 10.0.1.11
s=Asterisk PBX 1.6.2.20
c=IN IP4 10.0.1.11
t=0 0
m=audio 15118 RTP/AVP 18 0 8 101
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv

<------------>
– Executing [s@macro-outisbusy:2] GotoIf(“SIP/202-000000e4”, “0?emergency,1”) in new stack
– Executing [s@macro-outisbusy:3] GotoIf(“SIP/202-000000e4”, “0?intracompany,1”) in new stack
– Executing [s@macro-outisbusy:4] Playback(“SIP/202-000000e4”, “all-circuits-busy-now&pls-try-call-later, noanswer”) in new stack
– Executing [s@macro-outisbusy:5] Congestion(“SIP/202-000000e4”, “20”) in new stack

<— Reliably Transmitting (no NAT) to 10.0.1.18:5060 —>
SIP/2.0 503 Service Unavailable
Via: SIP/2.0/UDP 10.0.1.18:5060;branch=z9hG4bK3c192c36;received=10.0.1.18
From: “202” sip:[email protected];tag=003094c2678c00257f470880-7d2e99ad
To: sip:[email protected];tag=as572dc1e3
Call-ID: [email protected]
CSeq: 102 INVITE
Server: FPBX-2.10.0(1.6.2.20)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
X-Asterisk-HangupCause: Call Rejected
X-Asterisk-HangupCauseCode: 21
Content-Length: 0

<------------>
== Spawn extension (macro-outisbusy, s, 5) exited non-zero on ‘SIP/202-000000e4’ in macro ‘outisbusy’
== Spawn extension (from-internal, 9815356789, exited non-zero on ‘SIP/202-000000e4’
– Executing [h@from-internal:1] Hangup(“SIP/202-000000e4”, “”) in new stack
== Spawn extension (from-internal, h, 1) exited non-zero on ‘SIP/202-000000e4’
== End MixMonitor Recording SIP/202-000000e4
Really destroying SIP dialog ‘[email protected]’ Method: ACK
localhost*CLI> sip set debug off
SIP Debugging Disabled

How can you say you can’t find any error in the log:

You don’t have the extension or secret right on extension 202.

Further down you have all sorts of errors:

Do you have g.729 licenses installed on your system?

I can post debug log from working extension. I know this is an error output but no one is bussy. Unauthorised message I have in all peer debug logs but it works. BTW I do have secrets set up. I have g729 codec installed and working

– Couldn’t call actio/815356789
== Everyone is busy/congested at this time (0:0/0/0)

– Called newfon/815356789
– SIP/newfon-000000e6 is circuit-busy
== Everyone is busy/congested at this time (1:0/1/0)

– Couldn’t call sipgate/815356789
== Everyone is busy/congested at this time (0:0/0/0)

The same error on all 3 trunks. I can call from other phone no problem

You asked if I have g.729 licenses. I said yes as I had them. somethig gone wrong after running yum upate and I had to re-register again. Now everything works.
Thanks!