Global variable in dialplan
Hello, Is there a way to access a global variable in the xml dialplan and have a condition on it? Regards, Ali Pey
Its already there, what are you looking to do exactly? -- Brian West brian@freeswitch.org FreeSWITCH Solutions, LLC PO BOX 2531 Brookfield, WI 53008-2531 Twitter: @FreeSWITCH_Wire , @briankwest http://www.freeswitchbook.com http://www.freeswitchcookbook.com T: +1.918.420.9001 | F: +1.918.420.9002 | M: +1.918.424.WEST iNUM: +883 5100 1420 9001 ISN: 410*543 Skype:briankwest PGP Key: http://www.bkw.org/key.txt (AB93356707C76CED) On 2013-11-21, at 1:06 PM, Ali Pey <alipey@gmail.com> wrote:
Hello,
Is there a way to access a global variable in the xml dialplan and have a condition on it?
Regards, Ali Pey
Hello Brain, In my perl script I set a global variable, e.g. global_egress_disable=1 ( This is while bridge is calling to a number of loopback destinations) In my dialplan is a particular context, I would like to examine this global variable to see if it exists and set to 1. (This is my work around way to stop bridge to continue dialing out the remaining of the extensions if the caller has decided to go to voicemail or somewhere else in bind_digit_action.) Thanks, Ali On Thu, Nov 21, 2013 at 2:39 PM, Brian West <brian@freeswitch.org> wrote:
Its already there, what are you looking to do exactly?
-- Brian West brian@freeswitch.org FreeSWITCH Solutions, LLC PO BOX 2531 Brookfield, WI 53008-2531 Twitter: @FreeSWITCH_Wire , @briankwest http://www.freeswitchbook.com http://www.freeswitchcookbook.com
T: +1.918.420.9001 | F: +1.918.420.9002 | M: +1.918.424.WEST iNUM: +883 5100 1420 9001 ISN: 410*543 Skype:briankwest PGP Key: http://www.bkw.org/key.txt (AB93356707C76CED)
On 2013-11-21, at 1:06 PM, Ali Pey <alipey@gmail.com> wrote:
Hello,
Is there a way to access a global variable in the xml dialplan and have a condition on it?
Regards, Ali Pey
_________________________________________________________________________ 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
Perhaps you want limit, hash, or DB. Those are accessible by name from everywhere. Although, I think there are globals too somewhere. -Avi
All global variables are always accessible from your channel so you just look for it like any channel variable. If you set a var with the same name on the channel, it will mask the global. You can also use ${global_getvar <varname} but really there is little point when you can use ${<varname>} as usual. On Fri, Nov 22, 2013 at 12:14 AM, Avi Marcus <avi@avimarcus.net> wrote:
Perhaps you want limit, hash, or DB. Those are accessible by name from everywhere.
Although, I think there are globals too somewhere.
-Avi
_________________________________________________________________________ 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
Thank you Anthony. Is there anything similar to "defined" condition in dialplan? I want to examine if a global variable exists or not. Right now, it always gives me an error if the variable doesn't exist. Is there anyway that I can add a condition in my dialplan to check if a global variable actually exists or not? Regards, Ali Pey On Fri, Nov 22, 2013 at 3:33 PM, Anthony Minessale < anthony.minessale@gmail.com> wrote:
All global variables are always accessible from your channel so you just look for it like any channel variable. If you set a var with the same name on the channel, it will mask the global.
You can also use ${global_getvar <varname} but really there is little point when you can use ${<varname>} as usual.
On Fri, Nov 22, 2013 at 12:14 AM, Avi Marcus <avi@avimarcus.net> wrote:
Perhaps you want limit, hash, or DB. Those are accessible by name from everywhere.
Although, I think there are globals too somewhere.
-Avi
_________________________________________________________________________ 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
_________________________________________________________________________ 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
${cond ${variable} == 0 ? a : b} There was a minor issue with this that has been fixed today so you would need latest HEAD. Also with regular extension stuff you just use the regex ^$ for undefined val. On Mon, Nov 25, 2013 at 3:01 PM, Ali Pey <alipey@gmail.com> wrote:
Thank you Anthony.
Is there anything similar to "defined" condition in dialplan? I want to examine if a global variable exists or not.
Right now, it always gives me an error if the variable doesn't exist.
Is there anyway that I can add a condition in my dialplan to check if a global variable actually exists or not?
Regards, Ali Pey
On Fri, Nov 22, 2013 at 3:33 PM, Anthony Minessale < anthony.minessale@gmail.com> wrote:
All global variables are always accessible from your channel so you just look for it like any channel variable. If you set a var with the same name on the channel, it will mask the global.
You can also use ${global_getvar <varname} but really there is little point when you can use ${<varname>} as usual.
On Fri, Nov 22, 2013 at 12:14 AM, Avi Marcus <avi@avimarcus.net> wrote:
Perhaps you want limit, hash, or DB. Those are accessible by name from everywhere.
Although, I think there are globals too somewhere.
-Avi
_________________________________________________________________________ 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
_________________________________________________________________________ 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 (4)
-
Ali Pey
-
Anthony Minessale
-
Avi Marcus
-
Brian West