In article <>,
Jonathan H <> wrote:
> Back to basics here. I want to match on one OR two digits.
> The following two both work, but ONLY for more than one digit, which
> is not as expected from the docs (see below).
> exten => _X.,1,SayNumber(${EXTEN})
> exten => _[0-9].,1,SayNumber(${EXTEN})
> This next one will ONLY match 2 digits, as expected, but the first two
> SHOULD match one or more, right?
> exten => _XX,1,SayNumber(${EXTEN})
> The following pattern works, but I thought it was "dangerous" and to
> be discouraged?
> exten => _.,1,SayNumber(${EXTEN})
> So, again, if someone dials 1 and a one second delay passes, I want it to say 
> 1.
> If someone dials 1 then another 1 within a second then I want it to be
> 11, and 111 should be invalid.
> (I've Set(TIMEOUT(digit)=1) )
> Yes, I can do this with multiple lines, but the docs suggest this
> should be easily do-able in 1 line, and I don't want to double the
> amount of dialplan (there'll be a few of these!).

When matching an extension being dialled, Asterisk is only concerned
about priority 1, so that's the only priority you need to double.
You should be able to use ! safely in priority 2 upwards:

exten => _X,1,NoOp(Matching single digit)
exten => _X.,1,NoOp(Matching multiple digits)
exten => _X!,2,SayNumber(${EXTEN})
exten => _X!,3,Etc..

Disclaimer: I haven't tested this.

Tony Mountifield
Work: -
Play: -

-- Bandwidth and Colocation Provided by --

Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016

New to Asterisk? Start here:

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:

Reply via email to