In article <CAEebyNX5JffKHFxwRJ3pSbG7YpeDLWweE=wjdmvwyzqysls...@mail.gmail.com>, Jonathan H <lardconce...@gmail.com> wrote: > On 13 October 2016 at 13:18, Tony Mountifield <t...@softins.co.uk> wrote: > > > exten => _X,1,NoOp(Matching single digit) > > exten => _X.,1,NoOp(Matching multiple digits) > > exten => _X!,2,SayNumber(${EXTEN}) > > exten => _X!,3,Etc.. > > Thanks - I appreciate the idea, but it matches more than 2 digits. > > But, thanks to your info, I cobbled together something that works, and > matches only 1 or 2 digits in what I think is the most compact way, by > sending a 1 digit extension to the 2 digit matcher, prefixed with a 0. > Example which works: > > [extentest] > exten => s,1,Set(TIMEOUT(digit)=1) > same => n,BackGround(extension) > same => n,WaitExten(5) > exten => _X,1,Goto(0${EXTEN},1) > exten => _XZ,1,SayNumber(${EXTEN}) > same => n,Goto(s,1) > exten => e,1,Goto(s,1) > > ***HOWEVER!!!!*** Do I need to report a bug? > > Either: > > A: All the documentation is wrong and ". (period) Wildcard match; > matches one or more characters" is NOT actually how Asterisk works. > or > B: The documentation is correct and Asterisk's "one of more character > matching" routine is wrong > or > C: I've completely misunderstood what "matches one of more characters" means > :) > > What's the consensus? Thanks!
As I understand it, there are two different functionalities overloaded on the operators. 1. The . in a pattern will match one or more digits, but only when WaitExten has exited due to the digit timeout. Even if the number being collected would match the ., it does not do so until Asterisk decides no more digits will be entered. 2. The ! in a pattern will match zero or more digits, and will also cause WaitExten to be satisfied as soon as it can match the pattern, without waiting for more digits. It's a pity that the choice between one-or-more and zero-or-more is overloaded with wait-for-dialling-pause and match-immediately, rather than being selectable independently. But it's been like that ever since ! was introduced, probably over 10 years ago. Cheers Tony -- Tony Mountifield Work: t...@softins.co.uk - http://www.softins.co.uk Play: t...@mountifield.org - http://tony.mountifield.org -- _____________________________________________________________________ -- 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