Trunk Failure?

FreePBX 2.10.0.4 installed from ISO
Asterisk 1.8.10
Configuration: SIP trunk to router

Brought FreePBX online again on Friday and for about a minute everything seemed to be alright. We placed a test call between 2 phones extension to extension, then from a cell phone directly to the Cisco IP phone and it failed. We believe that the trunk is failing but cant explain why. Here are the log files if anyone can help. If more info is needed let me know

012-04-27 14:44:11] WARNING[4743]: app_dial.c:2218 dial_exec_full: Unable to create channel of type ‘SIP’ (cause 20 - Unknown)
== Everyone is busy/congested at this time (1:0/0/1)
– Executing [[email protected]:23] NoOp(“SIP/305-00000043”, “Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 20”) in new stack
– Executing [[email protected]:24] Goto(“SIP/305-00000043”, “s-CHANUNAVAIL,1”) in new stack
– Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
– Executing [[email protected]:1] Set(“SIP/305-00000043”, “RC=20”) in new stack
– Executing [[email protected]:2] Goto(“SIP/305-00000043”, “20,1”) in new stack
– Goto (macro-dialout-trunk,20,1)
– Executing [[email protected]:1] Goto(“SIP/305-00000043”, “continue,1”) in new stack
– Goto (macro-dialout-trunk,continue,1)
– Executing [[email protected]:1] GotoIf(“SIP/305-00000043”, “1?noreport”) in new stack
– Goto (macro-dialout-trunk,continue,3)
– Executing [[email protected]:3] NoOp(“SIP/305-00000043”, “TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 20 - failing through to other trunks”) in new stack

this is the log from when a call was place (name and cell number have been changed for obvious reasons)

