Simplest of extensions not matching

Hello everybody,

I have the following .conf files in a PBX <- Asterisk -> ISDN PSTN configuration, but, despite what is stated in the whole of manuals and forums available over the net and my best efforts, and can’t get this dialplan to work as expected:

I was hoping to have all the dialed numbers starting with “22” to be routed to a regular ISDN landline and the international ones to be routed trough a VoipBuster (or other ITSP provider) account.

As you can see, apparently all my matchings should be slick, however, I find Asterisk dialing just the 22 or 00 plus another digit down the line instead of waiting to see the whole number.

I also tried for example to match dialed numbers with an extension “_22xxxxxxx”, but Asterisk allows me to dial extra digits beyond the expected 9!

This is absolutely incoherent with the behaviour described in all the texts and i’m starting to despair with this simple but unexplained error :frowning:( !

Am I missing something?

I’m using version 1.0.7-BRIstuffed-0.2.0-RC7k as available in the official Debian mirrors.

Thanks for your help in advance!

Sergio


EXTENSIONS.CONF

[general]

static=yes
writeprotect=no

[globals]

[default]

[PBX_PSTN]

include => All

exten => _22.,1,Dial(misdn/1/${EXTEN})
exten => h,1,Hangup

[PSTN_PBX]

exten => _X.,1,Dial(misdn/4/${EXTEN})
exten => _X.,2,Hangup

[All]

exten => _00.,1,Dial(misdn/1/${EXTEN})
exten => _00.,2,Hangup

SIP.CONF

[general]

port = 5090 ;
bindaddr = 0.0.0.0;

srvlookup=yes

disallow=all
allow=gsm
allow=ilbc
allow=speex
allow=lpc10
allow=ulaw
allow=alaw

[voipbuster]
type=peer
host=sip.voipbuster.com
username=AbC
fromuser=AbC
secret=xYz

Have you tried making your dialplan a little more absolute? I’m thinking that perhaps the way your system is matching the numbers its finding a possible match.
I’ve encountered similar problems so here’s an example from my dialplan.
The first one matches a few crazy sequences that all travel down a particular IAX trunk. The second group go across the regular PSTN network.

[outrt-001-FRJtoTNS]
exten => 9754,1,Macro(dialout-trunk,6,${EXTEN},)
exten => 9754,2,Macro(outisbusy) ; No available circuits
exten => _42XX,1,Macro(dialout-trunk,6,${EXTEN},)
exten => _42XX,2,Macro(outisbusy) ; No available circuits
exten => _48955536XX,1,Macro(dialout-trunk,6,${EXTEN:6},)
exten => _48955536XX,2,Macro(outisbusy) ; No available circuits
exten => _9185655523XX,1,Macro(dialout-trunk,6,${EXTEN:8},)
exten => _9185655523XX,2,Macro(outisbusy) ; No available circuits

[outrt-004-outside]
exten => _216.,1,Macro(dialout-trunk,1,${EXTEN:3},)
exten => _216.,2,Macro(outisbusy) ; No available circuits
exten => _9.,1,Macro(dialout-trunk,1,${EXTEN:1},)
exten => _9.,2,Macro(outisbusy) ; No available circuits

Have a read of this:

voip-info.org/wiki/index.php … nf+sorting

Many thanks for your responses, however, the matching order is not the problem.
The real weird thing is that the matches made are only for the specified prefixes plus 1 extra digit. For example:

If I do an “exten => _22.,1,…” and then dial “22xyz”, Asterisk will only attempt to send out a “22x” down the line. This is not the expected behaviour derived from all the articles I’ve read :\

Whether it’s expected or not depends entirely on the rest of your Dial statement - you’d better post the whole thing, not just the first few characters!

The whole shebang is in my first post :wink:

If you mean that your SIP phone is sending the number to Asterisk before you anticipated, then the issue may be with the phone itself and not Asterisk. You might want to look in your phone docs for “digitmap.” If you are using a Polycom phone, this would be in sip.cfg.

To clarify, some SIP phones send each individual digit to Asterisk and then Asterisk follows the plan. Other phones will send a group of digits to Asterisk upon hitting the “Send” or “Dial” softkey, or upon reaching some matching pattern for the phone’s internal digitmap. You may be hitting that digitmap in the phone.

Yes!
That’s exactly the problem!!
I finally figured out that when the number is dialed trough my SIP apparatus (for example a call from Phone->Ser->Asterisk) and the same dialplan is used to route calls outside everything works fine because the number is sent in block!

However when I dial from the ISDN phones hooked up to the PBX, the console shows me that Asterisk receives one digit at a time as you wondered.

I was expecting it to be more “intelligent” and wait for a whole number before the matching went underway (I read something about the Zaptel drivers doing that for POTS channels), but apparently that does not happen.

Well, since the PBX is not to be tampered with, is there any way/trick/macro? to make Ast. wait for a whole number albeit receiving it digit by digit?

Thank you for any suggestions. :smile:

Can you turn off “early dial” in the configuration of your SIP apparatus?

Have a look at the “Early Dial” section on this page:

voip-info.org/wiki/index.php?pag … +budgetone

It’s not directly related to your problem, but it may shed a little bit of light on it.

Hi there,

As I said, I don’t have any problem with my SIP devices, given that, as you suggested, they pretty much function already with block dialing or are configurable to do so.

The problem exists solely with regular ISDN phones and my regular ISDN PBX. The PBX sends out the numbers digit-by-digit and that messes up Ast.'s matching. :\

I have to come up with a method to force Ast. to wait for a given time while receiving digits, and then, after that times-out, do it’s extensions comparisons.

Sorry about that irrelevant response then. I obviously haven’t been paying attention! :wink:

Thanks anyway :smile: