<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><font face="Calibri, sans-serif" size="3">Hi Avi, i followed idea 1, i modified the dial plan to look like this:</font><div style="font-family: Calibri, sans-serif; font-size: 12pt; "><br></div><div><div><font face="Calibri, sans-serif"><extension name="huawei_csoft_gw_outbound_call_international"></font></div><div><font face="Calibri, sans-serif"> <condition field="destination_number" expression="^(00[\d]{7,}?)$"></font></div><div><font face="Calibri, sans-serif"> <action application="lua" data="get_user_profile.lua" /></font></div><div><font face="Calibri, sans-serif"> <action application="set" data="number_to_dial=$1" /></font></div><div><font face="Calibri, sans-serif"> <action application="execute_extension" data="ldi"/></font></div><div><font face="Calibri, sans-serif"> </condition></font></div><div><font face="Calibri, sans-serif"> </extension></font></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif"> <extension name="check_and_send_international_call"></font></div><div><font face="Calibri, sans-serif"> <condition field="destination_number" expression="^ldi$" /></font></div><div><font face="Calibri, sans-serif"> <condition field="${int}" expression="1"></font></div><div><font face="Calibri, sans-serif"> <action application="set" data="effective_caller_id_number=280${caller_id_number}"/></font></div><div><font face="Calibri, sans-serif"> <action application="bridge" data="sofia/gateway/huawei_csoft/${number_to_dial}"/></font></div><div><font face="Calibri, sans-serif"> </condition></font></div><div><font face="Calibri, sans-serif"> </extension></font></div></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif">but i dont understand why the previous alternative did not work, is there anyways to avoid the dial plan to be parsed twice ? thanks!</font></div><div style="font-family: Calibri, sans-serif; font-size: 12pt; "><br></div><div style="font-family: Calibri, sans-serif; font-size: 12pt; "><br><br><div><div id="SkyDrivePlaceholder"></div><hr id="stopSpelling">From: avi@avimarcus.net<br>Date: Wed, 5 Dec 2012 22:50:05 +0200<br>To: freeswitch-users@lists.freeswitch.org<br>Subject: Re: [Freeswitch-users] get a variable at hunting phase that is set at executing phase<br><br><div dir="ltr">Two options:<div>1) Transfer after running your script. It starts the dialplan over again.</div><div>2) <span style="background-color:rgb(249,249,249);line-height:1.1em">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.</span></div>
<div><span style="line-height:14.29523754119873px">If so, update the wiki here: </span><a href="http://wiki.freeswitch.org/wiki/Dialplan_XML#Inline_Actions" target="_blank">http://wiki.freeswitch.org/wiki/Dialplan_XML#Inline_Actions</a></div>
<div><span style="line-height:14.29523754119873px"><br></span><div dir="ltr"><span style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:small">-Avi</span></div><br><div class="ecxgmail_quote">On Wed, Dec 5, 2012 at 10:36 PM, Juan Pablo L. <span dir="ltr"><<a href="mailto:jpablolorenzetti@hotmail.com">jpablolorenzetti@hotmail.com</a>></span> wrote:<br>
<blockquote class="ecxgmail_quote" style="border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr"><font face="Calibri, sans-serif" size="3">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:</font><div style="font-family:Calibri,sans-serif;font-size:12pt">
<br></div><div style="font-family:Calibri,sans-serif;font-size:12pt"><br></div><div style="font-family:Calibri,sans-serif;font-size:12pt"><div><extension name="huawei_csoft_gw_outbound_call_international"></div>
<div> <span style="font-size:12pt"><condition field="${int}" expression="1"/></span></div><div> <condition field="destination_number" expression="^00[\d]{7,}?$"></div>
<div> <action application="set" data="effective_caller_id_number=280${caller_id_number}"/></div><div> <action application="bridge" data="sofia/gateway/huawei_csoft/${destination_number}"/></div>
<div> </condition></div><div> </extension></div></div><div style="font-family:Calibri,sans-serif;font-size:12pt"><br></div><div style="font-family:Calibri,sans-serif;font-size:12pt">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.</div>
<div style="font-family:Calibri,sans-serif;font-size:12pt">i have used "execute_extension" in the following way:</div><div style="font-family:Calibri,sans-serif;font-size:12pt"><br></div><div><div><font face="Calibri, sans-serif"><extension name="is_international_allowed"></font></div>
<div><font face="Calibri, sans-serif"> <condition field="destination_number" expression="^iia$"></font></div><div><font face="Calibri, sans-serif"> <action application="lua" data="get_user_profile.lua" /> </font></div>
<div><font face="Calibri, sans-serif"> </condition></font></div><div><font face="Calibri, sans-serif"> </extension></font></div><div><br></div><div><font face="Calibri, sans-serif"> <extension name="huawei_csoft_gw_outbound_call_international"></font></div>
<div><font face="Calibri, sans-serif"> </font><span style="font-family:Calibri,sans-serif"> <condition field="destination_number" expression="^00[\d]{7,}?$"></span></div><div><font face="Calibri, sans-serif"> <action application="execute_extension" data="iia XML smart_private"/> --></font></div>
<div><font face="Calibri, sans-serif"> </font><span style="font-family:Calibri,sans-serif"></condition></span></div><div><font face="Calibri, sans-serif"> <condition field="${int}" expression="1"/></font></div>
<div><font face="Calibri, sans-serif"> <condition field="destination_number" expression="^00[\d]{7,}?$"></font></div><div><font face="Calibri, sans-serif"> <action application="set" data="effective_caller_id_number=280${caller_id_number}"/></font></div>
<div><font face="Calibri, sans-serif"> <action application="bridge" data="sofia/gateway/huawei_csoft/${destination_number}"/></font></div><div><font face="Calibri, sans-serif"> </condition></font></div>
<div><font face="Calibri, sans-serif"> </extension></font></div></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif">i know this is simple but i m missing something here, i appreciate any ideas. thanks!!</font></div>
<div><font face="Calibri, sans-serif"><br></font></div>                                            </div></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com/" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com/" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org/" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div></div>
<br>_________________________________________________________________________
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</div></div>                                            </div></body>
</html>