[Asterisk-Users] Re: Pattern matching problem

Andrew Kohlsmith akohlsmith-asterisk at benshaw.com
Wed Apr 26 17:53:08 MST 2006


On Wednesday 26 April 2006 20:34, hugolivude wrote:
> Thanks, but the problem's with the first extension:
>
> exten => _NXXXXXX,1,NoOp(Number dialed ${EXTEN})
> exten => _NXXXXXX,n,Dial(Zap/1/${EXTEN})
>
> The problem is I _do_ get a match as you can see by the CLI output,
> but it shouldn't match IMO - 6137451576 shouldn't match _NXXXXXX but
> that line gets executed.

When you dial "six one three seven four five one" Asterisk says "hey!  That 
matches _NXXXXXX!" -- the fact that you have "five seven six" left means 
nothing, just as you can dial 1-800-PROGRESSIVE as Eric stated earlier.

On analog Zap interfaces, Asterisk (just like the telco) simply listens until 
the digits match.  If you don't want a ten digit number to match, then adjust 
your dialplan accordingly.  This is not a strange error in Asterisk, it is a 
mismatch between what you want the system to do and how the system operates.

Digital Zap channels and VOIP channels do not work this way because the entire 
number is sent in one "go" -- when you dial from a SIP phone, Asterisk does 
not see a stream of digits, it sees one "message" or "packet" of information 
with the entire phone number in it.  That is why it doesn't match with SIP or 
IAX or PRI channels.  (overlap dial excepted.)

-A.

-A.

>
> There was a cut/paste error with the others BTW.  I thought I'd
> replaced the defines with the actual numbers for clarity, but I made a
> mistake.  They are actually this way in my plan:
>
> exten => ${LD_PATTERN},1,Dial(Zap/1/${EXTEN})
> exten => ${INT_PATTERN},1,Dial(Zap/1/${EXTEN})
>
> Thanks,
> H
>
> On 4/26/06, Eric ManxPower Wieling <eric at fnords.org> wrote:
> > 1) Your exten => _1XXXXXXXXXX,n,Dial(Zap/1/${EXTEN}) does not start with
> > priority "1" so it will never match
> >
> > 2) The 10 digit number you dialed does not start with a 1 so it will
> > never match, even if the priority issue is fixed.
> >
> > Asterisk knows that once you've dialed 7 digits no OTHER pattern can
> > match what you are dialing and so it matches the 7 digits you dialed.
> >
> > For the most part exten => i is only run during IVR (WaitExten,
> > Background, etc) and not when dialing from a phone.
> >
> > BTW, this works just like the Telco.  You can dial as many extra digits
> > as you want, and the telco will ignore the extra ones, which is why you
> > can dial 1-800-PROGRESSIVE it will work (assuming such a number exists).
> >
> > hugolivude wrote:
> > > I'm running Asterisk 1.2.7.1 on Red hat 9 and have a strange pattern
> > > matching problem:
> > >
> > > I have the following in my dial plan:
> > > exten => _NXXXXXX,1,NoOp(Number dialed ${EXTEN})
> > >
> > > exten => _NXXXXXX,n,Dial(Zap/1/${EXTEN})
> > >
> > >
> > > Unless I'm missing something, I wouldn't expect the pattern above to
> > > match a 10 digit number, but when I dial 6137451576, I see the
> > > following in the CLI:
> > >
> > >     -- Executing NoOp("Zap/1-1", "Number dialed 6137451") in new stack
> > >     -- Executing Dial("Zap/1-1", "Zap/1/6137451") in new stack
> > >
> > > As you can see, the last 3 digits are truncated in the dial cmd.
> > >
> > > This is odd behaviour isn't it?   _NXXXXXX shouldn't be a match for a
> > > 10 digit number!
> > >
> > > The other patterns I have are:
> > >
> > >
> > > exten => _1XXXXXXXXXX,n,Dial(Zap/1/${EXTEN})
> > > exten => _011.,n,Dial(Zap/1/${EXTEN})
> > >
> > > so in fact I would have expected 6137451576 to fall thru to here:
> > >
> > > exten => i,1,AbsoluteTimeout(15)
> > >
> > > exten => i,n,Playtones(congestion)
> > >
> > > exten => i,n,Congestion
> > >
> > > exten => i,n,Hangup
> >
> > --
> > Now accepting new clients in Birmingham, Atlanta, Huntsville,
> > Chattanooga, and Montgomery.
> > _______________________________________________
> > --Bandwidth and Colocation provided by Easynews.com --
> >
> > Asterisk-Users mailing list
> > To UNSUBSCRIBE or update options visit:
> >    http://lists.digium.com/mailman/listinfo/asterisk-users
>
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> Asterisk-Users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users



More information about the asterisk-users mailing list