Hello, I have the following dial plan: <extension name="international destination_number" continue="true"> <condition field="destination_number" expression="^00(\d+)$"> <action application="log" data="CONSOLE *** international number ${destination_number} ***"/> <action application="set_profile_var" data="destination_number=$1"/> </condition> </extension> <extension name="national destination_number" continue="true"> <condition field="destination_number" expression="^0(\d+)$"> <action application="log" data="CONSOLE *** international number ${destination_number}"/> <action application="set_profile_var" data="destination_number=49$1"/> </condition> </extension> If I dial number 001234567, I get the following output in the console: 2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 001234567 *** 2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 1234567 The second extension is matching, however in the first extension the destination_number has been overridden and does not have any leading zeros. Why is it matching anyway? Thanks Markus
take a look at the full debug log? On Mar 11, 2014, at 2:49 PM, mbo <mbodbg@gmx.net> wrote:
Hello,
I have the following dial plan:
<extension name="international destination_number" continue="true"> <condition field="destination_number" expression="^00(\d+)$"> <action application="log" data="CONSOLE *** international number ${destination_number} ***"/> <action application="set_profile_var" data="destination_number=$1"/> </condition> </extension>
<extension name="national destination_number" continue="true"> <condition field="destination_number" expression="^0(\d+)$"> <action application="log" data="CONSOLE *** international number ${destination_number}"/> <action application="set_profile_var" data="destination_number=49$1"/> </condition> </extension>
If I dial number 001234567, I get the following output in the console:
2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 001234567 *** 2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 1234567
The second extension is matching, however in the first extension the destination_number has been overridden and does not have any leading zeros. Why is it matching anyway?
Thanks
Markus
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
http://pastebin.freeswitch.org/22117 Am 11.03.2014 um 20:16 schrieb Michael Jerris <mike@jerris.com>:
take a look at the full debug log?
On Mar 11, 2014, at 2:49 PM, mbo <mbodbg@gmx.net> wrote:
Hello,
I have the following dial plan:
<extension name="international destination_number" continue="true"> <condition field="destination_number" expression="^00(\d+)$"> <action application="log" data="CONSOLE *** international number ${destination_number} ***"/> <action application="set_profile_var" data="destination_number=$1"/> </condition> </extension>
<extension name="national destination_number" continue="true"> <condition field="destination_number" expression="^0(\d+)$"> <action application="log" data="CONSOLE *** international number ${destination_number}"/> <action application="set_profile_var" data="destination_number=49$1"/> </condition> </extension>
If I dial number 001234567, I get the following output in the console:
2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 001234567 *** 2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 1234567
The second extension is matching, however in the first extension the destination_number has been overridden and does not have any leading zeros. Why is it matching anyway?
Thanks
Markus
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Both are matching. You might want this for your second match, so that there's only 1x leading zero: ^0([^0]\d+)$ -Avi On Tue, Mar 11, 2014 at 8:49 PM, mbo <mbodbg@gmx.net> wrote:
Hello,
I have the following dial plan:
<extension name="international destination_number" continue="true"> <condition field="destination_number" expression="^00(\d+)$"> <action application="log" data="CONSOLE *** international number ${destination_number} ***"/> <action application="set_profile_var" data="destination_number=$1"/> </condition> </extension>
<extension name="national destination_number" continue="true"> <condition field="destination_number" expression="^0(\d+)$"> <action application="log" data="CONSOLE *** international number ${destination_number}"/> <action application="set_profile_var" data="destination_number=49$1"/> </condition> </extension>
If I dial number 001234567, I get the following output in the console:
2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 001234567 *** 2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 1234567
The second extension is matching, however in the first extension the destination_number has been overridden and does not have any leading zeros. Why is it matching anyway?
Thanks
Markus
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
I am not sure I can answer, but I can clarify for others who know. Are you expecting the "set_profile_var" in the first extension to override the value being parsed as field="destination_number" in the second extension? Oddly enough, it appears the "FIELD"- "destination_number" did not change, but variable $destination_number did. Sean From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Avi Marcus Sent: Tuesday, March 11, 2014 3:49 PM To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] Matching destination number Both are matching. You might want this for your second match, so that there's only 1x leading zero: ^0([^0]\d+)$ -Avi On Tue, Mar 11, 2014 at 8:49 PM, mbo <mbodbg@gmx.net<mailto:mbodbg@gmx.net>> wrote: Hello, I have the following dial plan: <extension name="international destination_number" continue="true"> <condition field="destination_number" expression="^00(\d+)$"> <action application="log" data="CONSOLE *** international number ${destination_number} ***"/> <action application="set_profile_var" data="destination_number=$1"/> </condition> </extension> <extension name="national destination_number" continue="true"> <condition field="destination_number" expression="^0(\d+)$"> <action application="log" data="CONSOLE *** international number ${destination_number}"/> <action application="set_profile_var" data="destination_number=49$1"/> </condition> </extension> If I dial number 001234567, I get the following output in the console: 2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 001234567 *** 2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 1234567 The second extension is matching, however in the first extension the destination_number has been overridden and does not have any leading zeros. Why is it matching anyway? Thanks Markus _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
That works, Thanks! Markus Am 11.03.2014 um 20:49 schrieb Avi Marcus <avi@avimarcus.net>:
Both are matching. You might want this for your second match, so that there's only 1x leading zero:
^0([^0]\d+)$
-Avi
On Tue, Mar 11, 2014 at 8:49 PM, mbo <mbodbg@gmx.net> wrote: Hello,
I have the following dial plan:
<extension name="international destination_number" continue="true"> <condition field="destination_number" expression="^00(\d+)$"> <action application="log" data="CONSOLE *** international number ${destination_number} ***"/> <action application="set_profile_var" data="destination_number=$1"/> </condition> </extension>
<extension name="national destination_number" continue="true"> <condition field="destination_number" expression="^0(\d+)$"> <action application="log" data="CONSOLE *** international number ${destination_number}"/> <action application="set_profile_var" data="destination_number=49$1"/> </condition> </extension>
If I dial number 001234567, I get the following output in the console:
2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 001234567 *** 2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 1234567
The second extension is matching, however in the first extension the destination_number has been overridden and does not have any leading zeros. Why is it matching anyway?
Thanks
Markus
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Hi, Please explain what the [^0] does in that regex - ^0([^0]\d+)$ Sean From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of mbo Sent: Tuesday, March 11, 2014 4:12 PM To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] Matching destination number That works, Thanks! Markus Am 11.03.2014 um 20:49 schrieb Avi Marcus <avi@avimarcus.net<mailto:avi@avimarcus.net>>: Both are matching. You might want this for your second match, so that there's only 1x leading zero: ^0([^0]\d+)$ -Avi On Tue, Mar 11, 2014 at 8:49 PM, mbo <mbodbg@gmx.net<mailto:mbodbg@gmx.net>> wrote: Hello, I have the following dial plan: <extension name="international destination_number" continue="true"> <condition field="destination_number" expression="^00(\d+)$"> <action application="log" data="CONSOLE *** international number ${destination_number} ***"/> <action application="set_profile_var" data="destination_number=$1"/> </condition> </extension> <extension name="national destination_number" continue="true"> <condition field="destination_number" expression="^0(\d+)$"> <action application="log" data="CONSOLE *** international number ${destination_number}"/> <action application="set_profile_var" data="destination_number=49$1"/> </condition> </extension> If I dial number 001234567, I get the following output in the console: 2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 001234567 *** 2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 1234567 The second extension is matching, however in the first extension the destination_number has been overridden and does not have any leading zeros. Why is it matching anyway? Thanks Markus _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com<http://www.freeswitchsolutions.com/> FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com<http://www.cudatel.com/> Official FreeSWITCH Sites http://www.freeswitch.org<http://www.freeswitch.org/> http://wiki.freeswitch.org<http://wiki.freeswitch.org/> http://www.cluecon.com<http://www.cluecon.com/> FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org<http://www.freeswitch.org/> _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Only matcha 0 followed by a non zero. That way only one of the ref ex matches. -Avi On Mar 11, 2014 11:21 PM, "Sean Devoy" <sdevoy@bizfocused.com> wrote:
Hi,
Please explain what the [^0] does in that regex - ^0([^0]\d+)$
Sean
*From:* freeswitch-users-bounces@lists.freeswitch.org [mailto: freeswitch-users-bounces@lists.freeswitch.org] *On Behalf Of *mbo *Sent:* Tuesday, March 11, 2014 4:12 PM *To:* FreeSWITCH Users Help *Subject:* Re: [Freeswitch-users] Matching destination number
That works,
Thanks!
Markus
Am 11.03.2014 um 20:49 schrieb Avi Marcus <avi@avimarcus.net>:
Both are matching.
You might want this for your second match, so that there's only 1x leading zero:
^0([^0]\d+)$
-Avi
On Tue, Mar 11, 2014 at 8:49 PM, mbo <mbodbg@gmx.net> wrote:
Hello,
I have the following dial plan:
<extension name="international destination_number" continue="true">
<condition field="destination_number" expression="^00(\d+)$">
<action application="log" data="CONSOLE *** international number ${destination_number} ***"/>
<action application="set_profile_var" data="destination_number=$1"/>
</condition>
</extension>
<extension name="national destination_number" continue="true">
<condition field="destination_number" expression="^0(\d+)$">
<action application="log" data="CONSOLE *** international number ${destination_number}"/>
<action application="set_profile_var" data="destination_number=49$1"/>
</condition>
</extension>
If I dial number 001234567, I get the following output in the console:
2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 001234567 ***
2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 1234567
The second extension is matching, however in the first extension the destination_number has been overridden and does not have any leading zeros. Why is it matching anyway?
Thanks
Markus
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Whoa!!! Thanks Avi - the light came on. The first ^0 means "starts with a ZERO", but the second ^0 means "anything BUT a zero"!!!! There are always multiple ways to "regex" something, I probably would have gone with ^0([1-9]\d+)$. Learned something. Thanks, Sean From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Avi Marcus Sent: Tuesday, March 11, 2014 6:18 PM To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] Matching destination number Only matcha 0 followed by a non zero. That way only one of the ref ex matches. -Avi On Mar 11, 2014 11:21 PM, "Sean Devoy" <sdevoy@bizfocused.com<mailto:sdevoy@bizfocused.com>> wrote: Hi, Please explain what the [^0] does in that regex - ^0([^0]\d+)$ Sean From: freeswitch-users-bounces@lists.freeswitch.org<mailto:freeswitch-users-bounces@lists.freeswitch.org> [mailto:freeswitch-users-bounces@lists.freeswitch.org<mailto:freeswitch-users-bounces@lists.freeswitch.org>] On Behalf Of mbo Sent: Tuesday, March 11, 2014 4:12 PM To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] Matching destination number That works, Thanks! Markus Am 11.03.2014 um 20:49 schrieb Avi Marcus <avi@avimarcus.net<mailto:avi@avimarcus.net>>: Both are matching. You might want this for your second match, so that there's only 1x leading zero: ^0([^0]\d+)$ -Avi On Tue, Mar 11, 2014 at 8:49 PM, mbo <mbodbg@gmx.net<mailto:mbodbg@gmx.net>> wrote: Hello, I have the following dial plan: <extension name="international destination_number" continue="true"> <condition field="destination_number" expression="^00(\d+)$"> <action application="log" data="CONSOLE *** international number ${destination_number} ***"/> <action application="set_profile_var" data="destination_number=$1"/> </condition> </extension> <extension name="national destination_number" continue="true"> <condition field="destination_number" expression="^0(\d+)$"> <action application="log" data="CONSOLE *** international number ${destination_number}"/> <action application="set_profile_var" data="destination_number=49$1"/> </condition> </extension> If I dial number 001234567, I get the following output in the console: 2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 001234567 *** 2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 1234567 The second extension is matching, however in the first extension the destination_number has been overridden and does not have any leading zeros. Why is it matching anyway? Thanks Markus _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com<http://www.freeswitchsolutions.com/> FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com<http://www.cudatel.com/> Official FreeSWITCH Sites http://www.freeswitch.org<http://www.freeswitch.org/> http://wiki.freeswitch.org<http://wiki.freeswitch.org/> http://www.cluecon.com<http://www.cluecon.com/> FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org<http://www.freeswitch.org/> _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Actually, Sean, that's probably a good idea, since ^0 would match alpha characters, too... -Avi On Mar 12, 2014 2:16 AM, "Sean Devoy" <sdevoy@bizfocused.com> wrote:
Whoa!!! Thanks Avi - the light came on.
The first ^0 means "starts with a ZERO", but the second ^0 means "anything BUT a zero"!!!! There are always multiple ways to "regex" something, I probably would have gone with ^0([1-9]\d+)$.
Learned something.
Thanks,
Sean
*From:* freeswitch-users-bounces@lists.freeswitch.org [mailto: freeswitch-users-bounces@lists.freeswitch.org] *On Behalf Of *Avi Marcus *Sent:* Tuesday, March 11, 2014 6:18 PM *To:* FreeSWITCH Users Help *Subject:* Re: [Freeswitch-users] Matching destination number
Only matcha 0 followed by a non zero. That way only one of the ref ex matches.
-Avi
On Mar 11, 2014 11:21 PM, "Sean Devoy" <sdevoy@bizfocused.com> wrote:
Hi,
Please explain what the [^0] does in that regex - ^0([^0]\d+)$
Sean
*From:* freeswitch-users-bounces@lists.freeswitch.org [mailto: freeswitch-users-bounces@lists.freeswitch.org] *On Behalf Of *mbo *Sent:* Tuesday, March 11, 2014 4:12 PM *To:* FreeSWITCH Users Help *Subject:* Re: [Freeswitch-users] Matching destination number
That works,
Thanks!
Markus
Am 11.03.2014 um 20:49 schrieb Avi Marcus <avi@avimarcus.net>:
Both are matching.
You might want this for your second match, so that there's only 1x leading zero:
^0([^0]\d+)$
-Avi
On Tue, Mar 11, 2014 at 8:49 PM, mbo <mbodbg@gmx.net> wrote:
Hello,
I have the following dial plan:
<extension name="international destination_number" continue="true">
<condition field="destination_number" expression="^00(\d+)$">
<action application="log" data="CONSOLE *** international number ${destination_number} ***"/>
<action application="set_profile_var" data="destination_number=$1"/>
</condition>
</extension>
<extension name="national destination_number" continue="true">
<condition field="destination_number" expression="^0(\d+)$">
<action application="log" data="CONSOLE *** international number ${destination_number}"/>
<action application="set_profile_var" data="destination_number=49$1"/>
</condition>
</extension>
If I dial number 001234567, I get the following output in the console:
2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 001234567 ***
2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 1234567
The second extension is matching, however in the first extension the destination_number has been overridden and does not have any leading zeros. Why is it matching anyway?
Thanks
Markus
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
The matching works now with the changed regex, but I still see an issue here. However Action set_profile_var(destination_number=1234567) is executed, the next match "Regex (PASS) [national destinationnumber] destination_number(001234567)“ is done on the original number 001234567, not on 1234567. On the other hand, the log shows the changed number 1234567. It looks like the variable is not set when the condition is tested, but it is done when the log output is performed. Dialplan: sofia/internal/1002@192.168.1.135 parsing [default->international destination_number] continue=true Dialplan: sofia/internal/1002@192.168.1.135 Regex (PASS) [international destination_number] destination_number(001234567) =~ /^00(\d+)$/ break=on-false Dialplan: sofia/internal/1002@192.168.1.135 Action log(CONSOLE *** international number ${destination_number} ***) Dialplan: sofia/internal/1002@192.168.1.135 Action set_profile_var(destination_number=1234567) Dialplan: sofia/internal/1002@192.168.1.135 parsing [default->national destinationnumber] continue=true Dialplan: sofia/internal/1002@192.168.1.135 Regex (PASS) [national destinationnumber] destination_number(001234567) =~ /^0(\d+)$/ break=on-false Dialplan: sofia/internal/1002@192.168.1.135 Action log(CONSOLE *** national number ${destination_number}) Dialplan: sofia/internal/1002@192.168.1.135 Action set_profile_var(destination_number=4901234567) ... EXECUTE sofia/internal/1002@192.168.1.135 log(CONSOLE *** national number 1234567) Thanks Markus Am 12.03.2014 um 07:18 schrieb Avi Marcus <avi@avimarcus.net>:
Actually, Sean, that's probably a good idea, since ^0 would match alpha characters, too...
-Avi
On Mar 12, 2014 2:16 AM, "Sean Devoy" <sdevoy@bizfocused.com> wrote: Whoa!!! Thanks Avi – the light came on.
The first ^0 means “starts with a ZERO”, but the second ^0 means “anything BUT a zero”!!!! There are always multiple ways to “regex” something, I probably would have gone with ^0([1-9]\d+)$.
Learned something.
Thanks,
Sean
From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Avi Marcus Sent: Tuesday, March 11, 2014 6:18 PM To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] Matching destination number
Only matcha 0 followed by a non zero. That way only one of the ref ex matches.
-Avi
On Mar 11, 2014 11:21 PM, "Sean Devoy" <sdevoy@bizfocused.com> wrote:
Hi,
Please explain what the [^0] does in that regex - ^0([^0]\d+)$
Sean
From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of mbo Sent: Tuesday, March 11, 2014 4:12 PM To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] Matching destination number
That works,
Thanks!
Markus
Am 11.03.2014 um 20:49 schrieb Avi Marcus <avi@avimarcus.net>:
Both are matching.
You might want this for your second match, so that there's only 1x leading zero:
^0([^0]\d+)$
-Avi
On Tue, Mar 11, 2014 at 8:49 PM, mbo <mbodbg@gmx.net> wrote:
Hello,
I have the following dial plan:
<extension name="international destination_number" continue="true">
<condition field="destination_number" expression="^00(\d+)$">
<action application="log" data="CONSOLE *** international number ${destination_number} ***"/>
<action application="set_profile_var" data="destination_number=$1"/>
</condition>
</extension>
<extension name="national destination_number" continue="true">
<condition field="destination_number" expression="^0(\d+)$">
<action application="log" data="CONSOLE *** international number ${destination_number}"/>
<action application="set_profile_var" data="destination_number=49$1"/>
</condition>
</extension>
If I dial number 001234567, I get the following output in the console:
2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 001234567 ***
2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 1234567
The second extension is matching, however in the first extension the destination_number has been overridden and does not have any leading zeros. Why is it matching anyway?
Thanks
Markus
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Dialplan conditions are evaluated resulting in a list of actions to perform, then we perform all those actions. On Mar 12, 2014, at 6:36 AM, mbo <mbodbg@gmx.net> wrote:
The matching works now with the changed regex, but I still see an issue here. However Action set_profile_var(destination_number=1234567) is executed, the next match "Regex (PASS) [national destinationnumber] destination_number(001234567)“ is done on the original number 001234567, not on 1234567. On the other hand, the log shows the changed number 1234567. It looks like the variable is not set when the condition is tested, but it is done when the log output is performed.
Dialplan: sofia/internal/1002@192.168.1.135 parsing [default->international destination_number] continue=true Dialplan: sofia/internal/1002@192.168.1.135 Regex (PASS) [international destination_number] destination_number(001234567) =~ /^00(\d+)$/ break=on-false Dialplan: sofia/internal/1002@192.168.1.135 Action log(CONSOLE *** international number ${destination_number} ***) Dialplan: sofia/internal/1002@192.168.1.135 Action set_profile_var(destination_number=1234567) Dialplan: sofia/internal/1002@192.168.1.135 parsing [default->national destinationnumber] continue=true Dialplan: sofia/internal/1002@192.168.1.135 Regex (PASS) [national destinationnumber] destination_number(001234567) =~ /^0(\d+)$/ break=on-false Dialplan: sofia/internal/1002@192.168.1.135 Action log(CONSOLE *** national number ${destination_number}) Dialplan: sofia/internal/1002@192.168.1.135 Action set_profile_var(destination_number=4901234567) ... EXECUTE sofia/internal/1002@192.168.1.135 log(CONSOLE *** national number 1234567)
Thanks
Markus
Am 12.03.2014 um 07:18 schrieb Avi Marcus <avi@avimarcus.net>:
Actually, Sean, that's probably a good idea, since ^0 would match alpha characters, too...
-Avi
On Mar 12, 2014 2:16 AM, "Sean Devoy" <sdevoy@bizfocused.com> wrote: Whoa!!! Thanks Avi – the light came on.
The first ^0 means “starts with a ZERO”, but the second ^0 means “anything BUT a zero”!!!! There are always multiple ways to “regex” something, I probably would have gone with ^0([1-9]\d+)$.
Learned something.
Thanks,
Sean
From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Avi Marcus Sent: Tuesday, March 11, 2014 6:18 PM To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] Matching destination number
Only matcha 0 followed by a non zero. That way only one of the ref ex matches.
-Avi
On Mar 11, 2014 11:21 PM, "Sean Devoy" <sdevoy@bizfocused.com> wrote:
Hi,
Please explain what the [^0] does in that regex - ^0([^0]\d+)$
Sean
From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of mbo Sent: Tuesday, March 11, 2014 4:12 PM To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] Matching destination number
That works,
Thanks!
Markus
Am 11.03.2014 um 20:49 schrieb Avi Marcus <avi@avimarcus.net>:
Both are matching.
You might want this for your second match, so that there's only 1x leading zero:
^0([^0]\d+)$
-Avi
On Tue, Mar 11, 2014 at 8:49 PM, mbo <mbodbg@gmx.net> wrote:
Hello,
I have the following dial plan:
<extension name="international destination_number" continue="true">
<condition field="destination_number" expression="^00(\d+)$">
<action application="log" data="CONSOLE *** international number ${destination_number} ***"/>
<action application="set_profile_var" data="destination_number=$1"/>
</condition>
</extension>
<extension name="national destination_number" continue="true">
<condition field="destination_number" expression="^0(\d+)$">
<action application="log" data="CONSOLE *** international number ${destination_number}"/>
<action application="set_profile_var" data="destination_number=49$1"/>
</condition>
</extension>
If I dial number 001234567, I get the following output in the console:
2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 001234567 ***
2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 1234567
The second extension is matching, however in the first extension the destination_number has been overridden and does not have any leading zeros. Why is it matching anyway?
Thanks
Markus
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
I’m not changing the value of the variable which has been evaluated and expect that all actions after this are not executed because the condition does not match anymore. In the scenario we have 2 extension with a condition. In the first match, we change the value of the variable destination_number and log it. The log shows that the variable contains the new value. Then in the second extension we evaluate the variable again. It looks like the initial value of the variable is evaluated again, not the new one - why? Thanks Markus Am 12.03.2014 um 17:41 schrieb Michael Jerris <mike@jerris.com>:
Dialplan conditions are evaluated resulting in a list of actions to perform, then we perform all those actions.
On Mar 12, 2014, at 6:36 AM, mbo <mbodbg@gmx.net> wrote:
The matching works now with the changed regex, but I still see an issue here. However Action set_profile_var(destination_number=1234567) is executed, the next match "Regex (PASS) [national destinationnumber] destination_number(001234567)“ is done on the original number 001234567, not on 1234567. On the other hand, the log shows the changed number 1234567. It looks like the variable is not set when the condition is tested, but it is done when the log output is performed.
Dialplan: sofia/internal/1002@192.168.1.135 parsing [default->international destination_number] continue=true Dialplan: sofia/internal/1002@192.168.1.135 Regex (PASS) [international destination_number] destination_number(001234567) =~ /^00(\d+)$/ break=on-false Dialplan: sofia/internal/1002@192.168.1.135 Action log(CONSOLE *** international number ${destination_number} ***) Dialplan: sofia/internal/1002@192.168.1.135 Action set_profile_var(destination_number=1234567) Dialplan: sofia/internal/1002@192.168.1.135 parsing [default->national destinationnumber] continue=true Dialplan: sofia/internal/1002@192.168.1.135 Regex (PASS) [national destinationnumber] destination_number(001234567) =~ /^0(\d+)$/ break=on-false Dialplan: sofia/internal/1002@192.168.1.135 Action log(CONSOLE *** national number ${destination_number}) Dialplan: sofia/internal/1002@192.168.1.135 Action set_profile_var(destination_number=4901234567) ... EXECUTE sofia/internal/1002@192.168.1.135 log(CONSOLE *** national number 1234567)
Thanks
Markus
Am 12.03.2014 um 07:18 schrieb Avi Marcus <avi@avimarcus.net>:
Actually, Sean, that's probably a good idea, since ^0 would match alpha characters, too...
-Avi
On Mar 12, 2014 2:16 AM, "Sean Devoy" <sdevoy@bizfocused.com> wrote: Whoa!!! Thanks Avi – the light came on.
The first ^0 means “starts with a ZERO”, but the second ^0 means “anything BUT a zero”!!!! There are always multiple ways to “regex” something, I probably would have gone with ^0([1-9]\d+)$.
Learned something.
Thanks,
Sean
From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Avi Marcus Sent: Tuesday, March 11, 2014 6:18 PM To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] Matching destination number
Only matcha 0 followed by a non zero. That way only one of the ref ex matches.
-Avi
On Mar 11, 2014 11:21 PM, "Sean Devoy" <sdevoy@bizfocused.com> wrote:
Hi,
Please explain what the [^0] does in that regex - ^0([^0]\d+)$
Sean
From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of mbo Sent: Tuesday, March 11, 2014 4:12 PM To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] Matching destination number
That works,
Thanks!
Markus
Am 11.03.2014 um 20:49 schrieb Avi Marcus <avi@avimarcus.net>:
Both are matching.
You might want this for your second match, so that there's only 1x leading zero:
^0([^0]\d+)$
-Avi
On Tue, Mar 11, 2014 at 8:49 PM, mbo <mbodbg@gmx.net> wrote:
Hello,
I have the following dial plan:
<extension name="international destination_number" continue="true">
<condition field="destination_number" expression="^00(\d+)$">
<action application="log" data="CONSOLE *** international number ${destination_number} ***"/>
<action application="set_profile_var" data="destination_number=$1"/>
</condition>
</extension>
<extension name="national destination_number" continue="true">
<condition field="destination_number" expression="^0(\d+)$">
<action application="log" data="CONSOLE *** international number ${destination_number}"/>
<action application="set_profile_var" data="destination_number=49$1"/>
</condition>
</extension>
If I dial number 001234567, I get the following output in the console:
2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 001234567 ***
2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 1234567
The second extension is matching, however in the first extension the destination_number has been overridden and does not have any leading zeros. Why is it matching anyway?
Thanks
Markus
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
The dialplan will continue even if there's a match due to this -> "continue=true". So, the next regex will execute the set_var_profile again. /Nandy On Thu, Mar 13, 2014 at 11:41 PM, mbo <mbodbg@gmx.net> wrote:
I’m not changing the value of the variable which has been evaluated and expect that all actions after this are not executed because the condition does not match anymore. In the scenario we have 2 extension with a condition. In the first match, we change the value of the variable destination_number and log it. The log shows that the variable contains the new value. Then in the second extension we evaluate the variable again. It looks like the initial value of the variable is evaluated again, not the new one - why?
Thanks
Markus
Am 12.03.2014 um 17:41 schrieb Michael Jerris <mike@jerris.com>:
Dialplan conditions are evaluated resulting in a list of actions to perform, then we perform all those actions.
On Mar 12, 2014, at 6:36 AM, mbo <mbodbg@gmx.net> wrote:
The matching works now with the changed regex, but I still see an issue here. However Action set_profile_var(destination_number=1234567) is executed, the next match "Regex (PASS) [national destinationnumber] destination_number(001234567)“ is done on the original number 001234567, not on 1234567. On the other hand, the log shows the changed number 1234567. It looks like the variable is not set when the condition is tested, but it is done when the log output is performed.
1. Dialplan: sofia/internal/1002@192.168.1.135 parsing [default->international destination_number] continue=true 2. Dialplan: sofia/internal/1002@192.168.1.135 Regex (PASS) [international destination_number] destination_number(001234567) =~ /^00(\d+)$/ break=on-false 3. Dialplan: sofia/internal/1002@192.168.1.135 Action log(CONSOLE *** international number ${destination_number} ***) 4. Dialplan: sofia/internal/1002@192.168.1.135 Action set_profile_var( destination_number=1234567) 5. Dialplan: sofia/internal/1002@192.168.1.135 parsing [default->national destinationnumber] continue=true 6. Dialplan: sofia/internal/1002@192.168.1.135 Regex (PASS) [national destinationnumber] destination_number(001234567) =~ /^0(\d+)$/ break=on-false 7. Dialplan: sofia/internal/1002@192.168.1.135 Action log(CONSOLE *** national number ${destination_number}) 8. Dialplan: sofia/internal/1002@192.168.1.135 Action set_profile_var( destination_number=4901234567)
...
1. EXECUTE sofia/internal/1002@192.168.1.135 log(CONSOLE *** national number 1234567)
Thanks
Markus
Am 12.03.2014 um 07:18 schrieb Avi Marcus <avi@avimarcus.net>:
Actually, Sean, that's probably a good idea, since ^0 would match alpha characters, too...
-Avi On Mar 12, 2014 2:16 AM, "Sean Devoy" <sdevoy@bizfocused.com> wrote:
Whoa!!! Thanks Avi – the light came on.
The first ^0 means “starts with a ZERO”, but the second ^0 means “anything BUT a zero”!!!! There are always multiple ways to “regex” something, I probably would have gone with ^0([1-9]\d+)$.
Learned something.
Thanks,
Sean
*From:* freeswitch-users-bounces@lists.freeswitch.org [mailto: freeswitch-users-bounces@lists.freeswitch.org] *On Behalf Of *Avi Marcus *Sent:* Tuesday, March 11, 2014 6:18 PM *To:* FreeSWITCH Users Help *Subject:* Re: [Freeswitch-users] Matching destination number
Only matcha 0 followed by a non zero. That way only one of the ref ex matches.
-Avi
On Mar 11, 2014 11:21 PM, "Sean Devoy" <sdevoy@bizfocused.com> wrote:
Hi,
Please explain what the [^0] does in that regex - ^0([^0]\d+)$
Sean
*From:* freeswitch-users-bounces@lists.freeswitch.org [mailto: freeswitch-users-bounces@lists.freeswitch.org] *On Behalf Of *mbo *Sent:* Tuesday, March 11, 2014 4:12 PM *To:* FreeSWITCH Users Help *Subject:* Re: [Freeswitch-users] Matching destination number
That works,
Thanks!
Markus
Am 11.03.2014 um 20:49 schrieb Avi Marcus <avi@avimarcus.net>:
Both are matching.
You might want this for your second match, so that there's only 1x leading zero:
^0([^0]\d+)$
-Avi
On Tue, Mar 11, 2014 at 8:49 PM, mbo <mbodbg@gmx.net> wrote:
Hello,
I have the following dial plan:
<extension name="international destination_number" continue="true">
<condition field="destination_number" expression="^00(\d+)$">
<action application="log" data="CONSOLE *** international number ${destination_number} ***"/>
<action application="set_profile_var" data="destination_number=$1"/>
</condition>
</extension>
<extension name="national destination_number" continue="true">
<condition field="destination_number" expression="^0(\d+)$">
<action application="log" data="CONSOLE *** international number ${destination_number}"/>
<action application="set_profile_var" data="destination_number=49$1"/>
</condition>
</extension>
If I dial number 001234567, I get the following output in the console:
2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 001234567 ***
2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 1234567
The second extension is matching, however in the first extension the destination_number has been overridden and does not have any leading zeros. Why is it matching anyway?
Thanks
Markus
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (5)
-
Avi Marcus
-
mbo
-
Michael Jerris
-
Nandy Dagondon
-
Sean Devoy