Trunk problem

Hi,

Has anyone successfully setup a trunk to Draytel.org? Incoming calls work but outgoing calls fail. Asterisk attempts to route the outgoing call but then fails and ‘All circuits are busy now’ is played.

Any help or pointers would be very gratefully received. This is driving me mad.

FreePBX 12.0.76.2

Here is my trunk config:

Trunk name: Draytel

Peer details:

type=friend
username=8*****
secret=5*****
fromuser=8*****
host=draytel.org
dtmfmode=rfc2833
fromdomain=draytel.org
context=from-pstn
insecure=very
qualify=yes
disallow=all
allow=ulaw

‘sip show registry’ outputs:
Host dnsmgr Username Refresh State Reg.Time
draytel.org:5060 N 8***** 105 Registered Fri, 15 Jan 2016 20:55:59
1 SIP registrations.

Here is the output of sip ‘set debug ip draytel.org’ when I place an outgoing call:

SIP Debugging Enabled for IP: 217.14.138.127
Reliably Transmitting (NAT) to 217.14.138.127:5060:
OPTIONS sip:draytel.org SIP/2.0
Via: SIP/2.0/TCP 81.142.231.116:5060;branch=z9hG4bK7e7c9184;rport
Max-Forwards: 70
From: “Unknown” sip:8*****@netphone.domain.co.uk;tag=as433bdce6
To: sip:draytel.org
Contact: sip:8*****@81.142.231.116:5060;transport=TCP
Call-ID: [email protected]
CSeq: 102 OPTIONS
User-Agent: FPBX-12.0.76.2(12.8.2)
Date: Fri, 15 Jan 2016 20:57:59 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Executing [0*********2@from-internal:1] Macro(“SIP/6003-0000000c”, “user-callerid,LIMIT,EXTERNAL,”) in new stack
– Executing [s@macro-user-callerid:1] Set(“SIP/6003-0000000c”, “TOUCH_MONITOR=1452891481.60”) in new stack
– Executing [s@macro-user-callerid:2] Set(“SIP/6003-0000000c”, “AMPUSER=6003”) in new stack
– Executing [s@macro-user-callerid:3] GotoIf(“SIP/6003-0000000c”, “0?report”) in new stack
– Executing [s@macro-user-callerid:4] ExecIf(“SIP/6003-0000000c”, “1?Set(REALCALLERIDNUM=6003)”) in new stack
– Executing [s@macro-user-callerid:5] Set(“SIP/6003-0000000c”, “AMPUSER=6003”) in new stack
– Executing [s@macro-user-callerid:6] GotoIf(“SIP/6003-0000000c”, “0?limit”) in new stack
– Executing [s@macro-user-callerid:7] Set(“SIP/6003-0000000c”, “AMPUSERCIDNAME=John Smith”) in new stack
– Executing [s@macro-user-callerid:8] GotoIf(“SIP/6003-0000000c”, “0?report”) in new stack
– Executing [s@macro-user-callerid:9] Set(“SIP/6003-0000000c”, “AMPUSERCID=6003”) in new stack
– Executing [s@macro-user-callerid:10] Set(“SIP/6003-0000000c”, “__DIAL_OPTIONS=Ttr”) in new stack
– Executing [s@macro-user-callerid:11] Set(“SIP/6003-0000000c”, “CALLERID(all)=“John Smith” <6003>”) in new stack
– Executing [s@macro-user-callerid:12] GotoIf(“SIP/6003-0000000c”, “0?limit”) in new stack
– Executing [s@macro-user-callerid:13] ExecIf(“SIP/6003-0000000c”, “1?Set(GROUP(concurrency_limit)=6003)”) in new stack
– Executing [s@macro-user-callerid:14] GotoIf(“SIP/6003-0000000c”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,27)
– Executing [s@macro-user-callerid:27] Set(“SIP/6003-0000000c”, “CALLERID(number)=6003”) in new stack
– Executing [s@macro-user-callerid:28] Set(“SIP/6003-0000000c”, “CALLERID(name)=John Smith”) in new stack
– Executing [s@macro-user-callerid:29] Set(“SIP/6003-0000000c”, “CDR(cnum)=6003”) in new stack
– Executing [s@macro-user-callerid:30] Set(“SIP/6003-0000000c”, “CDR(cnam)=John Smith”) in new stack
– Executing [s@macro-user-callerid:31] Set(“SIP/6003-0000000c”, “CHANNEL(language)=en”) in new stack
– Executing [0*********2@from-internal:2] Gosub(“SIP/6003-0000000c”, “sub-record-check,s,1(out,0*********2,dontcare)”) in new stack
– Executing [s@sub-record-check:1] GotoIf(“SIP/6003-0000000c”, “0?initialized”) in new stack
– Executing [s@sub-record-check:2] Set(“SIP/6003-0000000c”, “__REC_STATUS=INITIALIZED”) in new stack
– Executing [s@sub-record-check:3] Set(“SIP/6003-0000000c”, “NOW=1452891481”) in new stack
– Executing [s@sub-record-check:4] Set(“SIP/6003-0000000c”, “__DAY=15”) in new stack
– Executing [s@sub-record-check:5] Set(“SIP/6003-0000000c”, “__MONTH=01”) in new stack
– Executing [s@sub-record-check:6] Set(“SIP/6003-0000000c”, “__YEAR=2016”) in new stack
– Executing [s@sub-record-check:7] Set(“SIP/6003-0000000c”, “__TIMESTR=20160115-205801”) in new stack
– Executing [s@sub-record-check:8] Set(“SIP/6003-0000000c”, “__FROMEXTEN=6003”) in new stack
– Executing [s@sub-record-check:9] Set(“SIP/6003-0000000c”, “__MON_FMT=wav”) in new stack
– Executing [s@sub-record-check:10] NoOp(“SIP/6003-0000000c”, “Recordings initialized”) in new stack
– Executing [s@sub-record-check:11] ExecIf(“SIP/6003-0000000c”, “0?Set(ARG3=dontcare)”) in new stack
– Executing [s@sub-record-check:12] Set(“SIP/6003-0000000c”, “REC_POLICY_MODE_SAVE=”) in new stack
– Executing [s@sub-record-check:13] ExecIf(“SIP/6003-0000000c”, “0?Set(REC_STATUS=NO)”) in new stack
– Executing [s@sub-record-check:14] GotoIf(“SIP/6003-0000000c”, “3?checkaction”) in new stack
– Goto (sub-record-check,s,17)
– Executing [s@sub-record-check:17] GotoIf(“SIP/6003-0000000c”, “1?sub-record-check,out,1”) in new stack
– Goto (sub-record-check,out,1)
– Executing [out@sub-record-check:1] NoOp(“SIP/6003-0000000c”, “Outbound Recording Check from 6003 to 0*********2”) in new stack
– Executing [out@sub-record-check:2] Set(“SIP/6003-0000000c”, “RECMODE=dontcare”) in new stack
– Executing [out@sub-record-check:3] ExecIf(“SIP/6003-0000000c”, “1?Goto(routewins)”) in new stack
– Goto (sub-record-check,out,7)
– Executing [out@sub-record-check:7] Gosub(“SIP/6003-0000000c”, “recordcheck,1(dontcare,out,0*********2)”) in new stack
– Executing [recordcheck@sub-record-check:1] NoOp(“SIP/6003-0000000c”, “Starting recording check against dontcare”) in new stack
– Executing [recordcheck@sub-record-check:2] Goto(“SIP/6003-0000000c”, “dontcare”) in new stack
– Goto (sub-record-check,recordcheck,3)
– Executing [recordcheck@sub-record-check:3] Return(“SIP/6003-0000000c”, “”) in new stack
– Executing [out@sub-record-check:8] Return(“SIP/6003-0000000c”, “”) in new stack
– Executing [0*********2@from-internal:3] Set(“SIP/6003-0000000c”, “MOHCLASS=default”) in new stack
– Executing [0*********2@from-internal:4] Set(“SIP/6003-0000000c”, “_NODEST=”) in new stack
– Executing [0*********2@from-internal:5] Macro(“SIP/6003-0000000c”, “dialout-trunk,1,0*********2,off”) in new stack
– Executing [s@macro-dialout-trunk:1] Set(“SIP/6003-0000000c”, “DIAL_TRUNK=1”) in new stack
– Executing [s@macro-dialout-trunk:2] GosubIf(“SIP/6003-0000000c”, “0?sub-pincheck,s,1()”) in new stack
– Executing [s@macro-dialout-trunk:3] GotoIf(“SIP/6003-0000000c”, “0?disabletrunk,1”) in new stack
– Executing [s@macro-dialout-trunk:4] Set(“SIP/6003-0000000c”, “DIAL_NUMBER=0*********2”) in new stack
– Executing [s@macro-dialout-trunk:5] Set(“SIP/6003-0000000c”, “DIAL_TRUNK_OPTIONS=Ttr”) in new stack
– Executing [s@macro-dialout-trunk:6] Set(“SIP/6003-0000000c”, “OUTBOUND_GROUP=OUT_1”) in new stack
– Executing [s@macro-dialout-trunk:7] GotoIf(“SIP/6003-0000000c”, “1?nomax”) in new stack
– Goto (macro-dialout-trunk,s,9)
– Executing [s@macro-dialout-trunk:9] GotoIf(“SIP/6003-0000000c”, “0?skipoutcid”) in new stack
– Executing [s@macro-dialout-trunk:10] Set(“SIP/6003-0000000c”, “DIAL_TRUNK_OPTIONS=Tt”) in new stack
– Executing [s@macro-dialout-trunk:11] Macro(“SIP/6003-0000000c”, “outbound-callerid,1”) in new stack
– Executing [s@macro-outbound-callerid:1] ExecIf(“SIP/6003-0000000c”, “0?Set(CALLERPRES()=)”) in new stack
– Executing [s@macro-outbound-callerid:2] ExecIf(“SIP/6003-0000000c”, “0?Set(REALCALLERIDNUM=6003)”) in new stack
– Executing [s@macro-outbound-callerid:3] GotoIf(“SIP/6003-0000000c”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,6)
– Executing [s@macro-outbound-callerid:6] Set(“SIP/6003-0000000c”, “USEROUTCID=”) in new stack
– Executing [s@macro-outbound-callerid:7] Set(“SIP/6003-0000000c”, “EMERGENCYCID=”) in new stack
– Executing [s@macro-outbound-callerid:8] Set(“SIP/6003-0000000c”, “TRUNKOUTCID=<0*********5>”) in new stack
– Executing [s@macro-outbound-callerid:9] GotoIf(“SIP/6003-0000000c”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,14)
– Executing [s@macro-outbound-callerid:14] ExecIf(“SIP/6003-0000000c”, “1?Set(CALLERID(all)=<0*********5>)”) in new stack
– Executing [s@macro-outbound-callerid:15] ExecIf(“SIP/6003-0000000c”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:16] ExecIf(“SIP/6003-0000000c”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:17] ExecIf(“SIP/6003-0000000c”, “0?Set(CALLERPRES()=prohib_passed_screen)”) in new stack
– Executing [s@macro-outbound-callerid:18] Set(“SIP/6003-0000000c”, “CDR(outbound_cnum)=0*********5”) in new stack
– Executing [s@macro-outbound-callerid:19] Set(“SIP/6003-0000000c”, “CDR(outbound_cnam)=”) in new stack
[2016-01-15 20:58:01] WARNING[2136]: func_cdr.c:349 cdr_write_callback: CDR requires a value (CDR(variable)=value)
)� – Executing [s@macro-dialout-trunk:12] GosubIf(“SIP/6003-0000000c”, “0?sub-flp-1,s,1()”) in new stack
– Executing [s@macro-dialout-trunk:13] Set(“SIP/6003-0000000c”, “OUTNUM=0*********2”) in new stack
– Executing [s@macro-dialout-trunk:14] Set(“SIP/6003-0000000c”, “custom=SIP/Draytel”) in new stack
– Executing [s@macro-dialout-trunk:15] ExecIf(“SIP/6003-0000000c”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)Tt)”) in new stack
– Executing [s@macro-dialout-trunk:16] ExecIf(“SIP/6003-0000000c”, “0?Set(DIAL_TRUNK_OPTIONS=TtM(confirm))”) in new stack
– Executing [s@macro-dialout-trunk:17] Macro(“SIP/6003-0000000c”, “dialout-trunk-predial-hook,”) in new stack
– Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit(“SIP/6003-0000000c”, “”) in new stack
– Executing [s@macro-dialout-trunk:18] GotoIf(“SIP/6003-0000000c”, “0?bypass,1”) in new stack
– Executing [s@macro-dialout-trunk:19] ExecIf(“SIP/6003-0000000c”, “1?Set(CONNECTEDLINE(num,i)=0*********2)”) in new stack
– Executing [s@macro-dialout-trunk:20] ExecIf(“SIP/6003-0000000c”, “1?Set(CONNECTEDLINE(name,i)=CID:0*********5)”) in new stack
– Executing [s@macro-dialout-trunk:21] GotoIf(“SIP/6003-0000000c”, “0?customtrunk”) in new stack
– Executing [s@macro-dialout-trunk:22] Dial(“SIP/6003-0000000c”, “SIP/Draytel/0*********2,300,Tt”) in new stack
[2016-01-15 20:58:01] WARNING[10468][C-0000000b]: app_dial.c:2421 dial_exec_full: Unable to create channel of type ‘SIP’ (cause 20 - Subscriber absent)
== Everyone is busy/congested at this time (1:0/0/1)
– Executing [s@macro-dialout-trunk:23] NoOp(“SIP/6003-0000000c”, “Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 20”) in new stack
– Executing [s@macro-dialout-trunk:24] GotoIf(“SIP/6003-0000000c”, “0?continue,1:s-CHANUNAVAIL,1”) in new stack
– Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
– Executing [s-CHANUNAVAIL@macro-dialout-trunk:1] Set(“SIP/6003-0000000c”, “RC=20”) in new stack
– Executing [s-CHANUNAVAIL@macro-dialout-trunk:2] Goto(“SIP/6003-0000000c”, “20,1”) in new stack
– Goto (macro-dialout-trunk,20,1)
– Executing [20@macro-dialout-trunk:1] Goto(“SIP/6003-0000000c”, “continue,1”) in new stack
– Goto (macro-dialout-trunk,continue,1)
– Executing [continue@macro-dialout-trunk:1] NoOp(“SIP/6003-0000000c”, “TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 20 - failing through to other trunks”) in new stack
– Executing [continue@macro-dialout-trunk:2] Set(“SIP/6003-0000000c”, “CALLERID(number)=6003”) in new stack
– Executing [0*********2@from-internal:6] Macro(“SIP/6003-0000000c”, “outisbusy,”) in new stack
– Executing [s@macro-outisbusy:1] Progress(“SIP/6003-0000000c”, “”) in new stack
– Executing [s@macro-outisbusy:2] Playback(“SIP/6003-0000000c”, “all-circuits-busy-now,noanswer”) in new stack
– <SIP/6003-0000000c> Playing ‘all-circuits-busy-now.ulaw’ (language ‘en’)
> 0x7f16450ef3a0 – Probation passed - setting RTP source address to 192.168.1.204:5004
– Executing [s@macro-outisbusy:3] Playback(“SIP/6003-0000000c”, “pls-try-call-later,noanswer”) in new stack
– <SIP/6003-0000000c> Playing ‘pls-try-call-later.ulaw’ (language ‘en’)
Really destroying SIP dialog ‘[email protected]’ Method: OPTIONS
[2016-01-15 20:58:04] WARNING[10468][C-0000000b]: app_playback.c:493 playback_exec: Playback failed on SIP/6003-0000000c for pls-try-call-later,noanswer
– Executing [h@from-internal:1] Hangup(“SIP/6003-0000000c”, “”) in new stack
== Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/6003-0000000c’
Reliably Transmitting (NAT) to 217.14.138.127:5060:
OPTIONS sip:draytel.org SIP/2.0
Via: SIP/2.0/TCP 81.142.231.116:5060;branch=z9hG4bK5fe1f205;rport
Max-Forwards: 70
From: “Unknown” sip:8*****@netphone.domain.co.uk;tag=as64a29b4e
To: sip:draytel.org
Contact: sip:8*****@81.142.231.116:5060;transport=TCP
Call-ID: [email protected]
CSeq: 102 OPTIONS
User-Agent: FPBX-12.0.76.2(12.8.2)
Date: Fri, 15 Jan 2016 20:58:13 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0