[asterisk-users] Can Asterisk match a literal * in extensions.conf
I am working on getting freenum.org ISN/ITAD numbers integrated into my exiting dialplan however I am having trouble getting the extension matches to work as expected. I would like to be able to do something like: exten = _X.*.,1,Macro(isn-outbound...) Where I would expect that any extension that starts with at least one number, but includes a literal * followed by 1 or more numbers would match. This is not the case, and it matches any extension that starts with a number. Thank you in advance for your assistance. -- Anthony - http://messinet.com - http://messinet.com/~amessina/gallery 8F89 5E72 8DF0 BCF0 10BE 9967 92DC 35DC B001 4A4E signature.asc Description: This is a digitally signed message part. ___ Sign up now for AstriCon 2007! September 25-28th. http://www.astricon.net/ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Can Asterisk match a literal * in extensions.conf
. matches any number of the preceding character, change it to _X.*X. Anthony Messina wrote: I am working on getting freenum.org ISN/ITAD numbers integrated into my exiting dialplan however I am having trouble getting the extension matches to work as expected. I would like to be able to do something like: exten = _X.*.,1,Macro(isn-outbound...) Where I would expect that any extension that starts with at least one number, but includes a literal * followed by 1 or more numbers would match. This is not the case, and it matches any extension that starts with a number. Thank you in advance for your assistance. ___ Sign up now for AstriCon 2007! September 25-28th. http://www.astricon.net/ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -- Thank you and have a wonderful day, Anthony Francis Rockynet VOIP (303) 444-7052 opt 2 [EMAIL PROTECTED] ___ Sign up now for AstriCon 2007! September 25-28th. http://www.astricon.net/ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Can Asterisk match a literal * in extensions.conf
I don't think * means anything special to A*k, But wouldn't it be: _X.*X. To match as you ask ? (number)(wildcard)*(number)(wildcard) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Anthony Messina Sent: 14 September 2007 17:40 To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [asterisk-users] Can Asterisk match a literal * in extensions.conf I am working on getting freenum.org ISN/ITAD numbers integrated into my exiting dialplan however I am having trouble getting the extension matches to work as expected. I would like to be able to do something like: exten = _X.*.,1,Macro(isn-outbound...) Where I would expect that any extension that starts with at least one number, but includes a literal * followed by 1 or more numbers would match. This is not the case, and it matches any extension that starts with a number. Thank you in advance for your assistance. -- Anthony - http://messinet.com - http://messinet.com/~amessina/gallery 8F89 5E72 8DF0 BCF0 10BE 9967 92DC 35DC B001 4A4E ___ Sign up now for AstriCon 2007! September 25-28th. http://www.astricon.net/ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Can Asterisk match a literal * in extensions.conf
On Friday 14 September 2007 11:39:40 Anthony Messina wrote: I am working on getting freenum.org ISN/ITAD numbers integrated into my exiting dialplan however I am having trouble getting the extension matches to work as expected. I would like to be able to do something like: exten = _X.*.,1,Macro(isn-outbound...) The problem you're seeing is that the period is a short-circuit operator. It says if you match everything so far and at least one more character, then you have a match, no need to go any further. You CANNOT match past a '.'. -- Tilghman ___ Sign up now for AstriCon 2007! September 25-28th. http://www.astricon.net/ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Can Asterisk match a literal * in extensions.conf
On Fri, 2007-09-14 at 10:51 -0600, Anthony Francis wrote: . matches any number of the preceding character, change it to _X.*X. That still won't help. Once the Asterisk pattern matching parser sees a period in the pattern, it ignores anything after it. (I'm not exactly happy about that, but that's the way it is.) In short, Asterisk doesn't currently have a good way of handling this situation. Hopefully somebody infinitely smarter than I am will take pity on our plight and give us a some more advanced pattern-matching tools. (Hint, hint) -- Jared Smith Community Relations Manager Digium, Inc. ___ Sign up now for AstriCon 2007! September 25-28th. http://www.astricon.net/ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Can Asterisk match a literal * in extensions.conf
i just met the same problem. i want to match extension that end with a number, but can not find a way. i also found that _.X match all extension, but won't match any caller-id number in dialplan. maybe it is a bug. but it seems not important since _.X is useless anyway. 2007/9/15, Tilghman Lesher [EMAIL PROTECTED]: On Friday 14 September 2007 11:39:40 Anthony Messina wrote: I am working on getting freenum.org ISN/ITAD numbers integrated into my exiting dialplan however I am having trouble getting the extension matches to work as expected. I would like to be able to do something like: exten = _X.*.,1,Macro(isn-outbound...) The problem you're seeing is that the period is a short-circuit operator. It says if you match everything so far and at least one more character, then you have a match, no need to go any further. You CANNOT match past a '.'. -- Tilghman ___ Sign up now for AstriCon 2007! September 25-28th. http://www.astricon.net/ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ Sign up now for AstriCon 2007! September 25-28th. http://www.astricon.net/ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Can Asterisk match a literal * in extensions.conf
On Friday 14 September 2007 12:37:11 pm Tilghman Lesher wrote: On Friday 14 September 2007 11:39:40 Anthony Messina wrote: I am working on getting freenum.org ISN/ITAD numbers integrated into my exiting dialplan however I am having trouble getting the extension matches to work as expected. I would like to be able to do something like: exten = _X.*.,1,Macro(isn-outbound...) The problem you're seeing is that the period is a short-circuit operator. It says if you match everything so far and at least one more character, then you have a match, no need to go any further. You CANNOT match past a '.'. Thank you all. I knew I wasn't nuts, but this is the infomation being posted at http://freenum.org/cookbook/ I'll just have to add a prefix. I was hoping to avoid that. -- Anthony - http://messinet.com - http://messinet.com/~amessina/gallery 8F89 5E72 8DF0 BCF0 10BE 9967 92DC 35DC B001 4A4E signature.asc Description: This is a digitally signed message part. ___ Sign up now for AstriCon 2007! September 25-28th. http://www.astricon.net/ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Can Asterisk match a literal * in extensions.conf
Anthony Messina wrote: I am working on getting freenum.org ISN/ITAD numbers integrated into my exiting dialplan however I am having trouble getting the extension matches to work as expected. I would like to be able to do something like: exten = _X.*.,1,Macro(isn-outbound...) Where I would expect that any extension that starts with at least one number, but includes a literal * followed by 1 or more numbers would match. This is not the case, and it matches any extension that starts with a number. Thank you in advance for your assistance. . must ONLY be the LAST character in a pattern match. ___ Sign up now for AstriCon 2007! September 25-28th. http://www.astricon.net/ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Can Asterisk match a literal * in extensions.conf
On 9/14/07, Jared Smith [EMAIL PROTECTED] wrote: On Fri, 2007-09-14 at 10:51 -0600, Anthony Francis wrote: . matches any number of the preceding character, change it to _X.*X. That still won't help. Once the Asterisk pattern matching parser sees a period in the pattern, it ignores anything after it. (I'm not exactly happy about that, but that's the way it is.) In short, Asterisk doesn't currently have a good way of handling this situation. Hopefully somebody infinitely smarter than I am will take pity on our plight and give us a some more advanced pattern-matching tools. (Hint, hint) Well, you can have some 10 or so patterns (how long can the number before be), with X, as X means one digit.. For example: exten = _X*.,1,Goto(default-wildcard|${EXTEN}|1) exten = _XX*.,1,Goto(default-wildcard|${EXTEN}|1) exten = _XXX*.,1,Goto(default-wildcard|${EXTEN}|1) exten = _*.,1,Goto(default-wildcard|${EXTEN}|1) exten = _X*.,1,Goto(default-wildcard|${EXTEN}|1) exten = _XX*.,1,Goto(default-wildcard|${EXTEN}|1) exten = _XXX*.,1,Goto(default-wildcard|${EXTEN}|1) exten = _*.,1,Goto(default-wildcard|${EXTEN}|1) exten = _X*.,1,Goto(default-wildcard|${EXTEN}|1) exten = _XX*.,1,Goto(default-wildcard|${EXTEN}|1) [default-wildcard] exten = _X.,1,Macro(whatever) Regards, Atis -- Atis Lezdins, IT Responsible of BEST Riga, [EMAIL PROTECTED] ICQ: 142239285 Skype: atis.lezdins Cell Phone: +371 28806004 [Tele2, Latvia] Work phone: +1 800 7502835 [Toll free, USA] ?BEST? - www.BEST.eu.org ___ Sign up now for AstriCon 2007! September 25-28th. http://www.astricon.net/ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Can Asterisk match a literal * in extensions.conf
Jared Smith wrote: On Fri, 2007-09-14 at 10:51 -0600, Anthony Francis wrote: . matches any number of the preceding character, change it to _X.*X. That still won't help. Once the Asterisk pattern matching parser sees a period in the pattern, it ignores anything after it. (I'm not exactly happy about that, but that's the way it is.) In short, Asterisk doesn't currently have a good way of handling this situation. Hopefully somebody infinitely smarter than I am will take pity on our plight and give us a some more advanced pattern-matching tools. (Hint, hint) Asterisk's pattern matching is NOT a regex. . means match 1 or more character. It has nothing to do with the preceding characters and must ALWAYS be the last character in a pattern match. ___ Sign up now for AstriCon 2007! September 25-28th. http://www.astricon.net/ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Can Asterisk match a literal * in extensions.conf
On Friday 14 September 2007 15:35:47 Anthony Messina wrote: On Friday 14 September 2007 12:37:11 pm Tilghman Lesher wrote: On Friday 14 September 2007 11:39:40 Anthony Messina wrote: I am working on getting freenum.org ISN/ITAD numbers integrated into my exiting dialplan however I am having trouble getting the extension matches to work as expected. I would like to be able to do something like: exten = _X.*.,1,Macro(isn-outbound...) The problem you're seeing is that the period is a short-circuit operator. It says if you match everything so far and at least one more character, then you have a match, no need to go any further. You CANNOT match past a '.'. Thank you all. I knew I wasn't nuts, but this is the infomation being posted at http://freenum.org/cookbook/ I'll just have to add a prefix. I was hoping to avoid that. exten = _X.,1,Set(firstpart=${CUT(EXTEN,*,1)}) exten = _X.,n,Set(secondpart=${CUT(EXTEN,*,2)}) exten = _X.,n,GotoIf($[${LEN(${secondpart})}=0]?i,1) exten = _X.,n,Macro(foo,${firstpart},${secondpart}) -- Tilghman ___ Sign up now for AstriCon 2007! September 25-28th. http://www.astricon.net/ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Can Asterisk match a literal * in extensions.conf
On Sat, 2007-09-15 at 00:12 +0300, Atis wrote: On 9/14/07, Jared Smith [EMAIL PROTECTED] wrote: On Fri, 2007-09-14 at 10:51 -0600, Anthony Francis wrote: . matches any number of the preceding character, change it to _X.*X. That still won't help. Once the Asterisk pattern matching parser sees a period in the pattern, it ignores anything after it. (I'm not exactly happy about that, but that's the way it is.) In short, Asterisk doesn't currently have a good way of handling this situation. Hopefully somebody infinitely smarter than I am will take pity on our plight and give us a some more advanced pattern-matching tools. (Hint, hint) Well, you can have some 10 or so patterns (how long can the number before be), with X, as X means one digit.. For example: exten = _X*.,1,Goto(default-wildcard|${EXTEN}|1) exten = _XX*.,1,Goto(default-wildcard|${EXTEN}|1) exten = _XXX*.,1,Goto(default-wildcard|${EXTEN}|1) exten = _*.,1,Goto(default-wildcard|${EXTEN}|1) exten = _X*.,1,Goto(default-wildcard|${EXTEN}|1) exten = _XX*.,1,Goto(default-wildcard|${EXTEN}|1) exten = _XXX*.,1,Goto(default-wildcard|${EXTEN}|1) exten = _*.,1,Goto(default-wildcard|${EXTEN}|1) exten = _X*.,1,Goto(default-wildcard|${EXTEN}|1) exten = _XX*.,1,Goto(default-wildcard|${EXTEN}|1) Atis-- People are spoiled by regex's, and they want to able to make a match vs. something I call trailing context. What they don't realize is that such matches take (possibly) large amounts of time to complete, because they loop or are recursive, depending on the implementation. Thus, a regex like X+\* (which would mean 1 or more X's followed by an asterisk. would expand out to the 10 (actually perhaps many more) lines above-- and run (unexpectedly) slower. The trouble is, the pattern matcher wouldn't know how long an expression like X+\* should be, and could generate hundreds of entries. (if the pattern length is limited to 256 chars, say). It is far better to explode out the entries yourself, as you outlined above. You know the max size of incoming stream murf [default-wildcard] exten = _X.,1,Macro(whatever) Regards, Atis -- Steve Murphy Software Developer Digium smime.p7s Description: S/MIME cryptographic signature ___ Sign up now for AstriCon 2007! September 25-28th. http://www.astricon.net/ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Can Asterisk match a literal * in extensions.conf
Jared Smith wrote: On Fri, 2007-09-14 at 10:51 -0600, Anthony Francis wrote: . matches any number of the preceding character, change it to _X.*X. That still won't help. Once the Asterisk pattern matching parser sees a period in the pattern, it ignores anything after it. (I'm not exactly happy about that, but that's the way it is.) In short, Asterisk doesn't currently have a good way of handling this situation. Hopefully somebody infinitely smarter than I am will take pity on our plight and give us a some more advanced pattern-matching tools. (Hint, hint) Like PCRE maybe hmm. ___ Sign up now for AstriCon 2007! September 25-28th. http://www.astricon.net/ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Can Asterisk match a literal * in extensions.conf
On Friday 14 September 2007 04:12:48 pm Atis wrote: exten = _XXX*.,1,Goto(default-wildcard|${EXTEN}|1) exten = _*.,1,Goto(default-wildcard|${EXTEN}|1) exten = _X*.,1,Goto(default-wildcard|${EXTEN}|1) excellent sir! thank you! actually, since i'm using this for testing ISN/ITAD, which currently only has ITAD domains with 3 digits i used: exten = _XXX*XXX,1,Macro(isn,${EXTEN}) exten = _*XXX,1,Macro(isn,${EXTEN}) exten = _X*XXX,1,Macro(isn,${EXTEN}) (i use the macro to set callerid, etc) would _XXX*XXX be slower to match than _XXX*. since the . ignores everything after it as posted by another user? again, thanks. -a -- Anthony - http://messinet.com - http://messinet.com/~amessina/gallery 8F89 5E72 8DF0 BCF0 10BE 9967 92DC 35DC B001 4A4E signature.asc Description: This is a digitally signed message part. ___ Sign up now for AstriCon 2007! September 25-28th. http://www.astricon.net/ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users