This is a classic case of using the wrong tool for the job. Let the dialplan bridge app do the work for you. Only use Lua where you really need it. There is rarely a good reason to bridge from within a dialplan script.<br>
<br>-MC<br><br><div class="gmail_quote">On Tue, May 8, 2012 at 4:45 AM, Anita Hall <span dir="ltr"><<a href="mailto:anita.hall@simmortel.com" target="_blank">anita.hall@simmortel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi <br><br>I am following FreeSWITCH cookbook Chapter 1, Page 15: Ringing multiple endpoints sequentially. <br><br>I am also using mod_lua to do a simple app that does the bridging. <br><br>The problem scenario is as follows: The first endpoint rings. It is not answered. The second endpoint starts ringing. It is answered but the call is immediately disconnected. And then the first endpoint starts ringing again!<br>
<br>Probably, the reason why the first endpoint starts ringing again is a repeat try in bridge application. Is there anyway to disable it ?<br><br>Here is my dialplan snippet<br><br><action application="lua" data="bridge.lua 1 8860133622 | 9711450555"/><br>
<br>And here is bridge.lua<br><br># cat scripts/bridge.lua<br><br>-- arguments from dialplan<br>setAnswer = argv[1]<br>num1 = argv[2]<br>limiter1 = argv[3]<br>num2 = argv[4]<br><br><br>
session:answer()<br>
welcome= "welcome.wav"<br>session:streamFile(welcome)<br>freeswitch.consoleLog("INFO","Prompt file is '" .. welcome .. "'\n")<br><br>freeswitch.consoleLog("INFO","Arguments '" .. argv[1] .. " " .. argv[2] .. " " .. argv[3] .. " " .. argv[4] .. "'\n")<br>
globalChanVars = "{ignore_early_media=true,originate_continue_on_timeout=true,call_timout=60,monitor_early_media_fail=user_busy:2:480+620!destination_out_of_order:2:1776.7}"<br><br>chan1 = "[leg_timeout=15]" .. "freetdm/1/a/" .. num1<br>
chan2 = "[leg_timeout=55]" .. "freetdm/1/a/" .. num2<br><br>-- global channel variables are applicable to all channels in the session<br>newSession = freeswitch.Session(globalChanVars .. chan1 .. limiter1 .. chan2)<br>
<br>-- bridge new Session to the current session<br>freeswitch.bridge(session, newSession)<br><br><br><br>Much thanks!<br><br><br clear="all">regards,<br>Anita<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>
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>