Two phone numbers always get chanunavail

I have an outbound route using 8|. as the dial pattern. Most clients are able to make outside calls using the outbound route. I have one or two phone numbers which will always get a CHANUNAVAIL status. If I create some misc application that goes to:

[custom-test-1]
exten => s,1,Answer()
exten => s,n,Dial(ZAP/g1/INSERT_NUMBER_HERE) ; g1 is the group for the pri
exten => s,n,Hangup()

the call will be completed as normal. It’s not a provider issue since it can dial out and I did bother the provider to test the line as well.

Here’s the cli output for the outbound route:
– Called g1/THE_NUMBER
– Zap/29-1 is proceeding passing it to SIP/192-b783c2d8
– Channel 0/5, span 2 got hangup request, cause 31
– Hungup ‘Zap/29-1’
== Everyone is busy/congested at this time (1:0/0/1)
– Executing Goto(“SIP/192-b783c2d8”, “s-CHANUNAVAIL|1”) in new stack
– Goto (macro-dialout-trunk,s-CHANUNAVAIL, 1)
– Executing GotoIf(“SIP/192-b783c2d8”, “1?noreport”) in new stack
– Goto (macro-dialout-trunk,s-CHANUNAVAIL,3)
– Executing NoOp(“SIP/192-b783c2d8”, “TRUNK dial failed due to CHANUNAVAIL - failing through to other trunks”) in new stack
– Executing Macro(“SIP/192-b783c2d8”, “outisbusy|”) in new stack
– Executing Playback(“SIP/192-b783c2d8”, “all-circuits-busy-now|noanswer”) in new stack
– Playing ‘all-circuits-busy-now’ (language ‘en’)

I am using:
Asterisk 1.2.24
FreePBX 2.3.0

Edit: I would provide config files but unsure of which ones to provide.

From more testing, it seems like the outbound route will never work. The custom-dial above occasionally will not work. I added another custom dial:

[custom-test-2]
exten => s,1,Answer()
exten => s,n,Dial(ZAP/35/INSERT_NUMBER_HERE)
exten => s,n,Hangup()

The test above works. It’s just weird how custom-test-1 doesn’t always work. Is it because it is trying to make an outside call and an inbound call takes up the same zap channel as the outbound call? Also, the pri is currently on channels 25-47 with 48 being the d-channel.

Using FreePBX, I created a ZAP trunk to a specific channel (ZAP/35). For outbound routes, I have it go to group 1 then to ZAP/35. ZAP/35 will always ring for me.

Here’s the entire cli output for an outbound route going to g1. I replaced the bad phone number with 1113333

-- Executing Macro("SIP/190-b76add90", "dialout-trunk|2|1113333||") in new stack
-- Executing Set("SIP/190-b76add90", "DIAL_TRUNK=2") in new stack
-- Executing Set("SIP/190-b76add90", "DIAL_NUMBER=1113333") in new stack
-- Executing Set("SIP/190-b76add90", "ROUTE_PASSWD=") in new stack
-- Executing GotoIf("SIP/190-b76add90", "1?noauth") in new stack
-- Goto (macro-dialout-trunk,s,6)
-- Executing GotoIf("SIP/190-b76add90", "0?disabletrunk|1") in new stack
-- Executing Set("SIP/190-b76add90", "_NODEST=") in new stack
-- Executing Set("SIP/190-b76add90", "DIAL_TRUNK_OPTIONS=trw") in new stack
-- Executing Set("SIP/190-b76add90", "GROUP()=OUT_2") in new stack
-- Executing Macro("SIP/190-b76add90", "user-callerid|SKIPTTL") in new stack
-- Executing NoOp("SIP/190-b76add90", "user-callerid: device 190") in new stack
-- Executing Set("SIP/190-b76add90", "AMPUSER=190") in new stack
-- Executing GotoIf("SIP/190-b76add90", "0?report") in new stack
-- Executing GotoIf("SIP/190-b76add90", "0?start") in new stack
-- Executing Set("SIP/190-b76add90", "REALCALLERIDNUM=190") in new stack
-- Executing NoOp("SIP/190-b76add90", "REALCALLERIDNUM is 190") in new stack
-- Executing Set("SIP/190-b76add90", "AMPUSER=190") in new stack
-- Executing Set("SIP/190-b76add90", "AMPUSERCIDNAME=Test1") in new stack
-- Executing GotoIf("SIP/190-b76add90", "0?report") in new stack
-- Executing Set("SIP/190-b76add90", "AMPUSERCID=190") in new stack
-- Executing Set("SIP/190-b76add90", "CALLERID(all)="Test1" <190>") in new stack
-- Executing Set("SIP/190-b76add90", "REALCALLERIDNUM=190") in new stack
-- Executing NoOp("SIP/190-b76add90", "TTL:  ARG1: SKIPTTL") in new stack
-- Executing GotoIf("SIP/190-b76add90", "1?continue") in new stack
-- Goto (macro-user-callerid,s,23)
-- Executing NoOp("SIP/190-b76add90", "Using CallerID "Test1" <190>") in new stack
-- Executing Macro("SIP/190-b76add90", "record-enable|190|OUT") in new stack
-- Executing GotoIf("SIP/190-b76add90", "0?2:4") in new stack
-- Goto (macro-record-enable,s,4)
-- Executing DeadAGI("SIP/190-b76add90", "recordingcheck|20070907-150545|1189202745.26931") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck

