Sorry, I should have said, I already tried "!".

It matches immediately and doesn't wait for a second digit.

On 13 October 2016 at 12:05, Jean Aunis <jean.au...@prescom.fr> wrote:
> You can use the "!" character :
>
> exten => _X!,1,SayNumber(${EXTEN})
>
>
> Best regards
>
> Jean Aunis
>
>
> Le 13/10/2016 à 12:54, Jonathan H a écrit :
>>
>> 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!).
>>
>> Here are my references:
>>
>> ---------------------------------------------------
>>
>> https://wiki.asterisk.org/wiki/display/AST/Pattern+Matching
>>
>> The letter X or x represents a single digit from 0 to 9.
>> The period character (.) at the end of a pattern matches one or more
>> remaining characters. You put it at the end of a pattern when you want
>> to match extensions of an indeterminate length.
>>
>> ---------------------------------------------------
>>
>> Page 141 of the Asterisk Definitive Guide 4th Edition:
>>
>> . (period)
>> Wildcard match; matches one or more characters, no matter what they are.
>> If you’re not careful, wildcard matches can make your dialplans do
>> things you’re not expecting (like matching built-in extensions such
>> as i or h). You should use the wildcard match in a pattern only after
>> you’ve matched as many other digits as possible. For example, the
>> following pattern match should probably never be used:
>> _.
>> In fact, Asterisk will warn you if you try to use it. Instead, if you
>> really need a catchall pattern match, use this one to match all strings
>> that start with a digit followed by one or more characters (see ! if
>> you want to be able to match on zero or more characters):
>> _X.
>> Or this one, to match any alphanumeric string:
>> _[0-9a-zA-Z].
>>
>> ---------------------------------------------------
>>
>> http://www.voip-info.org/wiki/view/Asterisk+Dialplan+Patterns
>> Do not use a pattern of _. as this will match everything including
>> Asterisk special extensions like i, t, h, etc. Instead use something
>> like _X. or _X which will not match __special__ extensions..
>> So what do you use instead of _. ? Many examples use this construct,
>> but if you use it you may see a warning message in the log advising
>> you to change _. to _X.
>>
>> ---------------------------------------------------
>>
>
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016
>      http://www.asterisk.org/community/astricon-user-conference
>
> New to Asterisk? Start here:
>      https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016
      http://www.asterisk.org/community/astricon-user-conference

New to Asterisk? Start here:
      https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to