Re: [asterisk-users] dialplan number matching
hello, why not use execif or gotoif? this would look like this: exten = _X.,n,ExecIf($[${EXTEN:${LEN(${EXTEN})-1}}=3]|do would ever you want to do best regards steve Vieri schrieb: Hi, How can I match an extension ending with 3 (just an example but applicable to any other digit, including * or #)? exten = _ZX.3,n,... exten = _ZX.#,n,... (the above does not work) Can regular expressions be used in the standard dialplan (end with: $)? Thanks, Vieri ___ -- 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 -- Für weitere Fragen stehen wir gerne unter v...@sil.at oder 059944 - 2440 zur Verfügung. Mit freundlichen Grüssen -- Stefan Schmidt Sysadmin/VOIP // v...@sil.at // Tel 059944-2440// - SILVER SERVER GmbH // Lorenz-Mandl-Gasse 33/1 // A-1160 Wien // Fax 059944-9000 // www.sil.at // - ___ -- 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
[asterisk-users] dialplan number matching
Hi, How can I match an extension ending with 3 (just an example but applicable to any other digit, including * or #)? exten = _ZX.3,n,... exten = _ZX.#,n,... (the above does not work) Can regular expressions be used in the standard dialplan (end with: $)? Thanks, Vieri ___ -- 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] dialplan number matching
Assuming you are using 4 digit extensions, this syntax would be: - exten = _ZXX3,n,... For 3 digits - exten = _ZX3,n,... The . is a wildcard that says take rest of number, so anything after that is irrelevant. -Original Message- From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Vieri Sent: Friday, July 17, 2009 4:11 AM To: asterisk-users@lists.digium.com Subject: [asterisk-users] dialplan number matching Hi, How can I match an extension ending with 3 (just an example but applicable to any other digit, including * or #)? exten = _ZX.3,n,... exten = _ZX.#,n,... (the above does not work) Can regular expressions be used in the standard dialplan (end with: $)? Thanks, Vieri ___ -- 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 ___ -- 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] dialplan number matching
On Fri, 2009-07-17 at 02:11 -0700, Vieri wrote: Hi, How can I match an extension ending with 3 (just an example but applicable to any other digit, including * or #)? exten = _ZX.3,n,... exten = _ZX.#,n,... (the above does not work) Can regular expressions be used in the standard dialplan (end with: $)? Thanks, Vieri snip I haven't tried it but I wonder if one could use a regex pattern match in a GotoIf statement and then pass the result to another context using ${EXTEN}? Just a thought - John -- John A. Sullivan III Open Source Development Corporation +1 207-985-7880 jsulli...@opensourcedevel.com http://www.spiritualoutreach.com Making Christianity intelligible to secular society ___ -- 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] dialplan number matching
--- On Fri, 7/17/09, Danny Nicholas da...@debsinc.com wrote: Assuming you are using 4 digit extensions, this syntax would be: - exten = _ZXX3,n,... For 3 digits - exten = _ZX3,n,... The . is a wildcard that says take rest of number, so anything after that is irrelevant. Thanks but the extensions have a variable length (cannot determine in advance) so I can't use that logic. It's for matching international calls (variable length and I can't keep a database with all possible patterns worldwide) in case of early-dial/address incomplete SIP clients (I recently exposed this issue on this mailing list). Anyway, thanks for the feedback. Vieri -Original Message- From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Vieri Sent: Friday, July 17, 2009 4:11 AM To: asterisk-users@lists.digium.com Subject: [asterisk-users] dialplan number matching Hi, How can I match an extension ending with 3 (just an example but applicable to any other digit, including * or #)? exten = _ZX.3,n,... exten = _ZX.#,n,... (the above does not work) Can regular expressions be used in the standard dialplan (end with: $)? Thanks, Vieri ___ -- 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] dialplan number matching
One more thought; you could run the number through an AGI and return the values of the ones ending in 3 in a variable using regular expressions. I do this to take the * out of digit strings. -Original Message- From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Vieri Sent: Friday, July 17, 2009 2:43 PM To: asterisk-users@lists.digium.com Subject: Re: [asterisk-users] dialplan number matching --- On Fri, 7/17/09, Danny Nicholas da...@debsinc.com wrote: Assuming you are using 4 digit extensions, this syntax would be: - exten = _ZXX3,n,... For 3 digits - exten = _ZX3,n,... The . is a wildcard that says take rest of number, so anything after that is irrelevant. Thanks but the extensions have a variable length (cannot determine in advance) so I can't use that logic. It's for matching international calls (variable length and I can't keep a database with all possible patterns worldwide) in case of early-dial/address incomplete SIP clients (I recently exposed this issue on this mailing list). Anyway, thanks for the feedback. Vieri -Original Message- From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Vieri Sent: Friday, July 17, 2009 4:11 AM To: asterisk-users@lists.digium.com Subject: [asterisk-users] dialplan number matching Hi, How can I match an extension ending with 3 (just an example but applicable to any other digit, including * or #)? exten = _ZX.3,n,... exten = _ZX.#,n,... (the above does not work) Can regular expressions be used in the standard dialplan (end with: $)? Thanks, Vieri ___ -- 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 ___ -- 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] dialplan number matching
--- On Fri, 7/17/09, John A. Sullivan III jsulli...@opensourcedevel.com wrote: Hi, How can I match an extension ending with 3 (just an example but applicable to any other digit, including * or #)? exten = _ZX.3,n,... exten = _ZX.#,n,... (the above does not work) Can regular expressions be used in the standard dialplan (end with: $)? Thanks, Vieri snip I haven't tried it but I wonder if one could use a regex pattern match in a GotoIf statement and then pass the result to another context using ${EXTEN}? Just a thought - John Thanks, I'll think about it but I don't think it will apply efficiently to the goal I describe here: http://www.mail-archive.com/asterisk-users@lists.digium.com/msg227054.html Anyway, I solved my early-dial issue by creating a special context where I Read() the user's input until he/she presses #. It's not as elegant as having Asterisk match regular expressions or do something like exten = _00ZX.#,n,... but I'll settle with it. Vieri ___ -- 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] dialplan number matching
On Fri, 2009-07-17 at 12:56 -0700, Vieri wrote: --- On Fri, 7/17/09, John A. Sullivan III jsulli...@opensourcedevel.com wrote: Hi, How can I match an extension ending with 3 (just an example but applicable to any other digit, including * or #)? exten = _ZX.3,n,... exten = _ZX.#,n,... (the above does not work) Can regular expressions be used in the standard dialplan (end with: $)? Thanks, Vieri snip I haven't tried it but I wonder if one could use a regex pattern match in a GotoIf statement and then pass the result to another context using ${EXTEN}? Just a thought - John Thanks, I'll think about it but I don't think it will apply efficiently to the goal I describe here: http://www.mail-archive.com/asterisk-users@lists.digium.com/msg227054.html Anyway, I solved my early-dial issue by creating a special context where I Read() the user's input until he/she presses #. It's not as elegant as having Asterisk match regular expressions or do something like exten = _00ZX.#,n,... but I'll settle with it. snip I am very new to Asterisk so you probably know far more than I and I have never used the regex logic but what about something like: exten = _00ZX.,n,GotoIf($[${EXTEN}:.*3$]?:no3) exten = _00ZX.,n,DO SOMETHING exten = _00ZX.,n(no3),NoOp() -- John A. Sullivan III Open Source Development Corporation +1 207-985-7880 jsulli...@opensourcedevel.com http://www.spiritualoutreach.com Making Christianity intelligible to secular society ___ -- 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