recordingcheck|20070907-150545|1189202745.26931: Outbound recording not enabled
– AGI Script recordingcheck completed, returning 0
– Executing NoOp(“SIP/190-b76add90”, “No recording needed”) in new stack
– Executing GotoIf(“SIP/190-b76add90”, “0?skipoutcid”) in new stack
– Executing Set(“SIP/190-b76add90”, “DIAL_TRUNK_OPTIONS=w”) in new stack
– Executing Macro(“SIP/190-b76add90”, “outbound-callerid|2”) in new stack
– Executing GotoIf(“SIP/190-b76add90”, “1?start”) in new stack
– Goto (macro-outbound-callerid,s,3)
– Executing NoOp(“SIP/190-b76add90”, “REALCALLERIDNUM is 190”) in new stack
– Executing GotoIf(“SIP/190-b76add90”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,9)
– Executing Set(“SIP/190-b76add90”, “USEROUTCID=”) in new stack
– Executing Set(“SIP/190-b76add90”, “EMERGENCYCID=”) in new stack
– Executing Set(“SIP/190-b76add90”, “TRUNKOUTCID=18002324238”) in new stack
– Executing GotoIf(“SIP/190-b76add90”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,16)
– Executing GotoIf(“SIP/190-b76add90”, “0?usercid”) in new stack
– Executing Set(“SIP/190-b76add90”, “CALLERID(all)=18002324238”) in new stack
– Executing GotoIf(“SIP/190-b76add90”, “1?report”) in new stack
– Goto (macro-outbound-callerid,s,22)
– Executing NoOp(“SIP/190-b76add90”, “CallerID set to “” <18002324238>”) in new stack
– Executing GotoIf(“SIP/190-b76add90”, “1?nomax”) in new stack
– Goto (macro-dialout-trunk,s,17)
– Executing AGI(“SIP/190-b76add90”, “fixlocalprefix”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/fixlocalprefix
– AGI Script fixlocalprefix completed, returning 0
– Executing Set(“SIP/190-b76add90”, “OUTNUM=1113333”) in new stack
– Executing Set(“SIP/190-b76add90”, “custom=ZAP/g1”) in new stack
– Executing GotoIf(“SIP/190-b76add90”, “1?gocall”) in new stack
– Goto (macro-dialout-trunk,s,22)
– Executing GotoIf(“SIP/190-b76add90”, “0?customtrunk”) in new stack
– Executing Dial(“SIP/190-b76add90”, “ZAP/g1/1113333|300|w”) in new stack
– Requested transfer capability: 0x00 - SPEECH
– Called g1/1113333
– Zap/28-1 is proceeding passing it to SIP/190-b76add90
– Channel 0/4, span 2 got hangup request, cause 31
– Hungup ‘Zap/28-1’
== Everyone is busy/congested at this time (1:0/0/1)
– Executing Goto(“SIP/190-b76add90”, “s-CHANUNAVAIL|1”) in new stack
– Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
– Executing GotoIf(“SIP/190-b76add90”, “1?noreport”) in new stack
– Goto (macro-dialout-trunk,s-CHANUNAVAIL,3)
– Executing NoOp(“SIP/190-b76add90”, “TRUNK Dial failed due to CHANUNAVAIL - failing through to other trunks”) in new stack
– Executing Macro(“SIP/190-b76add90”, “outisbusy|”) in new stack
– Executing Playback(“SIP/190-b76add90”, “all-circuits-busy-now|noanswer”) in new stack
– Playing ‘all-circuits-busy-now’ (language ‘en’)
== Parsing ‘/etc/asterisk/manager.conf’: Found
== Manager ‘admin’ logged on from 127.0.0.1
colopbx*CLI> exit

– Channel 0/4, span 2 got hangup request, cause 31

from http://networking.ringofsaturn.com/RemoteAccess/isdncausecodes.php

Cause No. 31 - normal. unspecified. This cause is used to report a normal event only when no other cause in the normal class applies.

So that is a funny cause code to return… I have no more help to give though

Even though I figured out the issue months ago, I just wanted to post the cause in case it happens to anyone else in the future. When I set up the Outbound Caller ID for the ZAP Trunk, I used a 1-800-xxx-xxxx number. Apparently, some phone companies or vendors do not like the format and thus, reject the call. By setting the caller id to 800-xxx-xxxx, the incident never manifested itself again.