<div dir="ltr">Once you hangup, unless you have zombie exec, the call ends and it won&#39;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">&lt;action application=&quot;</span>set&quot; data=&quot;api_hangup_hook=lua callback.lua <span style="font-size:12.8000001907349px">${effective_caller_id_number} ${destination_number}</span>&quot;/&gt;<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">&lt;<a href="mailto:notify.sina@gmail.com" target="_blank">notify.sina@gmail.com</a>&gt;</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&#39;m trying to  using a public extension to receive the call, hangup<br>
and transfer to the extension that is actually doing the lua&#39;ing (so<br>
to speak):<br>
<br>
&lt;extension name=&quot;callback-caller1&quot;&gt;<br>
    &lt;condition field=&quot;${caller_id_number}&quot;<br>
expression=&quot;^0(\d{10})$&quot;require-nested=&quot;false&quot;&gt;<br>
       &lt;action application=&quot;set&quot; data=&quot;effective_caller_id_number=+123${1}&quot;/&gt;<br>
       &lt;action application=&quot;set&quot; data=&quot;effective_caller_id_name=+123${1}&quot;/&gt;<br>
    &lt;/condition&gt;<br>
    &lt;condition field=&quot;destination_number&quot; expression=&quot;^0123456(7)(8)$&quot;&gt;<br>
      &lt;action application=&quot;ring_ready&quot; /&gt;<br>
      &lt;action application=&quot;sleep&quot; data=&quot;3000&quot;/&gt;<br>
      &lt;action application=&quot;set&quot; data=&quot;ringback=%(2000, 4000, 440.0, 480.0)&quot;/&gt;<br>
      &lt;action application=&quot;hangup&quot; /&gt;<br>
      &lt;action application=&quot;transfer&quot; data=&quot;1213 XML default&quot;/&gt;<br>
   &lt;/condition&gt;<br>
<br>
&lt;extension name=&quot;1213&quot;&gt;<br>
     &lt;condition field=&quot;destination_number&quot; expression=&quot;^1213$&quot;&gt;<br>
        &lt;action application=&quot;lua&quot; data=&quot;callback.lua<br>
${effective_caller_id_number} ${destination_number}&quot;/&gt;<br>
     &lt;/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 &lt;<a href="mailto:avi@avimarcus.net">avi@avimarcus.net</a>&gt; wrote:<br>
&gt; I&#39;ve used a lua script to grab the information (and make sure it&#39;s a valid<br>
&gt; callback), hangup, and then run:<br>
&gt;<br>
&gt; freeswitch.msleep(2000); --wait 2 seconds to make sure their side will<br>
&gt; actually have the call over<br>
&gt; api = freeswitch.API()<br>
&gt; api:execute(&quot;originate&quot;, your-dialstring)<br>
&gt;<br>
&gt; -Avi<br>
&gt;<br>
&gt; On Wed, Dec 31, 2014 at 11:37 AM, Sina Owolabi &lt;<a href="mailto:notify.sina@gmail.com">notify.sina@gmail.com</a>&gt;<br>
&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi List!<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; FreeSWITCHNewbie here.<br>
&gt;&gt; Please can I have some guidance on how to setup call back?<br>
&gt;&gt;<br>
&gt;&gt; I would like to be able to dial the DID attached to the SIP trunk<br>
&gt;&gt; Freeswitch is registered to, and then have freeSWITCH hang up the call<br>
&gt;&gt; and dial the caller id number back through any other SIP trunk<br>
&gt;&gt; FreeSWITCH Is registered with, but with the origination number set to<br>
&gt;&gt; the DID that the first call came through in the first place.<br>
&gt;&gt;<br>
&gt;&gt; Please is this possible just through the dial plan?<br>
&gt;&gt;<br>
&gt;&gt; Thanks for any help!<br>
&gt;&gt;<br>
&gt;&gt; _________________________________________________________________________<br>
&gt;&gt; Professional FreeSWITCH Consulting Services:<br>
&gt;&gt; <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
&gt;&gt; <a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
&gt;&gt;<br>
&gt;&gt; Official FreeSWITCH Sites<br>
&gt;&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;&gt; <a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.org</a><br>
&gt;&gt; <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
&gt;&gt;<br>
&gt;&gt; FreeSWITCH-users mailing list<br>
&gt;&gt; <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
&gt;&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
&gt;&gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
&gt;&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _________________________________________________________________________<br>
&gt; Professional FreeSWITCH Consulting Services:<br>
&gt; <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
&gt; <a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
&gt;<br>
&gt; Official FreeSWITCH Sites<br>
&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt; <a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.org</a><br>
&gt; <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
&gt;<br>
&gt; FreeSWITCH-users mailing list<br>
&gt; <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
&gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</div></div></blockquote></div><br></div></div>