vars scope in dialplan
example : <extension name="blabla"> <condition> <action application="set" data="test=cake"/> </condition> <condition field="${test}" expression="^(cake)$"> <action application="set" data="prfx=00"/> </condition> <condition field="${sip_to_uri}" expression="^(1\d{10,15})@$${domain}$"> <action application="set" data="getPrfx=${prfx}"/> </condition> </extension> but ${prfx} is empty. I'm almost sure I didn't understand FS vars scope yet.... Thanks Franck
This is because variables are not SET like you think. See the dialplan is compiled before its executed... but you do have an option: <action inline="true" application="set" data="prfx=00"/> The inline option will set it right then on the spot. /b On Jun 7, 2010, at 2:24 PM, Madovsky wrote:
example :
<extension name="blabla"> <condition> <action application="set" data="test=cake"/> </condition> <condition field="${test}" expression="^(cake)$"> <action application="set" data="prfx=00"/> </condition> <condition field="${sip_to_uri}" expression="^(1\d{10,15})@$${domain}$"> <action application="set" data="getPrfx=${prfx}"/> </condition> </extension>
but ${prfx} is empty. I'm almost sure I didn't understand FS vars scope yet....
Thanks
Franck
Thanks Brian, I forgot this option... F ----- Original Message ----- From: "Brian West" <brian@freeswitch.org> To: <freeswitch-users@lists.freeswitch.org> Sent: Monday, June 07, 2010 3:32 PM Subject: Re: [Freeswitch-users] vars scope in dialplan
This is because variables are not SET like you think. See the dialplan is compiled before its executed... but you do have an option:
<action inline="true" application="set" data="prfx=00"/>
The inline option will set it right then on the spot.
/b
On Jun 7, 2010, at 2:24 PM, Madovsky wrote:
example :
<extension name="blabla"> <condition> <action application="set" data="test=cake"/> </condition> <condition field="${test}" expression="^(cake)$"> <action application="set" data="prfx=00"/> </condition> <condition field="${sip_to_uri}" expression="^(1\d{10,15})@$${domain}$"> <action application="set" data="getPrfx=${prfx}"/> </condition> </extension>
but ${prfx} is empty. I'm almost sure I didn't understand FS vars scope yet....
Thanks
Franck
_______________________________________________ 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
Brien, if I have to write several conditions for the same vars, like <condition> <action inline="true" application="set" data="test=${cake}"> </condition> <condition field="${test}" expression="^(chocolate)$"> <action inline="true" application="set" data="prfx=yesyes"/> </condition> <condition field="${test}" expression="^(lemon)$"> <action inline="true" application="set" data="prfx=yes"/> </condition> ${prfx} is empty. is not allowed to do that ? Thanks Franck ----- Original Message ----- From: "Madovsky" <infos@madovsky.org> To: <freeswitch-users@lists.freeswitch.org> Sent: Monday, June 07, 2010 3:55 PM Subject: Re: [Freeswitch-users] vars scope in dialplan
Thanks Brian, I forgot this option...
F
----- Original Message ----- From: "Brian West" <brian@freeswitch.org> To: <freeswitch-users@lists.freeswitch.org> Sent: Monday, June 07, 2010 3:32 PM Subject: Re: [Freeswitch-users] vars scope in dialplan
This is because variables are not SET like you think. See the dialplan is compiled before its executed... but you do have an option:
<action inline="true" application="set" data="prfx=00"/>
The inline option will set it right then on the spot.
/b
On Jun 7, 2010, at 2:24 PM, Madovsky wrote:
example :
<extension name="blabla"> <condition> <action application="set" data="test=cake"/> </condition> <condition field="${test}" expression="^(cake)$"> <action application="set" data="prfx=00"/> </condition> <condition field="${sip_to_uri}" expression="^(1\d{10,15})@$${domain}$"> <action application="set" data="getPrfx=${prfx}"/> </condition> </extension>
but ${prfx} is empty. I'm almost sure I didn't understand FS vars scope yet....
Thanks
Franck
_______________________________________________ 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
On Mon, Jun 7, 2010 at 2:06 PM, Madovsky <infos@madovsky.org> wrote:
Brien,
if I have to write several conditions for the same vars, like
<condition> <action inline="true" application="set" data="test=${cake}"> </condition> <condition field="${test}" expression="^(chocolate)$"> <action inline="true" application="set" data="prfx=yesyes"/> </condition> <condition field="${test}" expression="^(lemon)$"> <action inline="true" application="set" data="prfx=yes"/> </condition>
${prfx} is empty. is not allowed to do that ?
At what point is ${prfx} empty?
-MC
sorry if i put another condition after this block like <condition> <action inline="true" application="set" data="test=${cake}"> </condition> <condition field="${test}" expression="^(chocolate)$"> <action inline="true" application="set" data="prfx=yesyes"/> </condition> <condition field="${test}" expression="^(lemon)$"> <action inline="true" application="set" data="prfx=yes"/> </condition> <condition field="${sip_to_uri}" expression="^(1\d{10,15})@$${domain}$"> <action application="bridge" data="sofia/gateway//${prfx}${dialed_extension}"/> </condition> at the last condition block i${prfx} is empty Thanks Franck ----- Original Message ----- From: Michael Collins To: freeswitch-users@lists.freeswitch.org Sent: Monday, June 07, 2010 6:17 PM Subject: Re: [Freeswitch-users] vars scope in dialplan On Mon, Jun 7, 2010 at 2:06 PM, Madovsky <infos@madovsky.org> wrote: Brien, if I have to write several conditions for the same vars, like <condition> <action inline="true" application="set" data="test=${cake}"> </condition> <condition field="${test}" expression="^(chocolate)$"> <action inline="true" application="set" data="prfx=yesyes"/> </condition> <condition field="${test}" expression="^(lemon)$"> <action inline="true" application="set" data="prfx=yes"/> </condition> ${prfx} is empty. is not allowed to do that ? At what point is ${prfx} empty? -MC ------------------------------------------------------------------------------ _______________________________________________ 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
No, maybe dialplan ;) ----- Original Message ----- From: Brian West To: freeswitch-users@lists.freeswitch.org Sent: Monday, June 07, 2010 9:31 PM Subject: Re: [Freeswitch-users] vars scope in dialplan sounds like ${cake} didn't exist. Did you eat it already? /b On Jun 7, 2010, at 8:25 PM, Madovsky wrote: sorry if i put another condition after this block like ------------------------------------------------------------------------------ _______________________________________________ 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)
-
Brian West
-
Madovsky
-
Michael Collins