Hello
I have the following setup:
[ul]
[li]PC running Linux(Debian/Sarge) and Asterisk (1.0.7)[/li]
[li]a HFC-based ISDN-card in the PC in NT-mode (E-Tech PCTA128 PCI ISDN board)[/li]
[li]one softphone client (sjphone)[/li]
[li]one ISDN-to-analog converter/pabx connected to the ISDN-card via a crossed ISDN-cable (duovox)[/li][/ul]
Most things work fine. For example: I can call the analog phones behing the duovox from the sjphone-softphone via asterisk, I can even call the analog phones from PSTN phones via a gateway (like the free world dialup access number provider by xs4all in the Netherlands). Very nice!
I can dial out with the SJphone-softphone, no problems there.
Dialing out from the analog phones however is a problem. I think it has to do with the dialplan in extensions.conf, probably I misunderstand how asterisk handles “match-as-you-go” dialing (http://www.voip-info.org/wiki-Asterisk+Extension+Matching).
I planned my dialplan to result in the following behaviour of Asterisk:
[ul]
[li]numbers starting with “0” are “real” phonenumbers and are handled by my sip-provider (e.g: 0612345678 --> sip:0612345678@provider.nl)[/li]
[li]numbers not starting with a “0” are local or special numbers (e.g: 31 --> misdn/1/31 is a analog phone)[/li][/ul]
My dialplan (see end of this message) works for the SJphone client. But for the analog phones I get the following behaviour when I try to dial 0623456789:
After the first 3 digits (062):
-- Executing Dial("mISDN/1", "SIP/06@provider") in new stack
-- Called 06@provider
-- Got SIP response 404 "User not found" back from 12.34.56.78
-- SIP/provider-e19c is circuit-busy
== Everyone is busy/congested at this time
WARNING[30263]: pbx.c:1938 ast_pbx_run: Invalid extension '2', but no rule 'i' in context 'intern'
Asterisk immediately dials sip:06@provider without waiting for the number to be complete… This is what I tried to avoid with the “include=>longnumbers” before the “include=>normalnumbers”. But is does not work…
The problem is that I can not say beforehand how long the phonenumber is going to be. It depends on the destination (national/international/toll-free/etc). I can make it work for most national numbers in Holland, since they are all 10 digits. If I change the line
exten => 0.,1,Dial…
into
exten =>0XXXXXXXXX,1,Dial…
I get what I want for most national Dutch numbers.
How can I make this also work for any number (short (few digits) toll free numbers, long (many digits) internation numbers)?
Here is my asterisk configuration:
misdn.conf
[general]
context=intern
language=en
immediate=no
debug=0
msns=*
[NTports]
context=intern
ports=1
relevant part of extensions.conf:
[intern]
exten => 31,1,Dial(misdn/1/31)
include => longnumbers
include => normalnumbers
[longnumbers]
exten => _0XXXXXXXXXXXXXX,1,Congestion
[normalnumbers]
exten => _0.,1,Dial(SIP/${EXTEN:0}@provider)