– Unregistered SIP ‘305’
– Registered SIP ‘305’ at xxx.xxx.xxx.115:5060
[2012-04-27 14:30:59] NOTICE[3690]: chan_sip.c:20764 handle_response_peerpoke: Peer ‘305’ is now Reachable. (1102ms / 2000ms)
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Executing [[email protected]:1] NoOp(“SIP/305-00000033”, “Running miscapp 6: John Doe (0)”) in new stack
– Executing [[email protected]:2] Macro(“SIP/305-00000033”, “user-callerid,”) in new stack
– Executing [[email protected]:1] Set(“SIP/305-00000033”, “AMPUSER=305”) in new stack
– Executing [[email protected]:2] GotoIf(“SIP/305-00000033”, “0?report”) in new stack
– Executing [[email protected]:3] ExecIf(“SIP/305-00000033”, “1?Set(REALCALLERIDNUM=305)”) in new stack
– Executing [[email protected]:4] Set(“SIP/305-00000033”, “AMPUSER=305”) in new stack
– Executing [[email protected]:5] Set(“SIP/305-00000033”, “AMPUSERCIDNAME=John Doe”) in new stack
– Executing [[email protected]:6] GotoIf(“SIP/305-00000033”, “0?report”) in new stack
– Executing [[email protected]:7] Set(“SIP/305-00000033”, “AMPUSERCID=305”) in new stack
– Executing [[email protected]:8] Set(“SIP/305-00000033”, “CALLERID(all)=“John Doe” <305>”) in new stack
– Executing [[email protected]:9] GotoIf(“SIP/305-00000033”, “0?limit”) in new stack
– Executing [[email protected]:10] ExecIf(“SIP/305-00000033”, “0?Set(GROUP(concurrency_limit)=305)”) in new stack
– Executing [[email protected]:11] GosubIf(“SIP/305-00000033”, “7?sub-ccss,s,1(from-internal,3050)”) in new stack
– Executing [[email protected]:1] ExecIf(“SIP/305-00000033”, “0?Return()”) in new stack
– Executing [[email protected]:2] Set(“SIP/305-00000033”, “CCSS_SETUP=TRUE”) in new stack
– Executing [[email protected]:3] GosubIf(“SIP/305-00000033”, “0?monitor_config,1(from-internal,3050):monitor_default,1(from-internal,3050)”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/305-00000033”, “0?is_exten”) in new stack
– Executing [[email protected]:2] StackPop(“SIP/305-00000033”, “”) in new stack
– Executing [[email protected]:3] Return(“SIP/305-00000033”, “FALSE”) in new stack
– Executing [[email protected]:12] ExecIf(“SIP/305-00000033”, “0?Set(CHANNEL(language)=)”) in new stack
– Executing [[email protected]:13] GotoIf(“SIP/305-00000033”, “0?continue”) in new stack
– Executing [[email protected]:14] Set(“SIP/305-00000033”, “__TTL=64”) in new stack
– Executing [[email protected]:15] GotoIf(“SIP/305-00000033”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,26)
– Executing [[email protected]:26] Set(“SIP/305-00000033”, “CALLERID(number)=305”) in new stack
– Executing [[email protected]:27] Set(“SIP/305-00000033”, “CALLERID(name)=John Doe”) in new stack
– Executing [[email protected]:28] Set(“SIP/305-00000033”, “CHANNEL(language)=en”) in new stack
– Executing [[email protected]:3] Goto(“SIP/305-00000033”, “ext-miscdests,10,1”) in new stack
– Goto (ext-miscdests,10,1)
– Executing [[email protected]:1] NoOp(“SIP/305-00000033”, “MiscDest: John Doe (cell)”) in new stack
– Executing [[email protected]:2] Goto(“SIP/305-00000033”, “from-internal,00861234567,1”) in new stack
– Goto (from-internal,00861234567,1)
– Executing [[email protected]:1] Macro(“SIP/305-00000033”, “user-callerid,LIMIT,”) in new stack
– Executing [[email protected]:1] Set(“SIP/305-00000033”, “AMPUSER=305”) in new stack
– Executing [[email protected]:2] GotoIf(“SIP/305-00000033”, “14?report”) in new stack
– Goto (macro-user-callerid,s,13)
– Executing [[email protected]:13] GotoIf(“SIP/305-00000033”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,26)
– Executing [[email protected]:26] Set(“SIP/305-00000033”, “CALLERID(number)=305”) in new stack
– Executing [[email protected]:27] Set(“SIP/305-00000033”, “CALLERID(name)=John Doe”) in new stack
– Executing [[email protected]:28] Set(“SIP/305-00000033”, “CHANNEL(language)=en”) in new stack
– Executing [[email protected]:2] Set(“SIP/305-00000033”, “MOHCLASS=default”) in new stack
– Executing [[email protected]:3] Set(“SIP/305-00000033”, “_NODEST=”) in new stack
– Executing [[email protected]:4] Gosub(“SIP/305-00000033”, “sub-record-check,s,1(out,00861234567,)”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/305-00000033”, “1?check”) in new stack
– Goto (sub-record-check,s,3)
– Executing [[email protected]:3] Set(“SIP/305-00000033”, “MON_FMT=wav”) in new stack
– Executing [[email protected]:4] GotoIf(“SIP/305-00000033”, “1?next”) in new stack
– Goto (sub-record-check,s,7)
– Executing [[email protected]:7] ExecIf(“SIP/305-00000033”, “0?Return()”) in new stack
– Executing [[email protected]:8] GotoIf(“SIP/305-00000033”, “0?out,1”) in new stack
– Executing [[email protected]:9] Set(“SIP/305-00000033”, “__REC_STATUS=INITIALIZED”) in new stack
– Executing [[email protected]:10] ExecIf(“SIP/305-00000033”, “0?Set(__REC_POLICY_MODE=)”) in new stack
– Executing [[email protected]:11] Set(“SIP/305-00000033”, “NOW=1335533467”) in new stack
– Executing [[email protected]:12] Set(“SIP/305-00000033”, “__DAY=27”) in new stack
– Executing [[email protected]:13] Set(“SIP/305-00000033”, “__MONTH=04”) in new stack
– Executing [[email protected]:14] Set(“SIP/305-00000033”, “__YEAR=2012”) in new stack
– Executing [[email protected]:15] Set(“SIP/305-00000033”, “__TIMESTR=20120427-143107”) in new stack
– Executing [[email protected]:16] Set(“SIP/305-00000033”, “__FROMEXTEN=305”) in new stack
– Executing [[email protected]:17] Set(“SIP/305-00000033”, “__CALLFILENAME=out-00861234567-305-20120427-143107-1335533467.58”) in new stack
– Executing [[email protected]:18] Goto(“SIP/305-00000033”, “out,1”) in new stack
– Goto (sub-record-check,out,1)
– Executing [[email protected]:1] ExecIf(“SIP/305-00000033”, “1?Set(__REC_POLICY_MODE=dontcare)”) in new stack
– Executing [[email protected]:2] GosubIf(“SIP/305-00000033”, “0?record,1(exten,00861234567,305)”) in new stack
– Executing [[email protected]:3] Return(“SIP/305-00000033”, “”) in new stack
– Executing [[email protected]:5] Macro(“SIP/305-00000033”, “dialout-trunk,2,0861234567,”) in new stack
– Executing [[email protected]:1] Set(“SIP/305-00000033”, “DIAL_TRUNK=2”) in new stack
– Executing [[email protected]:2] GosubIf(“SIP/305-00000033”, “0?sub-pincheck,s,1()”) in new stack
– Executing [[email protected]:3] GotoIf(“SIP/305-00000033”, “0?disabletrunk,1”) in new stack
– Executing [[email protected]:4] Set(“SIP/305-00000033”, “DIAL_NUMBER=0861234567”) in new stack
– Executing [[email protected]:5] Set(“SIP/305-00000033”, “DIAL_TRUNK_OPTIONS=rtTwW”) in new stack
– Executing [[email protected]:6] Set(“SIP/305-00000033”, “OUTBOUND_GROUP=OUT_2”) in new stack
– Executing [[email protected]:7] GotoIf(“SIP/305-00000033”, “0?nomax”) in new stack
– Executing [[email protected]:8] GotoIf(“SIP/305-00000033”, “0?chanfull”) in new stack
– Executing [[email protected]:9] GotoIf(“SIP/305-00000033”, “0?skipoutcid”) in new stack
– Executing [[email protected]:10] Set(“SIP/305-00000033”, “DIAL_TRUNK_OPTIONS=”) in new stack
– Executing [[email protected]:11] Macro(“SIP/305-00000033”, “outbound-callerid,2”) in new stack
– Executing [[email protected]:1] ExecIf(“SIP/305-00000033”, “0?Set(CALLERPRES()=)”) in new stack
– Executing [[email protected]:2] ExecIf(“SIP/305-00000033”, “0?Set(REALCALLERIDNUM=305)”) in new stack
– Executing [[email protected]:3] GotoIf(“SIP/305-00000033”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,6)
– Executing [[email protected]:6] Set(“SIP/305-00000033”, “USEROUTCID=6305”) in new stack
– Executing [[email protected]:7] Set(“SIP/305-00000033”, “EMERGENCYCID=”) in new stack
– Executing [[email protected]:8] Set(“SIP/305-00000033”, “TRUNKOUTCID=MTS Cork”) in new stack
– Executing [[email protected]:9] GotoIf(“SIP/305-00000033”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,12)
– Executing [[email protected]:12] ExecIf(“SIP/305-00000033”, “1?Set(CALLERID(all)=MTS Cork)”) in new stack
– Executing [[email protected]:13] ExecIf(“SIP/305-00000033”, “1?Set(CALLERID(all)=6305)”) in new stack
– Executing [[email protected]:14] ExecIf(“SIP/305-00000033”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [[email protected]:15] ExecIf(“SIP/305-00000033”, “0?Set(CALLERPRES()=prohib_passed_screen)”) in new stack
– Executing [[email protected]:12] GosubIf(“SIP/305-00000033”, “0?sub-flp-2,s,1()”) in new stack
– Executing [[email protected]:13] Set(“SIP/305-00000033”, “OUTNUM=0863506373”) in new stack
– Executing [[email protected]:14] Set(“SIP/305-00000033”, “custom=SIP/cg08p”) in new stack
– Executing [[email protected]:15] ExecIf(“SIP/305-00000033”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default))”) in new stack
– Executing [[email protected]:16] ExecIf(“SIP/305-00000033”, “0?Set(DIAL_TRUNK_OPTIONS=M(confirm))”) in new stack
– Executing [[email protected]:17] Macro(“SIP/305-00000033”, “dialout-trunk-predial-hook,”) in new stack
– Executing [[email protected]:1] MacroExit(“SIP/305-00000033”, “”) in new stack
– Executing [[email protected]:18] GotoIf(“SIP/305-00000033”, “0?bypass,1”) in new stack
– Executing [[email protected]:19] ExecIf(“SIP/305-00000033”, “1?Set(CONNECTEDLINE(num,i)=0863506373)”) in new stack
– Executing [[email protected]:20] ExecIf(“SIP/305-00000033”, “1?Set(CONNECTEDLINE(name,i)=CID:6305)”) in new stack
– Executing [[email protected]:21] GotoIf(“SIP/305-00000033”, “0?customtrunk”) in new stack
– Executing [[email protected]:22] Dial(“SIP/305-00000033”, “SIP/cg08p/0863506373,300,”) in new stack
[2012-04-27 14:31:07] WARNING[4466]: app_dial.c:2218 dial_exec_full: Unable to create channel of type ‘SIP’ (cause 20 - Unknown)
== Everyone is busy/congested at this time (1:0/0/1)
– Executing [[email protected]:23] NoOp(“SIP/305-00000033”, “Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 20”) in new stack
– Executing [[email protected]:24] Goto(“SIP/305-00000033”, “s-CHANUNAVAIL,1”) in new stack
– Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
– Executing [[email protected]:1] Set(“SIP/305-00000033”, “RC=20”) in new stack
– Executing [[email protected]:2] Goto(“SIP/305-00000033”, “20,1”) in new stack
– Goto (macro-dialout-trunk,20,1)
– Executing [[email protected]:1] Goto(“SIP/305-00000033”, “continue,1”) in new stack
– Goto (macro-dialout-trunk,continue,1)
– Executing [[email protected]:1] GotoIf(“SIP/305-00000033”, “1?noreport”) in new stack
– Goto (macro-dialout-trunk,continue,3)
– Executing [[email protected]:3] NoOp(“SIP/305-00000033”, “TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 20 - failing through to other trunks”) in new stack
– Executing [[email protected]:4] Set(“SIP/305-00000033”, “CALLERID(number)=305”) in new stack
– Executing [[email protected]:6] Macro(“SIP/305-00000033”, “outisbusy,”) in new stack
– Executing [[email protected]:1] Progress(“SIP/305-00000033”, “”) in new stack
– Executing [[email protected]:2] GotoIf(“SIP/305-00000033”, “0?emergency,1”) in new stack
– Executing [[email protected]:3] GotoIf(“SIP/305-00000033”, “0?intracompany,1”) in new stack
– Executing [[email protected]:4] Playback(“SIP/305-00000033”, “all-circuits-busy-now&pls-try-call-later, noanswer”) in new stack
– <SIP/305-00000033> Playing ‘all-circuits-busy-now.ulaw’ (language ‘en’)
== Spawn extension (macro-outisbusy, s, 4) exited non-zero on ‘SIP/305-00000033’ in macro ‘outisbusy’
== Spawn extension (from-internal, 00861234567, 6) exited non-zero on ‘SIP/305-00000033’
– Executing [[email protected]:1] Hangup(“SIP/305-00000033”, “”) in new stack
== Spawn extension (from-internal, h, 1) exited non-zero on ‘SIP/305-00000033’

Thanks
Andy

The trunk named ‘SIP/cg08p’ is not configured properly. Why are you using a custom trunk?

i didn’t setup the trunks but the settings for the SIP/cg08p are the exact same as they are in the older Trixbox system we are still using and it is functioning properly. I will post the trunk configuration for both systems if you want to compare the two and see if anything is wrong.Some details have been changed but they are the same on both systems

Trixbox trunk cg08p:
peer details
host=xxx.xxx.xxx.2
username=xxxxxx
secret=xxxxxxxxxx
type=peer
nat=no
canreinvite=yes
qualify=yes
insecure=port,invite

user details
username=xxxxxx
secret=xxxxxxxxxxx
type=user
context=from-trunk
nat=no
canreinvite=yes
qualify=yes
insecure=port,invite

Freepbx trunk cg08p:
peer details
username=xxxxxx
type=peer
secret=xxxxxxxxxxx
qualify=yes
nat=no
insecure=port,invite
host=xxx.xxx.xxx.2
canreinvite=yes

user details
username=xxxxxx
type=user
secret=xxxxxxxxxxx
qualify=yes
nat=no
insecure=port,invite
context=from-trunk
canreinvite=yes