Outbound Dialing Fails - DIALSTATUS = CHANUNAVAIL

Hi everyone. I am receiving the following error when dialing outbound, inbound seems to work correctly.

Can anyone lend any assistance?


== Everyone is busy/congested at this time (1:0/0/1)
– Executing [s@macro-dialout-trunk:23] NoOp(“SIP/701-00000002”, “Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 1”) in new stack


I am running the following setup not from a distribution.
FreePBX: 2.11.0
Asterisk: 11.8.1
Dahdi: 2.9.0
Centos: 6.5

I have configured in the following way.

Span 1 is the outbound span connected to the PSTN line I have stated group 1 ascending in the outbound trunk. Channels 1-15, 17-31.

/etc/dahdi/system.conf
span=1,0,0,CCS,HDB3,CRC4
span=2,0,0,CCS,HDB3,CRC4
bchan=1-15,17-31,32-46,48-62
dchan=16,47
loadzone=uk
defaultzone=uk

I am using a Digium TE220 set for Europe.

/etc/modprobe.d/dahdi.conf
options wct4xxp default_linemode=e1

/etc/asterisk/chan_dahdi.conf
[channels]
language=en
busydetect=yes
busycount=10
usecallerid=yes
callwaiting=yes
usecallingpres=yes
threewaycalling=yes
transfer=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=no
echotraining=no
immediate=no
faxdetect=no
rxgain=0.0
txgain=0.0

[root@s000411 ~]# asterisk -rvvvvv
Asterisk 11.8.1, Copyright © 1999 - 2013 Digium, Inc. and others.
Created by Mark Spencer [email protected]
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘core show license’ for details.

