<div dir="ltr"><div><div><p class="">Heres an expanded example;</p><p class=""><br></p><p class=""><br></p><p class="">Extension runs the perl script as part of the public dialplan first;</p><p class=""><br></p><p class=""><extension name="run-script" continue="true"></p><p class=""> <condition></p><p class=""><span class="" style="white-space:pre">        </span> <action application="perl" data="/etc/freeswitch/scripts/<a href="http://my-script.pl">my-script.pl</a>"/></p><p class=""> </condition></p><p class=""></extension></p><p class=""><br></p><p class=""><br></p><p class="">Script sets some variables;</p><p class=""><br></p><p class="">$my_value = "123";</p><p class="">$session->setVariable('some_var',$my_value);</p><p class=""><br></p><p class=""><br></p><p class="">Use that variable later in another extension in the public dialplan as a condition selector;</p><p class=""><br></p><p class=""><br></p><p class=""><extension name="bridge-call" ></p><p class=""> <condition field="context" expression="public" /></p><p class=""> <condition field="${some_var}" expression="123" ></p><p class=""><span class="" style="white-space:pre">        </span> <action application="set" data="call_direction=inbound"/></p><p class=""><span class="" style="white-space:pre">        </span> <action application="bridge" data="sofia/internal/${<a href="http://destination_number}@1.2.3.4:5060">destination_number}@1.2.3.4:5060</a>" /></p><p class=""> </condition></p><p class=""></extension></p><p class=""><br></p><p class=""><br></p><p class="">However this will fail, because the perl script "$session->setVariable" run earlier is not inline, so you cant make use of it in the condition (<condition field="${some_var}" expression="123" >) in the second extension that exists in a later part of the public dialplan. Hence I need a way to set inline variables from my perl script.</p><p class=""><br></p><p class=""><br></p><p class="">Cheers</p><p class=""><br></p><p class="">Liam Farr</p><p class=""><br></p></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 11 December 2014 at 06:28, Michael Jerris <span dir="ltr"><<a href="mailto:mike@jerris.com" target="_blank">mike@jerris.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If you are in a perl script using session->setVariable, how are you still in the dialplan? This doesn't make sense to me. There should be no need for an inline if you are already in the script.<br>
<div><div class="h5"><br>
> On Dec 10, 2014, at 4:20 AM, Liam Farr <<a href="mailto:liam@maxumdata.com">liam@maxumdata.com</a>> wrote:<br>
><br>
> Hi,<br>
><br>
> I need to set a variable using a perl script inline.<br>
><br>
> Normally I would use $session->setVariable('some_var',$my_value);<br>
><br>
> However I cant find any options to execute this inline / as an inline action. (I need to evaluate the variable later in the hunting phase of the dialplan hence need it to be an inline action).<br>
><br>
> Is there a way to do this?<br>
><br>
> Or is there another way to achieve the same result, e.g. hacking $session->execute("set","some_var=$my_value") to run as an inline action?<br>
><br>
> Any help would be much appreciated, I've scoured the wiki, confluence and git repo and come up empty.<br>
><br>
> --<br>
> Kind Regards<br>
><br>
><br>
> Liam Farr<br>
<br>
<br>
</div></div>_________________________________________________________________________<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>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" target="_blank">http://confluence.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></blockquote></div>
</div></div>