<font face="verdana,sans-serif">Post your lua script here</font><div><font face="verdana,sans-serif"><br></font></div><div><font face="verdana,sans-serif">before the bridge(How to set the UUID for intercept) and intercept part </font></div>
<div><font face="verdana,sans-serif"><br></font></div><div><font face="verdana,sans-serif">---</font></div><div><font face="verdana,sans-serif"><br></font></div><div><font face="verdana,sans-serif">I use this way and it always works </font><font face="verdana, sans-serif">session:execute("set","intercept_unbridged_only=true")</font></div>
<div><font face="verdana,sans-serif"><br></font></div><div><div><font face="verdana, sans-serif">Lloyd</font></div>
<br><br><div class="gmail_quote">On Sun, Aug 4, 2013 at 6:49 AM, <span dir="ltr"><<a href="mailto:cmrienzo@gmail.com" target="_blank">cmrienzo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="auto"><div>That channel variable was fetched in the routing state before the lua application was executed. You can either transfer to a new extension to execute the intercept or execute the intercept in the lua script. </div>
<div><br></div><div>Chris</div><div><div class="h5"><div><br></div><div><br>On Aug 3, 2013, at 11:51 PM, Frank Busalacchi Jr <<a href="mailto:frankjr@mcpeekdodge.com" target="_blank">frankjr@mcpeekdodge.com</a>> wrote:<br>
<br></div></div></div><blockquote type="cite"><div>
<div><div><div class="h5">
<p class="MsoNormal">Hi everyone! First and foremost, thanks for a great piece of software, and all the time you guys still put into this program day in and day out. Thank you!<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I'm having difficulty implementing an "intercept" system, and I'm thinking that I have to be "conceptually" misunderstanding something. Towards those ends, I'm hoping someone can get me back on track, I’m sick of banging my head on the
wall to try to make this work.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">So here is my scenario:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">1. A call (Call A) comes into the server from my voip provider on a DID.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">2. My XML dialplan transfers the call to an extension in the XML dialplan of 1111.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">3. My XML dialplan recognizes 1111 as a local extension, and executes a LUA script to handle the actual bridging of Call A to the appropriate devices. I use the LUA script because I do some logic to decide whether to ring just the user's
SIP phone, the user's cell phone, or a combination of both simultaneously. Bottom line is that the LUA script does something like this after building the originate string in dialString:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">session2 = freeswitch.Session(dialString);<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"> if session2:answered() == true then<u></u><u></u></p>
<p class="MsoNormal"> freeswitch.bridge(session,session2);<u></u><u></u></p>
<p class="MsoNormal"> return true;<u></u><u></u></p>
<p class="MsoNormal"> else<u></u><u></u></p>
<p class="MsoNormal"> return false;<u></u><u></u></p>
<p class="MsoNormal"> end<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">---All of the above works as expected ---<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">My issue is that when the LUA script starts ringing the sip phone registered as 1111, I want to 'intercept' that call from a different extension. So here is what I do:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">1. Extension 1112 hears that his co-worker's extension 1111 is ringing, and wants to answer it. He dials **1111<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">2. My XML dialplan recognizes the request to pickup/intercept the call ringing at 1111, and calls a LUA script to figure out the uuid of the ringing phone.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">3. The LUA script sets a channel variable with the UUID it choose as the appropriate candidate to intercept, and exits.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">4. The XML dialplan resumes control, and does a <action application="intercept" data="${intercept-uuid}"/> .<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">5. The calls aren't intercepted/bridged.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">A pastebin of the log is here: <a href="http://pastebin.freeswitch.org/21267" target="_blank">
http://pastebin.freeswitch.org/21267</a> <u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">What am I missing conceptually here?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks,<u></u><u></u></p>
<p class="MsoNormal">Frank<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><b><span style="font-family:"Arial Black","sans-serif"">Frank Busalacchi Jr
</span></b><b><span style="font-family:"Arial","sans-serif""><u></u><u></u></span></b></p>
<p class="MsoNormal"><b><span style="font-family:"Arial","sans-serif"">President</span></b><u></u><u></u></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Direct <a href="tel:%28714%29%20254-2612" value="+17142542612" target="_blank">(714) 254-2612</a></span></b><span style="font-family:"Times New Roman","serif""><u></u><u></u></span></p>
</div></div><p class="MsoNormal"><image001.jpg><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></blockquote><blockquote type="cite"><div><span>_________________________________________________________________________</span><br><span>Professional FreeSWITCH Consulting Services:</span><br><span><a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a></span><br>
<span><a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a></span><br><span></span><br><span>FreeSWITCH-powered IP PBX: The CudaTel Communication Server</span><br><span><a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a></span><br>
<span></span><br><span>Official FreeSWITCH Sites</span><br><span><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a></span><br><span><a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a></span><br>
<span><a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a></span><br><span></span><br><span>FreeSWITCH-users mailing list</span><br><span><a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a></span><br>
<span><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a></span><br><span>UNSUBSCRIBE:http://<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">lists.freeswitch.org/mailman/options/freeswitch-users</a></span><br>
<span><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a></span><br></div></blockquote></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>