Connected to Asterisk 11.8.1 currently running on s000411 (pid = 2008)
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Executing [08453730591@from-internal:1] Macro(“SIP/701-00000008”, “user-callerid,LIMIT,EXTERNAL,”) in new stack
– Executing [s@macro-user-callerid:1] Set(“SIP/701-00000008”, “TOUCH_MONITOR=1398100147.321”) in new stack
– Executing [s@macro-user-callerid:2] Set(“SIP/701-00000008”, “AMPUSER=701”) in new stack
– Executing [s@macro-user-callerid:3] GotoIf(“SIP/701-00000008”, “0?report”) in new stack
– Executing [s@macro-user-callerid:4] ExecIf(“SIP/701-00000008”, “1?Set(REALCALLERIDNUM=701)”) in new stack
– Executing [s@macro-user-callerid:5] Set(“SIP/701-00000008”, “AMPUSER=701”) in new stack
– Executing [s@macro-user-callerid:6] Set(“SIP/701-00000008”, “AMPUSERCIDNAME=701”) in new stack
– Executing [s@macro-user-callerid:7] GotoIf(“SIP/701-00000008”, “0?report”) in new stack
– Executing [s@macro-user-callerid:8] Set(“SIP/701-00000008”, “AMPUSERCID=701”) in new stack
– Executing [s@macro-user-callerid:9] Set(“SIP/701-00000008”, “__DIAL_OPTIONS=Ttr”) in new stack
– Executing [s@macro-user-callerid:10] Set(“SIP/701-00000008”, “CALLERID(all)=“701” <701>”) in new stack
– Executing [s@macro-user-callerid:11] GotoIf(“SIP/701-00000008”, “0?limit”) in new stack
– Executing [s@macro-user-callerid:12] ExecIf(“SIP/701-00000008”, “1?Set(GROUP(concurrency_limit)=701)”) in new stack
– Executing [s@macro-user-callerid:13] GotoIf(“SIP/701-00000008”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,26)
– Executing [s@macro-user-callerid:26] Set(“SIP/701-00000008”, “CALLERID(number)=701”) in new stack
– Executing [s@macro-user-callerid:27] Set(“SIP/701-00000008”, “CALLERID(name)=701”) in new stack
– Executing [s@macro-user-callerid:28] Set(“SIP/701-00000008”, “CDR(cnum)=701”) in new stack
– Executing [s@macro-user-callerid:29] Set(“SIP/701-00000008”, “CDR(cnam)=701”) in new stack
– Executing [s@macro-user-callerid:30] Set(“SIP/701-00000008”, “CHANNEL(language)=en”) in new stack
– Executing [08453730591@from-internal:2] Set(“SIP/701-00000008”, “__REC_POLICY_MODE=always”) in new stack
– Executing [08453730591@from-internal:3] Set(“SIP/701-00000008”, “ROUTE_CIDSAVE=“701” <701>”) in new stack
– Executing [08453730591@from-internal:4] Set(“SIP/701-00000008”, “MOHCLASS=default”) in new stack
– Executing [08453730591@from-internal:5] Set(“SIP/701-00000008”, “_NODEST=”) in new stack
– Executing [08453730591@from-internal:6] Gosub(“SIP/701-00000008”, “sub-record-check,s,1(out,08453730591,)”) in new stack
– Executing [s@sub-record-check:1] Set(“SIP/701-00000008”, “REC_POLICY_MODE_SAVE=always”) in new stack
– Executing [s@sub-record-check:2] GotoIf(“SIP/701-00000008”, “1?check”) in new stack
– Goto (sub-record-check,s,7)
– Executing [s@sub-record-check:7] Set(“SIP/701-00000008”, “__MON_FMT=wav”) in new stack
– Executing [s@sub-record-check:8] GotoIf(“SIP/701-00000008”, “1?next”) in new stack
– Goto (sub-record-check,s,11)
– Executing [s@sub-record-check:11] ExecIf(“SIP/701-00000008”, “0?Return()”) in new stack
– Executing [s@sub-record-check:12] ExecIf(“SIP/701-00000008”, “0?Set(__REC_POLICY_MODE=)”) in new stack
– Executing [s@sub-record-check:13] GotoIf(“SIP/701-00000008”, “0?out,1”) in new stack
– Executing [s@sub-record-check:14] Set(“SIP/701-00000008”, “__REC_STATUS=INITIALIZED”) in new stack
– Executing [s@sub-record-check:15] Set(“SIP/701-00000008”, “NOW=1398100147”) in new stack
– Executing [s@sub-record-check:16] Set(“SIP/701-00000008”, “__DAY=21”) in new stack
– Executing [s@sub-record-check:17] Set(“SIP/701-00000008”, “__MONTH=04”) in new stack
– Executing [s@sub-record-check:18] Set(“SIP/701-00000008”, “__YEAR=2014”) in new stack
– Executing [s@sub-record-check:19] Set(“SIP/701-00000008”, “__TIMESTR=20140421-180907”) in new stack
– Executing [s@sub-record-check:20] Set(“SIP/701-00000008”, “__FROMEXTEN=701”) in new stack
– Executing [s@sub-record-check:21] Set(“SIP/701-00000008”, “__CALLFILENAME=out-08453730591-701-20140421-180907-1398100147.321”) in new stack
– Executing [s@sub-record-check:22] Goto(“SIP/701-00000008”, “out,1”) in new stack
– Goto (sub-record-check,out,1)
– Executing [out@sub-record-check:1] ExecIf(“SIP/701-00000008”, “0?Set(__REC_POLICY_MODE=dontcare)”) in new stack
– Executing [out@sub-record-check:2] GosubIf(“SIP/701-00000008”, “1?record,1(exten,08453730591,701)”) in new stack
– Executing [record@sub-record-check:1] Set(“SIP/701-00000008”, “AUDIOHOOK_INHERIT(MixMonitor)=yes”) in new stack
– Executing [record@sub-record-check:2] MixMonitor(“SIP/701-00000008”, “/var/spool/asterisk/monitor/2014/04/21/out-08453730591-701-20140421-180907-1398100147.321.wav,r(/var/spool/asterisk/monitor/2014/04/21/out-08453730591-701-20140421-180907-1398100147.321-in.wav)t(/var/spool/asterisk/monitor/2014/04/21/out-08453730591-701-20140421-180907-1398100147.321-out.wav),/usr/local/bin/wavmix ^{MIXMON_DIR}^{YEAR}/^{MONTH}/^{DAY}/^{CALLFILENAME}-in.^{MIXMON_FORMAT} ^{MIXMON_DIR}^{YEAR}/^{MONTH}/^{DAY}/^{CALLFILENAME}-out.^{MIXMON_FORMAT} ^{MIXMON_DIR}^{YEAR}/^{MONTH}/^{DAY}/^{CALLFILENAME}.^{MIXMON_FORMAT}”) in new stack
– Executing [record@sub-record-check:3] Set(“SIP/701-00000008”, “__REC_STATUS=RECORDING”) in new stack
== Begin MixMonitor Recording SIP/701-00000008
– Executing [record@sub-record-check:4] Set(“SIP/701-00000008”, “CDR(recordingfile)=out-08453730591-701-20140421-180907-1398100147.321.wav”) in new stack
– Executing [record@sub-record-check:5] Return(“SIP/701-00000008”, “”) in new stack
– Executing [out@sub-record-check:3] Return(“SIP/701-00000008”, “”) in new stack
– Executing [08453730591@from-internal:7] Macro(“SIP/701-00000008”, “dialout-trunk,1,08453730591,off”) in new stack
– Executing [s@macro-dialout-trunk:1] Set(“SIP/701-00000008”, “DIAL_TRUNK=1”) in new stack
– Executing [s@macro-dialout-trunk:2] GosubIf(“SIP/701-00000008”, “0?sub-pincheck,s,1()”) in new stack
– Executing [s@macro-dialout-trunk:3] GotoIf(“SIP/701-00000008”, “0?disabletrunk,1”) in new stack
– Executing [s@macro-dialout-trunk:4] Set(“SIP/701-00000008”, “DIAL_NUMBER=08453730591”) in new stack
– Executing [s@macro-dialout-trunk:5] Set(“SIP/701-00000008”, “DIAL_TRUNK_OPTIONS=Ttr”) in new stack
– Executing [s@macro-dialout-trunk:6] Set(“SIP/701-00000008”, “OUTBOUND_GROUP=OUT_1”) in new stack
– Executing [s@macro-dialout-trunk:7] GotoIf(“SIP/701-00000008”, “1?nomax”) in new stack
– Goto (macro-dialout-trunk,s,9)
– Executing [s@macro-dialout-trunk:9] GotoIf(“SIP/701-00000008”, “0?skipoutcid”) in new stack
– Executing [s@macro-dialout-trunk:10] Set(“SIP/701-00000008”, “DIAL_TRUNK_OPTIONS=Tt”) in new stack
– Executing [s@macro-dialout-trunk:11] Macro(“SIP/701-00000008”, “outbound-callerid,1”) in new stack
– Executing [s@macro-outbound-callerid:1] ExecIf(“SIP/701-00000008”, “0?Set(CALLERPRES()=)”) in new stack
– Executing [s@macro-outbound-callerid:2] ExecIf(“SIP/701-00000008”, “0?Set(REALCALLERIDNUM=701)”) in new stack
– Executing [s@macro-outbound-callerid:3] GotoIf(“SIP/701-00000008”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,6)
– Executing [s@macro-outbound-callerid:6] Set(“SIP/701-00000008”, “USEROUTCID=701”) in new stack
– Executing [s@macro-outbound-callerid:7] Set(“SIP/701-00000008”, “EMERGENCYCID=”) in new stack
– Executing [s@macro-outbound-callerid:8] Set(“SIP/701-00000008”, “TRUNKOUTCID=”) in new stack
– Executing [s@macro-outbound-callerid:9] GotoIf(“SIP/701-00000008”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,14)
– Executing [s@macro-outbound-callerid:14] ExecIf(“SIP/701-00000008”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:15] ExecIf(“SIP/701-00000008”, “1?Set(CALLERID(all)=701)”) in new stack
– Executing [s@macro-outbound-callerid:16] ExecIf(“SIP/701-00000008”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:17] ExecIf(“SIP/701-00000008”, “0?Set(CALLERPRES()=prohib_passed_screen)”) in new stack
– Executing [s@macro-outbound-callerid:18] Set(“SIP/701-00000008”, “CDR(outbound_cnum)=701”) in new stack
– Executing [s@macro-outbound-callerid:19] Set(“SIP/701-00000008”, “CDR(outbound_cnam)=”) in new stack
– Executing [s@macro-dialout-trunk:12] GosubIf(“SIP/701-00000008”, “0?sub-flp-1,s,1()”) in new stack
– Executing [s@macro-dialout-trunk:13] Set(“SIP/701-00000008”, “OUTNUM=08453730591”) in new stack
– Executing [s@macro-dialout-trunk:14] Set(“SIP/701-00000008”, “custom=DAHDI/g0”) in new stack
– Executing [s@macro-dialout-trunk:15] ExecIf(“SIP/701-00000008”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)Tt)”) in new stack
– Executing [s@macro-dialout-trunk:16] ExecIf(“SIP/701-00000008”, “0?Set(DIAL_TRUNK_OPTIONS=TtM(confirm))”) in new stack
– Executing [s@macro-dialout-trunk:17] Macro(“SIP/701-00000008”, “dialout-trunk-predial-hook,”) in new stack
– Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit(“SIP/701-00000008”, “”) in new stack
– Executing [s@macro-dialout-trunk:18] GotoIf(“SIP/701-00000008”, “0?bypass,1”) in new stack
– Executing [s@macro-dialout-trunk:19] ExecIf(“SIP/701-00000008”, “1?Set(CONNECTEDLINE(num,i)=08453730591)”) in new stack
– Executing [s@macro-dialout-trunk:20] ExecIf(“SIP/701-00000008”, “1?Set(CONNECTEDLINE(name,i)=CID:701)”) in new stack
– Executing [s@macro-dialout-trunk:21] GotoIf(“SIP/701-00000008”, “0?customtrunk”) in new stack
– Executing [s@macro-dialout-trunk:22] Dial(“SIP/701-00000008”, “DAHDI/g0/08453730591,300,Tt”) in new stack
– Requested transfer capability: 0x00 - SPEECH
– Called DAHDI/g0/08453730591
– DAHDI/i1/08453730591-9f is proceeding passing it to SIP/701-00000008
– Span 1: Channel 0/1 got hangup request, cause 1
– Hungup ‘DAHDI/i1/08453730591-9f’
== Everyone is busy/congested at this time (1:0/0/1)
– Executing [s@macro-dialout-trunk:23] NoOp(“SIP/701-00000008”, “Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 1”) in new stack
– Executing [s@macro-dialout-trunk:24] GotoIf(“SIP/701-00000008”, “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/701-00000008”, “RC=1”) in new stack
– Executing [s-CHANUNAVAIL@macro-dialout-trunk:2] Goto(“SIP/701-00000008”, “1,1”) in new stack
– Goto (macro-dialout-trunk,1,1)
– Executing [1@macro-dialout-trunk:1] Goto(“SIP/701-00000008”, “continue,1”) in new stack
– Goto (macro-dialout-trunk,continue,1)
– Executing [continue@macro-dialout-trunk:1] NoOp(“SIP/701-00000008”, “TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 1 - failing through to other trunks”) in new stack
– Executing [continue@macro-dialout-trunk:2] Set(“SIP/701-00000008”, “CALLERID(number)=701”) in new stack
– Executing [08453730591@from-internal:8] Set(“SIP/701-00000008”, “CALLERID(all)=“701” <701>”) in new stack
– Executing [08453730591@from-internal:9] Set(“SIP/701-00000008”, “_KEEPCID=TRUE”) in new stack
– Executing [08453730591@from-internal:10] Goto(“SIP/701-00000008”, “ext-trunk,1,1”) in new stack
– Goto (ext-trunk,1,1)
– Executing [1@ext-trunk:1] Set(“SIP/701-00000008”, “TDIAL_STRING=DAHDI/g0”) in new stack
– Executing [1@ext-trunk:2] Set(“SIP/701-00000008”, “DIAL_TRUNK=1”) in new stack
– Executing [1@ext-trunk:3] Goto(“SIP/701-00000008”, “ext-trunk,tdial,1”) in new stack
– Goto (ext-trunk,tdial,1)
– Executing [tdial@ext-trunk:1] Set(“SIP/701-00000008”, “OUTBOUND_GROUP=OUT_1”) in new stack
– Executing [tdial@ext-trunk:2] GotoIf(“SIP/701-00000008”, “1?nomax”) in new stack
– Goto (ext-trunk,tdial,4)
– Executing [tdial@ext-trunk:4] ExecIf(“SIP/701-00000008”, “0?Set(CALLERPRES()=)”) in new stack
– Executing [tdial@ext-trunk:5] Set(“SIP/701-00000008”, “DIAL_NUMBER=”) in new stack
– Executing [tdial@ext-trunk:6] GosubIf(“SIP/701-00000008”, “0?sub-flp-1,s,1()”) in new stack
– Executing [tdial@ext-trunk:7] Set(“SIP/701-00000008”, “OUTNUM=”) in new stack
– Executing [tdial@ext-trunk:8] Set(“SIP/701-00000008”, “DIAL_TRUNK_OPTIONS=Tt”) in new stack
– Executing [tdial@ext-trunk:9] Dial(“SIP/701-00000008”, “DAHDI/g0/,300,Tt”) in new stack
– Requested transfer capability: 0x00 - SPEECH
– Called DAHDI/g0/
– DAHDI/i1/-a0 is proceeding passing it to SIP/701-00000008
– Span 1: Channel 0/2 got hangup request, cause 28
– Hungup ‘DAHDI/i1/-a0’
== Everyone is busy/congested at this time (1:0/0/1)
– Executing [tdial@ext-trunk:10] Set(“SIP/701-00000008”, “CALLERID(number)=701”) in new stack
– Executing [tdial@ext-trunk:11] Set(“SIP/701-00000008”, “CALLERID(name)=701”) in new stack
– Executing [tdial@ext-trunk:12] Hangup(“SIP/701-00000008”, “”) inxMonitor close filestream (write)
== Executing [/usr/local/bin/wavmix /var/spool/asterisk/monitor/2014/04/21/out-08453730591-701-20140421-180907-1398100147.321-in.wav /var/spool/asterisk/monitor/2014/04/21/out-08453730591-701-20140421-180907-1398100147.321-out.wav /var/spool/asterisk/monitor/2014/04/21/out-08453730591-701-20140421-180907-1398100147.321.wav]
== End MixMonitor Recording SIP/701-00000008 new stack
== Spawn extension (ext-trunk, tdial, 12) exited non-zero on ‘SIP/701-00000008’
== MixMonitor close filestream (mixed)
== MixMonitor close filestream (read)
== MixMonitor close filestream (write)
== Executing [/usr/local/bin/wavmix /var/spool/asterisk/monitor/2014/04/21/out-08453730591-701-20140421-180907-1398100147.321-in.wav /var/spool/asterisk/monitor/2014/04/21/out-08453730591-701-20140421-180907-1398100147.321-out.wav /var/spool/asterisk/monitor/2014/04/21/out-08453730591-701-20140421-180907-1398100147.321.wav]
== End MixMonitor Recording SIP/701-00000008

