Hello everyone, Is there anyway to calculate number in dialplan.xml? like example: <action application="set" data="var=1"/> and with an action , I can do : var=var+1 I have tried mod_expr, but failed to catch the variable, like below: <action application="set" data="var=${expr($var+1)}"/>
<action application="set" data="var=${expr(${var}+1)}"/> On Tuesday 12 January 2010, Chia-Yen Wu wrote:
Hello everyone, Is there anyway to calculate number in dialplan.xml?
like example: <action application="set" data="var=1"/> and with an action , I can do : var=var+1
I have tried mod_expr, but failed to catch the variable, like below: <action application="set" data="var=${expr($var+1)}"/>
Remember you can't do conditions on these vars being set unless you transfer back into the dialplan as these actions are not run immediately, but rather after dialplan parse, unless you use http://wiki.freeswitch.org/wiki/Dialplan_XML#Inline_Actions Mie On Jan 12, 2010, at 12:39 PM, Sergey Okhapkin wrote:
<action application="set" data="var=${expr(${var}+1)}"/>
On Tuesday 12 January 2010, Chia-Yen Wu wrote:
Hello everyone, Is there anyway to calculate number in dialplan.xml?
like example: <action application="set" data="var=1"/> and with an action , I can do : var=var+1
I have tried mod_expr, but failed to catch the variable, like below: <action application="set" data="var=${expr($var+1)}"/>
Thanks for reply, I have tried the new one and did transfer back but it still dont work, when I was posting this question again with my test commands. suddenly I found out what the problem it is. the variable cannot with number in it, like: work: <action application="set" data="var=1"/> <action application="set" data="var=${expr(${var}+1)}"/> fail: <action application="set" data="var1=1"/> <action application="set" data="var1=${expr(${var1}+1)}"/> 2010/1/13 Michael Jerris <mike@jerris.com>
Remember you can't do conditions on these vars being set unless you transfer back into the dialplan as these actions are not run immediately, but rather after dialplan parse, unless you use http://wiki.freeswitch.org/wiki/Dialplan_XML#Inline_Actions
Mie
On Jan 12, 2010, at 12:39 PM, Sergey Okhapkin wrote:
<action application="set" data="var=${expr(${var}+1)}"/>
On Tuesday 12 January 2010, Chia-Yen Wu wrote:
Hello everyone, Is there anyway to calculate number in dialplan.xml?
like example: <action application="set" data="var=1"/> and with an action , I can do : var=var+1
I have tried mod_expr, but failed to catch the variable, like below: <action application="set" data="var=${expr($var+1)}"/>
_______________________________________________ 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
Strange, could you post the debug log of this so we can see how it's expanded? Mike On Jan 12, 2010, at 10:37 PM, Chia-Yen Wu <xanlich@gmail.com> wrote:
Thanks for reply, I have tried the new one and did transfer back but it still dont work, when I was posting this question again with my test commands. suddenly I found out what the problem it is.
the variable cannot with number in it, like:
work: <action application="set" data="var=1"/> <action application="set" data="var=${expr(${var}+1)}"/> fail: <action application="set" data="var1=1"/> <action application="set" data="var1=${expr(${var1}+1)}"/>
2010/1/13 Michael Jerris <mike@jerris.com> Remember you can't do conditions on these vars being set unless you transfer back into the dialplan as these actions are not run immediately, but rather after dialplan parse, unless you use http://wiki.freeswitch.org/wiki/Dialplan_XML#Inline_Actions
Mie
On Jan 12, 2010, at 12:39 PM, Sergey Okhapkin wrote:
<action application="set" data="var=${expr(${var}+1)}"/>
On Tuesday 12 January 2010, Chia-Yen Wu wrote:
Hello everyone, Is there anyway to calculate number in dialplan.xml?
like example: <action application="set" data="var=1"/> and with an action , I can do : var=var+1
I have tried mod_expr, but failed to catch the variable, like below: <action application="set" data="var=${expr($var+1)}"/>
_______________________________________________ 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
_______________________________________________ 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
Sorry, my bad, I finally found out that I got an incorrect condition and the stage goes wrong. Everything is working fine now, thanks for help! 2010/1/13 Michael Jerris <mike@jerris.com>
Strange, could you post the debug log of this so we can see how it's expanded?
Mike
On Jan 12, 2010, at 10:37 PM, Chia-Yen Wu <xanlich@gmail.com> wrote:
Thanks for reply, I have tried the new one and did transfer back but it still dont work, when I was posting this question again with my test commands. suddenly I found out what the problem it is.
the variable cannot with number in it, like:
work: <action application="set" data="var=1"/> <action application="set" data="var=${expr(${var}+1)}"/> fail: <action application="set" data="var1=1"/> <action application="set" data="var1=${expr(${var1}+1)}"/>
2010/1/13 Michael Jerris < <mike@jerris.com>mike@jerris.com>
Remember you can't do conditions on these vars being set unless you transfer back into the dialplan as these actions are not run immediately, but rather after dialplan parse, unless you use <http://wiki.freeswitch.org/wiki/Dialplan_XML#Inline_Actions> http://wiki.freeswitch.org/wiki/Dialplan_XML#Inline_Actions
Mie
On Jan 12, 2010, at 12:39 PM, Sergey Okhapkin wrote:
<action application="set" data="var=${expr(${var}+1)}"/>
On Tuesday 12 January 2010, Chia-Yen Wu wrote:
Hello everyone, Is there anyway to calculate number in dialplan.xml?
like example: <action application="set" data="var=1"/> and with an action , I can do : var=var+1
I have tried mod_expr, but failed to catch the variable, like below: <action application="set" data="var=${expr($var+1)}"/>
_______________________________________________ FreeSWITCH-users mailing list <FreeSWITCH-users@lists.freeswitch.org> FreeSWITCH-users@lists.freeswitch.org <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:<http://lists.freeswitch.org/mailman/options/freeswitch-users> http://lists.freeswitch.org/mailman/options/freeswitch-users <http://www.freeswitch.org>http://www.freeswitch.org
_______________________________________________ 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
_______________________________________________ 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 (3)
-
Chia-Yen Wu
-
Michael Jerris
-
Sergey Okhapkin