What are you trying to accomplish with this script? Why are you creating a new session right in the middle of handling an existing session? I am curious to know what problem you are attempting to solve.<div><br></div><div>
-MC<br><br><div class="gmail_quote">On Mon, Apr 18, 2011 at 5:35 AM, Mohammed Habib <span dir="ltr"><<a href="mailto:habib@alexcoder.com">habib@alexcoder.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="ltr"><div class="gmail_quote"><div><div><div dir="ltr">I need help getting events from originated session.<br><div class="gmail_quote"><div dir="ltr"><br>This is my lua script:<br><br>function onInput_MainSession(s, type, obj)<br>
-- This one is working fine.<br>
freeswitch.consoleLog("info", "Callback with type " .. type .. "\n");<br>
end<br><br>function onInput_NewSession(s, type, obj)<br> -- This one is never called.<br> freeswitch.consoleLog("info", "Callback with type " .. type .. "\n");<br>end<br><br>session:answer();<br>
session:setInputCallback("onInput_MainSession");<br>session:sleep(200);<br>session:execute("detect_speech", "unimrcp testgrammer trestgrammer");<br><br>newsession = freeswitch.Session("user/1002");<br>
newsession:setInputCallback("onInput_NewSession");<br>newsession:sleep(200);<br>
newsession:execute("detect_speech", "unimrcp testgrammer trestgrammer");<br><br>while ((session:ready() == true) ) and (newsession:ready() == true) do<br> -- Loop<br> sleep(200);<br>end<br><br>I am unable to capture any of the new session events or dtmf.<br>
<br>Please help.<br><br>Thank you,<br>Mohammed Habib<br></div>
</div><br></div>
</div></div></div><br></div>
<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>