Code No. l - Unallocated (unassigned) number.
This cause indicates that the destination requested by the calling user cannot be reached because, although the number is in a valid format, it is not currently assigned (allocated).

What it usually means:

  1.  The SPIDS may be incorrectly entered in the router or the Telco switch, giving a SPID failure in the router logs.
    
  2.  The ISDN phone number being dialed by the router is invalid and the telco switch cannot locate the number to complete the call, as it is invalid.
    
  3.  On long distance calls, the call cannot be properly routed to its destination.

Thanks James, I wasn’t able to test till out of hours last night but you were correct.

For some reason the ISDN30 was not happy about the leading zero, which is present in all UK telephone numbers.

I added a Dialed Number Manipulation Rule within the trunk which seemed to resolve the issue and was able to successfully dial out.

Prepend = I left blank
Prefix = 0
Match Pattern = NXXNXXXXXX

Further testing needs to be carried out as have only tired using an x-lite softphone and a couple of calls but it Seemed to do the trick, if I find any further related issues will up date this post.

Thanks again for your assistance, had been knocking my head on a brick wall about this one for some time.

Before carrying this out please make sure that your prilocaldialplan, pridialplan are set correctly for your area.

I have set to ‘unknown’. I found the below very useful.

http://lists.digium.com/pipermail/asterisk-users/2005-May/102837.html