Doing basic arithmetic in the xml dialplan without a language
Is there a way to do basic arithmetic within the dialplan without running a mod_language script. For instance, to increment a counter on every call. Or to use the modula or division. Herman
This is an example of adding 1 to the 'inc' variable. If 'inc' is not defined, it will become 1. If it is 1, it will become 2, etc... <action application="set" data="inc=${expr(${inc}+1)}"/> On Fri, Apr 13, 2012 at 7:24 AM, Herman Griffin <herman.griffin@gmail.com> wrote:
Is there a way to do basic arithmetic within the dialplan without running a mod_language script. For instance, to increment a counter on every call. Or to use the modula or division.
Herman
_________________________________________________________________________ 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
Also FYI to make the API as variable syntax lighter on the eyes if you don't need the () you can omit them: <action application="set" data="inc=${expr ${inc}+1}"/> On Fri, Apr 13, 2012 at 6:52 AM, Vik Killa <vipkilla@gmail.com> wrote:
This is an example of adding 1 to the 'inc' variable. If 'inc' is not defined, it will become 1. If it is 1, it will become 2, etc... <action application="set" data="inc=${expr(${inc}+1)}"/>
On Fri, Apr 13, 2012 at 7:24 AM, Herman Griffin <herman.griffin@gmail.com> wrote:
Is there a way to do basic arithmetic within the dialplan without running a mod_language script. For instance, to increment a counter on every call. Or to use the modula or division.
Herman
_________________________________________________________________________ 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
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@conference.freeswitch.org pstn:+19193869900
participants (3)
-
Anthony Minessale
-
Herman Griffin
-
Vik Killa