Sometimes it happened for me when session2 was not yet ready, and I fixed this by adding a small workaround: &quot;session:sleep(500);&quot;<div>Please see below, and reply back if it works for you.</div><div><br></div><div>
<span style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">--------------------</span><br style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">session:answer()</span><br style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">session2 = freeswitch.Session(callstring)</span><br style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br><b><font color="#ff0000">session:sleep(500);</font></b><br><br style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">if (session2:ready()) then</span><br style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">   freeswitch.bridge(session, session2)</span><br style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">end</span><br style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">--------------------</span></div>
<div><font face="arial, sans-serif"><br></font><br><div class="gmail_quote">2011/12/28 dma <span dir="ltr">&lt;<a href="mailto:mays.david@gmail.com">mays.david@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Guys,<br>
<br>
Any idea on this problem?<br>
<br>
Regards,<br>
D.Ma<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://freeswitch-users.2379917.n2.nabble.com/Error-Channels-not-ready-when-bridge-call-in-Lua-tp7112050p7134642.html" target="_blank">http://freeswitch-users.2379917.n2.nabble.com/Error-Channels-not-ready-when-bridge-call-in-Lua-tp7112050p7134642.html</a><br>

</font><div><div></div><div class="h5">Sent from the freeswitch-users mailing list archive at Nabble.com.<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>
</div></div></blockquote></div><br></div>