FreePBX 2.4 can't dial phones starting with "0"

Hi there everyone, thanks for taking the time to read my post.
I am new to freepbx, and my system is really simple. I just got an E1 and 7 extensions. I can receive and make call, but something odd happens.
If the phone number starts with “0” I receive the message that all trunks are busy now. I’m in the UK so all the phone start with 01, 02 or 07 basically but the “0” not necessary need to be dialed, so I created the following dial pattern “0|.” And it seams to be the only one that works. I don’t need any specific pattern, a simple “.” would be enough but doesn’t work. That’s fine local call can be made, but the problem starts when I need to make international call. I tried phones starting from 0 to 9 and the ones starting with 0 are the only one that doesn’t work.
Anyone got an idea what it can be?
Regards
Fernando

Hi Everyone…

I was doing some tests and I found out that others pattern work as well. I just can’t dial a “ZERO” first.
Somebody knows why I can’t dial “ZERO” as first number?

The format you are using is for a dial prefix to be removed before dialling, like 9 to select a trunk would be 9|.

To route all calls starting 0 plus 1-9 try 0Z. (zero zed dot)

You may want slightly more complex if you want to separate Local, UK, International etc., you can do this by using Xs to match the number of digits, ie.
4XXXXX would match any six digit number starting with four.
The ‘.’ matches any number of characters, if you are not trying to match the number of digits.

Hold your mouse over the ‘Dial Patterns’ title in Outbound routes & you’ll get a popup tooltip with the character match rules.

Hi rjenkinsgb, thanks for your answer but my problem is not the dial pattern. I even need one to tell you the true.
Take a look at these logs:

When I use “0|.” as dial pattern and dial 02073400100 (It works, the phone doesn’t start with 0)

– Executing [[email protected]:20] Dial(“SIP/21-0a2780c8”, “ZAP/g0/2073400100|300|tT”) in new stack
– Requested transfer capability: 0x00 - SPEECH
– Called g0/2073400100
– Zap/1-1 is proceeding passing it to SIP/21-0a2780c8
– Zap/1-1 is ringing
– Zap/1-1 answered SIP/21-0a2780c8

When I use “.” as dial pattern and dial 02073400100 (Doesn’t Work, the phone starts with 0. I can use this dial patterns since the phone start from1-9.)

-- Executing [[email protected]:20] Dial("SIP/21-0a2780c8", "ZAP/g0/02073400100|300|tT") in new stack
-- Requested transfer capability: 0x00 - SPEECH
-- Called g0/02073400100
-- Zap/1-1 is proceeding passing it to SIP/21-0a2780c8
-- Channel 0/1, span 1 got hangup request, cause 1
-- Hungup 'Zap/1-1'

