get a variable at hunting phase that is set at executing phase
Guys, i have a script the sets some variables the i m supposed to use to decide if a condition meets, i have tried to use the execute_extension app but it does not work, this is the dialplan: <extension name="huawei_csoft_gw_outbound_call_international"> <condition field="${int}" expression="1"/> <condition field="destination_number" expression="^00[\d]{7,}?$"> <action application="set" data="effective_caller_id_number=280${caller_id_number}"/> <action application="bridge" data="sofia/gateway/huawei_csoft/${destination_number}"/> </condition> </extension> the script that sets the var ${int} is called "get_user_profile.lua", i have placed it all over the place and cant make this work.i have used "execute_extension" in the following way: <extension name="is_international_allowed"> <condition field="destination_number" expression="^iia$"> <action application="lua" data="get_user_profile.lua" /> </condition> </extension> <extension name="huawei_csoft_gw_outbound_call_international"> <condition field="destination_number" expression="^00[\d]{7,}?$"> <action application="execute_extension" data="iia XML smart_private"/> --> </condition> <condition field="${int}" expression="1"/> <condition field="destination_number" expression="^00[\d]{7,}?$"> <action application="set" data="effective_caller_id_number=280${caller_id_number}"/> <action application="bridge" data="sofia/gateway/huawei_csoft/${destination_number}"/> </condition> </extension> i know this is simple but i m missing something here, i appreciate any ideas. thanks!!
Two options: 1) Transfer after running your script. It starts the dialplan over again. 2) inline="true" - that actually runs it right away. However, you can't touch media at this point or you break the call routing. So I don't think this option is allowed for lua. Or it might have been, give it a try. If so, update the wiki here: http://wiki.freeswitch.org/wiki/Dialplan_XML#Inline_Actions -Avi On Wed, Dec 5, 2012 at 10:36 PM, Juan Pablo L. <jpablolorenzetti@hotmail.com
wrote:
Guys, i have a script the sets some variables the i m supposed to use to decide if a condition meets, i have tried to use the execute_extension app but it does not work, this is the dialplan:
<extension name="huawei_csoft_gw_outbound_call_international"> <condition field="${int}" expression="1"/> <condition field="destination_number" expression="^00[\d]{7,}?$"> <action application="set" data="effective_caller_id_number=280${caller_id_number}"/> <action application="bridge" data="sofia/gateway/huawei_csoft/${destination_number}"/> </condition> </extension>
the script that sets the var ${int} is called "get_user_profile.lua", i have placed it all over the place and cant make this work. i have used "execute_extension" in the following way:
<extension name="is_international_allowed"> <condition field="destination_number" expression="^iia$"> <action application="lua" data="get_user_profile.lua" /> </condition> </extension>
<extension name="huawei_csoft_gw_outbound_call_international"> <condition field="destination_number" expression="^00[\d]{7,}?$"> <action application="execute_extension" data="iia XML smart_private"/> --> </condition> <condition field="${int}" expression="1"/> <condition field="destination_number" expression="^00[\d]{7,}?$"> <action application="set" data="effective_caller_id_number=280${caller_id_number}"/> <action application="bridge" data="sofia/gateway/huawei_csoft/${destination_number}"/> </condition> </extension>
i know this is simple but i m missing something here, i appreciate any ideas. thanks!!
_________________________________________________________________________ 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 Avi, i followed idea 1, i modified the dial plan to look like this: <extension name="huawei_csoft_gw_outbound_call_international"> <condition field="destination_number" expression="^(00[\d]{7,}?)$"> <action application="lua" data="get_user_profile.lua" /> <action application="set" data="number_to_dial=$1" /> <action application="execute_extension" data="ldi"/> </condition> </extension> <extension name="check_and_send_international_call"> <condition field="destination_number" expression="^ldi$" /> <condition field="${int}" expression="1"> <action application="set" data="effective_caller_id_number=280${caller_id_number}"/> <action application="bridge" data="sofia/gateway/huawei_csoft/${number_to_dial}"/> </condition> </extension> but i dont understand why the previous alternative did not work, is there anyways to avoid the dial plan to be parsed twice ? thanks! From: avi@avimarcus.net Date: Wed, 5 Dec 2012 22:50:05 +0200 To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] get a variable at hunting phase that is set at executing phase Two options:1) Transfer after running your script. It starts the dialplan over again.2) inline="true" - that actually runs it right away. However, you can't touch media at this point or you break the call routing. So I don't think this option is allowed for lua. Or it might have been, give it a try. If so, update the wiki here: http://wiki.freeswitch.org/wiki/Dialplan_XML#Inline_Actions -Avi On Wed, Dec 5, 2012 at 10:36 PM, Juan Pablo L. <jpablolorenzetti@hotmail.com> wrote: Guys, i have a script the sets some variables the i m supposed to use to decide if a condition meets, i have tried to use the execute_extension app but it does not work, this is the dialplan: <extension name="huawei_csoft_gw_outbound_call_international"> <condition field="${int}" expression="1"/> <condition field="destination_number" expression="^00[\d]{7,}?$"> <action application="set" data="effective_caller_id_number=280${caller_id_number}"/> <action application="bridge" data="sofia/gateway/huawei_csoft/${destination_number}"/> </condition> </extension> the script that sets the var ${int} is called "get_user_profile.lua", i have placed it all over the place and cant make this work. i have used "execute_extension" in the following way: <extension name="is_international_allowed"> <condition field="destination_number" expression="^iia$"> <action application="lua" data="get_user_profile.lua" /> </condition> </extension> <extension name="huawei_csoft_gw_outbound_call_international"> <condition field="destination_number" expression="^00[\d]{7,}?$"> <action application="execute_extension" data="iia XML smart_private"/> --> </condition> <condition field="${int}" expression="1"/> <condition field="destination_number" expression="^00[\d]{7,}?$"> <action application="set" data="effective_caller_id_number=280${caller_id_number}"/> <action application="bridge" data="sofia/gateway/huawei_csoft/${destination_number}"/> </condition> </extension> i know this is simple but i m missing something here, i appreciate any ideas. thanks!! _________________________________________________________________________ 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 Avi, i followed idea 1, i modified the dial plan to look like this: <extension name="huawei_csoft_gw_outbound_call_international"> <condition field="destination_number" expression="^(00[\d]{7,}?)$"> <action application="lua" data="get_user_profile.lua" /> <action application="set" data="number_to_dial=$1" /> <action application="execute_extension" data="ldi"/> </condition> </extension> <extension name="check_and_send_international_call"> <condition field="destination_number" expression="^ldi$" /> <condition field="${int}" expression="1"> <action application="set" data="effective_caller_id_number=280${caller_id_number}"/> <action application="bridge" data="sofia/gateway/huawei_csoft/${number_to_dial}"/> </condition> </extension> but i dont understand why the previous alternative did not work, is there anyways to avoid the dial plan to be parsed twice ? thanks! From: avi@avimarcus.net Date: Wed, 5 Dec 2012 22:50:05 +0200 To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] get a variable at hunting phase that is set at executing phase Two options:1) Transfer after running your script. It starts the dialplan over again.2) inline="true" - that actually runs it right away. However, you can't touch media at this point or you break the call routing. So I don't think this option is allowed for lua. Or it might have been, give it a try. If so, update the wiki here: http://wiki.freeswitch.org/wiki/Dialplan_XML#Inline_Actions -Avi On Wed, Dec 5, 2012 at 10:36 PM, Juan Pablo L. <jpablolorenzetti@hotmail.com> wrote: Guys, i have a script the sets some variables the i m supposed to use to decide if a condition meets, i have tried to use the execute_extension app but it does not work, this is the dialplan: <extension name="huawei_csoft_gw_outbound_call_international"> <condition field="${int}" expression="1"/> <condition field="destination_number" expression="^00[\d]{7,}?$"> <action application="set" data="effective_caller_id_number=280${caller_id_number}"/> <action application="bridge" data="sofia/gateway/huawei_csoft/${destination_number}"/> </condition> </extension> the script that sets the var ${int} is called "get_user_profile.lua", i have placed it all over the place and cant make this work. i have used "execute_extension" in the following way: <extension name="is_international_allowed"> <condition field="destination_number" expression="^iia$"> <action application="lua" data="get_user_profile.lua" /> </condition> </extension> <extension name="huawei_csoft_gw_outbound_call_international"> <condition field="destination_number" expression="^00[\d]{7,}?$"> <action application="execute_extension" data="iia XML smart_private"/> --> </condition> <condition field="${int}" expression="1"/> <condition field="destination_number" expression="^00[\d]{7,}?$"> <action application="set" data="effective_caller_id_number=280${caller_id_number}"/> <action application="bridge" data="sofia/gateway/huawei_csoft/${destination_number}"/> </condition> </extension> i know this is simple but i m missing something here, i appreciate any ideas. thanks!! _________________________________________________________________________ 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
It might be good for you to pastebin the debug log of the call flow. Use pastebin.freeswitch.org and set the syntax highlight to FreeSWITCH Log. Once that's there we will take a look and help you diagnose what is (and is not) happening. Looking at the log is the best way to be sure that you know what's really going on. -MC On Wed, Dec 5, 2012 at 12:36 PM, Juan Pablo L. <jpablolorenzetti@hotmail.com
wrote:
Guys, i have a script the sets some variables the i m supposed to use to decide if a condition meets, i have tried to use the execute_extension app but it does not work, this is the dialplan:
<extension name="huawei_csoft_gw_outbound_call_international"> <condition field="${int}" expression="1"/> <condition field="destination_number" expression="^00[\d]{7,}?$"> <action application="set" data="effective_caller_id_number=280${caller_id_number}"/> <action application="bridge" data="sofia/gateway/huawei_csoft/${destination_number}"/> </condition> </extension>
the script that sets the var ${int} is called "get_user_profile.lua", i have placed it all over the place and cant make this work. i have used "execute_extension" in the following way:
<extension name="is_international_allowed"> <condition field="destination_number" expression="^iia$"> <action application="lua" data="get_user_profile.lua" /> </condition> </extension>
<extension name="huawei_csoft_gw_outbound_call_international"> <condition field="destination_number" expression="^00[\d]{7,}?$"> <action application="execute_extension" data="iia XML smart_private"/> --> </condition> <condition field="${int}" expression="1"/> <condition field="destination_number" expression="^00[\d]{7,}?$"> <action application="set" data="effective_caller_id_number=280${caller_id_number}"/> <action application="bridge" data="sofia/gateway/huawei_csoft/${destination_number}"/> </condition> </extension>
i know this is simple but i m missing something here, i appreciate any ideas. thanks!!
_________________________________________________________________________ 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
-- Michael S Collins Twitter: @mercutioviz http://www.FreeSWITCH.org http://www.ClueCon.com http://www.OSTAG.org
Thanks Avi for you answer, i m going to try that (i already have and the ${int} got lost somewhere but i ll try again) Michael, thanks for your suggestion, i have put it in pastebin: http://pastebin.freeswitch.org/20293 thanks! Date: Wed, 5 Dec 2012 13:06:35 -0800 From: msc@freeswitch.org To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] get a variable at hunting phase that is set at executing phase It might be good for you to pastebin the debug log of the call flow. Use pastebin.freeswitch.org and set the syntax highlight to FreeSWITCH Log. Once that's there we will take a look and help you diagnose what is (and is not) happening. Looking at the log is the best way to be sure that you know what's really going on. -MC On Wed, Dec 5, 2012 at 12:36 PM, Juan Pablo L. <jpablolorenzetti@hotmail.com> wrote: Guys, i have a script the sets some variables the i m supposed to use to decide if a condition meets, i have tried to use the execute_extension app but it does not work, this is the dialplan: <extension name="huawei_csoft_gw_outbound_call_international"> <condition field="${int}" expression="1"/> <condition field="destination_number" expression="^00[\d]{7,}?$"> <action application="set" data="effective_caller_id_number=280${caller_id_number}"/> <action application="bridge" data="sofia/gateway/huawei_csoft/${destination_number}"/> </condition> </extension> the script that sets the var ${int} is called "get_user_profile.lua", i have placed it all over the place and cant make this work. i have used "execute_extension" in the following way: <extension name="is_international_allowed"> <condition field="destination_number" expression="^iia$"> <action application="lua" data="get_user_profile.lua" /> </condition> </extension> <extension name="huawei_csoft_gw_outbound_call_international"> <condition field="destination_number" expression="^00[\d]{7,}?$"> <action application="execute_extension" data="iia XML smart_private"/> --> </condition> <condition field="${int}" expression="1"/> <condition field="destination_number" expression="^00[\d]{7,}?$"> <action application="set" data="effective_caller_id_number=280${caller_id_number}"/> <action application="bridge" data="sofia/gateway/huawei_csoft/${destination_number}"/> </condition> </extension> i know this is simple but i m missing something here, i appreciate any ideas. thanks!! _________________________________________________________________________ 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 -- Michael S Collins Twitter: @mercutioviz http://www.FreeSWITCH.org http://www.ClueCon.com http://www.OSTAG.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
On Wed, Dec 5, 2012 at 1:19 PM, Juan Pablo L. <jpablolorenzetti@hotmail.com>wrote:
Thanks Avi for you answer, i m going to try that (i already have and the ${int} got lost somewhere but i ll try again)
Michael, thanks for your suggestion, i have put it in pastebin: http://pastebin.freeswitch.org/20293
Okay, this is why PB is good. It's just as you and Avi suspected - the variable is being tested prior to the Lua script running. If you want to see how to determine that yourself then look at your pastebin entry. Lines 48-72 are the dialplan hunting. The executing starts at line 80 with the Lua script. The Lua script is being executed after the variable is being check, which you'll see on line # 66. Either of Avi's suggestions should help. -MC
Michael, thank you for showing me, it is clear in the logs now, i did not have that clear before but i see it now ... i implemented Avi's suggestion 1 and it works now but i noticed that execute_extension parses the dialplan again, is there anyway to avoid reading the dialplan again ? regards! Date: Wed, 5 Dec 2012 15:41:45 -0800 From: msc@freeswitch.org To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] get a variable at hunting phase that is set at executing phase On Wed, Dec 5, 2012 at 1:19 PM, Juan Pablo L. <jpablolorenzetti@hotmail.com> wrote: Thanks Avi for you answer, i m going to try that (i already have and the ${int} got lost somewhere but i ll try again) Michael, thanks for your suggestion, i have put it in pastebin: http://pastebin.freeswitch.org/20293 Okay, this is why PB is good. It's just as you and Avi suspected - the variable is being tested prior to the Lua script running. If you want to see how to determine that yourself then look at your pastebin entry. Lines 48-72 are the dialplan hunting. The executing starts at line 80 with the Lua script. The Lua script is being executed after the variable is being check, which you'll see on line # 66. Either of Avi's suggestions should help. -MC _________________________________________________________________________ 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
If you execute_extension to a new context, you can create very few extensions in that context so that it goes quicker. -Avi On Thu, Dec 6, 2012 at 3:46 AM, Juan Pablo L. <jpablolorenzetti@hotmail.com>wrote:
Michael, thank you for showing me, it is clear in the logs now, i did not have that clear before but i see it now ... i implemented Avi's suggestion 1 and it works now but i noticed that execute_extension parses the dialplan again, is there anyway to avoid reading the dialplan again ? regards!
------------------------------ Date: Wed, 5 Dec 2012 15:41:45 -0800
From: msc@freeswitch.org To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] get a variable at hunting phase that is set at executing phase
On Wed, Dec 5, 2012 at 1:19 PM, Juan Pablo L. < jpablolorenzetti@hotmail.com> wrote:
Thanks Avi for you answer, i m going to try that (i already have and the ${int} got lost somewhere but i ll try again)
Michael, thanks for your suggestion, i have put it in pastebin: http://pastebin.freeswitch.org/20293
Okay, this is why PB is good. It's just as you and Avi suspected - the variable is being tested prior to the Lua script running. If you want to see how to determine that yourself then look at your pastebin entry. Lines 48-72 are the dialplan hunting. The executing starts at line 80 with the Lua script. The Lua script is being executed after the variable is being check, which you'll see on line # 66.
Either of Avi's suggestions should help.
-MC
_________________________________________________________________________ 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
Avi, yes that makes sense, i will try that is a good idea .. thanks!! From: avi@avimarcus.net Date: Thu, 6 Dec 2012 10:00:37 +0200 To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] get a variable at hunting phase that is set at executing phase If you execute_extension to a new context, you can create very few extensions in that context so that it goes quicker. -Avi On Thu, Dec 6, 2012 at 3:46 AM, Juan Pablo L. <jpablolorenzetti@hotmail.com> wrote: Michael, thank you for showing me, it is clear in the logs now, i did not have that clear before but i see it now ... i implemented Avi's suggestion 1 and it works now but i noticed that execute_extension parses the dialplan again, is there anyway to avoid reading the dialplan again ? regards! Date: Wed, 5 Dec 2012 15:41:45 -0800 From: msc@freeswitch.org To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] get a variable at hunting phase that is set at executing phase On Wed, Dec 5, 2012 at 1:19 PM, Juan Pablo L. <jpablolorenzetti@hotmail.com> wrote: Thanks Avi for you answer, i m going to try that (i already have and the ${int} got lost somewhere but i ll try again) Michael, thanks for your suggestion, i have put it in pastebin: http://pastebin.freeswitch.org/20293 Okay, this is why PB is good. It's just as you and Avi suspected - the variable is being tested prior to the Lua script running. If you want to see how to determine that yourself then look at your pastebin entry. Lines 48-72 are the dialplan hunting. The executing starts at line 80 with the Lua script. The Lua script is being executed after the variable is being check, which you'll see on line # 66. Either of Avi's suggestions should help. -MC _________________________________________________________________________ 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
Michael, thank you for showing me, it is clear in the logs now, i did not have that clear before but i see it now ... i implemented Avi's suggestion 1 and it works now but i noticed that execute_extension parses the dialplan again, is there anyway to avoid reading the dialplan again ? regards! Date: Wed, 5 Dec 2012 15:41:45 -0800 From: msc@freeswitch.org To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] get a variable at hunting phase that is set at executing phase On Wed, Dec 5, 2012 at 1:19 PM, Juan Pablo L. <jpablolorenzetti@hotmail.com> wrote: Thanks Avi for you answer, i m going to try that (i already have and the ${int} got lost somewhere but i ll try again) Michael, thanks for your suggestion, i have put it in pastebin: http://pastebin.freeswitch.org/20293 Okay, this is why PB is good. It's just as you and Avi suspected - the variable is being tested prior to the Lua script running. If you want to see how to determine that yourself then look at your pastebin entry. Lines 48-72 are the dialplan hunting. The executing starts at line 80 with the Lua script. The Lua script is being executed after the variable is being check, which you'll see on line # 66. Either of Avi's suggestions should help. -MC _________________________________________________________________________ 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
Thanks Avi for you answer, i m going to try that (i already have and the ${int} got lost somewhere but i ll try again) Michael, thanks for your suggestion, i have put it in pastebin: http://pastebin.freeswitch.org/20293 thanks! Date: Wed, 5 Dec 2012 13:06:35 -0800 From: msc@freeswitch.org To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] get a variable at hunting phase that is set at executing phase It might be good for you to pastebin the debug log of the call flow. Use pastebin.freeswitch.org and set the syntax highlight to FreeSWITCH Log. Once that's there we will take a look and help you diagnose what is (and is not) happening. Looking at the log is the best way to be sure that you know what's really going on. -MC On Wed, Dec 5, 2012 at 12:36 PM, Juan Pablo L. <jpablolorenzetti@hotmail.com> wrote: Guys, i have a script the sets some variables the i m supposed to use to decide if a condition meets, i have tried to use the execute_extension app but it does not work, this is the dialplan: <extension name="huawei_csoft_gw_outbound_call_international"> <condition field="${int}" expression="1"/> <condition field="destination_number" expression="^00[\d]{7,}?$"> <action application="set" data="effective_caller_id_number=280${caller_id_number}"/> <action application="bridge" data="sofia/gateway/huawei_csoft/${destination_number}"/> </condition> </extension> the script that sets the var ${int} is called "get_user_profile.lua", i have placed it all over the place and cant make this work. i have used "execute_extension" in the following way: <extension name="is_international_allowed"> <condition field="destination_number" expression="^iia$"> <action application="lua" data="get_user_profile.lua" /> </condition> </extension> <extension name="huawei_csoft_gw_outbound_call_international"> <condition field="destination_number" expression="^00[\d]{7,}?$"> <action application="execute_extension" data="iia XML smart_private"/> --> </condition> <condition field="${int}" expression="1"/> <condition field="destination_number" expression="^00[\d]{7,}?$"> <action application="set" data="effective_caller_id_number=280${caller_id_number}"/> <action application="bridge" data="sofia/gateway/huawei_csoft/${destination_number}"/> </condition> </extension> i know this is simple but i m missing something here, i appreciate any ideas. thanks!! _________________________________________________________________________ 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 -- Michael S Collins Twitter: @mercutioviz http://www.FreeSWITCH.org http://www.ClueCon.com http://www.OSTAG.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 (3)
-
Avi Marcus
-
Juan Pablo L.
-
Michael Collins