<div dir="ltr">Once you hangup, unless you have zombie exec, the call ends and it won't transfer nor execute the lua script.<div><br></div><div>Also, if you have the lua do the hangup, it can directly access all the channel variables itself.</div><div><br></div><div>Alternatively, you can set a hangup hook and pass everything:</div><div><span style="font-size:12.8000001907349px"><action application="</span>set" data="api_hangup_hook=lua callback.lua <span style="font-size:12.8000001907349px">${effective_caller_id_number} ${destination_number}</span>"/><br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr">-Avi<br></div></div></div>
<br><div class="gmail_quote">On Thu, Jan 1, 2015 at 2:12 PM, Sina Owolabi <span dir="ltr"><<a href="mailto:notify.sina@gmail.com" target="_blank">notify.sina@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Avi,<br>
<br>
thanks and happy new year!<br>
I'm trying to using a public extension to receive the call, hangup<br>
and transfer to the extension that is actually doing the lua'ing (so<br>
to speak):<br>
<br>
<extension name="callback-caller1"><br>
<condition field="${caller_id_number}"<br>
expression="^0(\d{10})$"require-nested="false"><br>
<action application="set" data="effective_caller_id_number=+123${1}"/><br>
<action application="set" data="effective_caller_id_name=+123${1}"/><br>
</condition><br>
<condition field="destination_number" expression="^0123456(7)(8)$"><br>
<action application="ring_ready" /><br>
<action application="sleep" data="3000"/><br>
<action application="set" data="ringback=%(2000, 4000, 440.0, 480.0)"/><br>
<action application="hangup" /><br>
<action application="transfer" data="1213 XML default"/><br>
</condition><br>
<br>
<extension name="1213"><br>
<condition field="destination_number" expression="^1213$"><br>
<action application="lua" data="callback.lua<br>
${effective_caller_id_number} ${destination_number}"/><br>
</condition<br>
<br>
Please is this the proper way to collect data from the first leg to<br>
pass to the lua script?<br>
<div class="HOEnZb"><div class="h5"><br>
On Wed, Dec 31, 2014 at 6:36 PM, Avi Marcus <<a href="mailto:avi@avimarcus.net">avi@avimarcus.net</a>> wrote:<br>
> I've used a lua script to grab the information (and make sure it's a valid<br>
> callback), hangup, and then run:<br>
><br>
> freeswitch.msleep(2000); --wait 2 seconds to make sure their side will<br>
> actually have the call over<br>
> api = freeswitch.API()<br>
> api:execute("originate", your-dialstring)<br>
><br>
> -Avi<br>
><br>
> On Wed, Dec 31, 2014 at 11:37 AM, Sina Owolabi <<a href="mailto:notify.sina@gmail.com">notify.sina@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Hi List!<br>
>><br>
>><br>
>> FreeSWITCHNewbie here.<br>
>> Please can I have some guidance on how to setup call back?<br>
>><br>
>> I would like to be able to dial the DID attached to the SIP trunk<br>
>> Freeswitch is registered to, and then have freeSWITCH hang up the call<br>
>> and dial the caller id number back through any other SIP trunk<br>
>> FreeSWITCH Is registered with, but with the origination number set to<br>
>> the DID that the first call came through in the first place.<br>
>><br>
>> Please is this possible just through the dial plan?<br>
>><br>
>> Thanks for any help!<br>
>><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>
>> 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><br>
><br>
><br>
><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>
> 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><br>
</div></div></blockquote></div><br></div></div>