== Everyone is busy/congested at this time (1:0/0/1)
– Executing [[email protected]:21] Goto(“SIP/21-0a2780c8”, “s-CHANUNAVAIL|1”) in new stack
– Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
– Executing [[email protected]:1] GotoIf(“SIP/21-0a2780c8”, “1?noreport”) in new stack
– Goto (macro-dialout-trunk,s-CHANUNAVAIL,3)
– Executing [[email protected]:3] NoOp(“SIP/21-0a2780c8”, “TRUNK Dial failed due to CHANUNAVAIL - failing through to other trunks”) in new stack
– Executing [[email protected]:5] Macro(“SIP/21-0a2780c8”, “outisbusy|”) in new stack
– Executing [[email protected]:1] Playback(“SIP/21-0a2780c8”, “all-circuits-busy-now|noanswer”) in new stack
– <SIP/21-0a2780c8> Playing ‘all-circuits-busy-now’ (language ‘en’)
– Executing [[email protected]:2] Playback(“SIP/21-0a2780c8”, “pls-try-call-later|noanswer”) in new stack
– <SIP/21-0a2780c8> Playing ‘pls-try-call-later’ (language ‘en’)
– Executing [[email protected]:3] Macro(“SIP/21-0a2780c8”, “hangupcall”) in new stack
– Executing [[email protected]:1] ResetCDR(“SIP/21-0a2780c8”, “w”) in new stack
– Executing [[email protected]:2] NoCDR(“SIP/21-0a2780c8”, “”) in new stack
– Executing [[email protected]:3] GotoIf(“SIP/21-0a2780c8”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,6)
– Executing [[email protected]:6] GotoIf(“SIP/21-0a2780c8”, “1?skipblkvm”) in new stack
– Goto (macro-hangupcall,s,9)
– Executing [[email protected]:9] GotoIf(“SIP/21-0a2780c8”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,11)
– Executing [[email protected]:11] Hangup(“SIP/21-0a2780c8”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on ‘SIP/21-0a2780c8’ in macro ‘hangupcall’
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on ‘SIP/21-0a2780c8’ in macro ‘outisbusy’
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'SIP/21-0a2780c8’
Extension Changed 21[ext-local] new state Idle for Notify User 21

Any clue?

Hi,
I can’t make much sense of that…

What do you have as dial patterns in outbound routes, and also what in Dial Rules in the trunk?

For a zap trunk on a BT line, with six digit local numbers, I have:
Outbound route, Dial patterns

0[1278]X.
47XXXX
48XXXX
5XXXXX
7XXXXX

and the Dial Rules in the trunk itself are empty.

If you want any number to dial out, but not mess up internal, pad the dial pattern with Xs so it needs that number of digits before the routre works, like XXXXX. would accept any number as long as it’s at least five (or six?) digits long, so it does not try to route internal extensions over the trunk.

Hi rjenkinsgb,

My dial rules in the trunk are empty as well and I changed in the outbound route my dial patter to XXXXX. as you said and I got the same result.
I think that the problem happens right here:

When doesn’t work:
– Requested transfer capability: 0x00 - SPEECH
– Called g0/02073400100
– Zap/2-1 is proceeding passing it to SIP/21-0a2649f0
– Channel 0/2, span 1 got hangup request, cause 1
– Hungup ‘Zap/2-1’

When Works:
– Requested transfer capability: 0x00 - SPEECH
– Called g0/2073400100
– Zap/2-1 is proceeding passing it to SIP/21-0a2649f0
– Zap/2-1 is ringing
– Zap/2-1 answered SIP/21-0a2649f0

What I need to know is what happens between the 2ª and 3ª, 3ª and 4ª (Process running behind and which configurations are taking place at this moment)? With the same configuration with 2 different results just because the phone starts with 0. What’s cause 1? When it says “passing it to SIP…” who is handle the call?

What do you think?
Thank you.

I’ve not used ISDN cards, but suspect it’s something specific to the ZAP digital trunk setup.

Done a quick search and found this:

In /etc/asterisk/zapata.conf
make sure you have this:

pridialplan=unknown

Apparently you get ‘all circuits busy’ or hangups if this is wrong.

(You will need to restart after making changes).

Hi,

We use ISDN cards (Multi bearer PRI) in the UK and we use the dial plan entry shown.

Below is one of our zaptel setups.

Graham

zapata.conf

[trunkgroups]

[channels]
language=en
usecallerid=yes
hidecallerid=no
callwaiting=no
callwaitingcallerid=yes
restrictcid=no
usecallingpres=no
threewaycalling=yes
callreturn=yes
transfer=yes
cancallforward=yes
echocancelwhenbridged=yes
echocancel=yes
musiconhold=default
rxgain=0.0
txgain=0.0
signalling=pri_cpe
switchtype=euroisdn
immediate=no
overlapdial=yes
pridialplan=unknown
prilocaldialplan=unknown

#Dual Bearers, 20 channels on each
group=0
context=from-zaptel-custom
callgroup=1
pickupgroup=1
channel => 1-15
channel => 17-21

group=1
context=from-zaptel-custom
callgroup=1
pickupgroup=1
channel => 32-46
channel => 48-52

zaptel.conf

#Bearer 1
span=1,1,1,ccs,hdb3,crc4
bchan=1-15
dchan=16
bchan=17-31

#Bearer 2
span=2,2,1,ccs,hdb3,crc4
bchan=32-46
dchan=47
bchan=48-62

Global data

loadzone = uk
defaultzone = uk

Thank you very much guys.

After adding these 2 lines to zapata.conf my problem was solved.

pridialplan=unknown
prilocaldialplan=unknown

Cheers.