[Asterisk-Users] Pattern-matching in the dial-plan
Hey all, I'm trying to add some logic to a dial-plan to allow the caller to terminate a number with a #, but also accept it without this terminator. While trying this, I noticed that, for example, extension _[*0-9]XXX.# always seems to match, whether the last digit dialled is a # or not. It's as if the parser assumes everything after the . will match and doesn't look any further. Is this expected behaviour? If so, what would be the best solution to my problem? I currently solved it by avoiding the . and matching every possible number-length seperately, both with and without the #-terminator. It works, but seems like it should be doable with just 2 matches. The box I'm trying this on is running the CVS HEAD of about a week ago. Thanks in advance for any suggestions. Grtz, Oliver ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] Pattern-matching in the dial-plan
dialled is a # or not. It's as if the parser assumes everything after the . will match and doesn't look any further. Is this expected behaviour? Yes, the dot says match ANYTHING from here on AFAIK ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] Pattern-matching in the dial-plan
On Sun, 12 Dec 2004, Wilson Pickett wrote: dialled is a # or not. It's as if the parser assumes everything after the . will match and doesn't look any further. Is this expected behaviour? Yes, the dot says match ANYTHING from here on AFAIK To be precise it will match one or more digits, ognoring the rest of the pattern as well. There is no match zero-or-more wildcard and no wildcard that tries to continue to read the pattern after the wildcard. The former can easily be implemented, we had to do it to handle some cases of overlap dialing. We'll clean it up and submit it later. The latter case could probably be implemented in the ast_extension_match ast_extension_close EXTENSION_MATCH_CORE functions in pbx.c. Alternativly a regular or extended regexp could be added as a an extension switch, similar to pbx_loopback.c. Yet another option would be to integrate it with the res_perl in asterisk-addons. Peter ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users