<div dir="ltr"><span style="font-size:13px">Hi All, </span><div style="font-size:13px"><br></div><div style="font-size:13px">I&#39;m currently using a browser (chrome) to make calls via webrtc to freeswitch (1.5.15b+git~20141219T193610Z~35cb0ad286~64bit).  However, I am experiencing delays when hearing our initial prompting message.  I&#39;d like to hook onto some event that lets me know that all of session.streamFile() will be heard and not cut off.  </div><div style="font-size:13px"><br></div><div style="font-size:13px">We have a dial plan,  and in that dial plan (js file) we do this sequence of events... (psuedo code)</div><div style="font-size:13px"><br></div><div style="font-size:13px">if(session.ready())</div><div style="font-size:13px">   session.answer()</div><div style="font-size:13px">   ...some reading of headers...</div><div style="font-size:13px">   session.streamFile(&quot;Our welcome prompt&quot;, func return true)</div><div style="font-size:13px"><br></div><div style="font-size:13px">On the client side I can watch the logs and notice that I hear media as soon as this log comes through:</div><div style="font-size:13px"><br></div><div style="font-size:13px">| jssip.rtcsession.rtcmediahandler | ICE connection state changed to &quot;connected&quot;<br></div><div style="font-size:13px"><br></div><div style="font-size:13px">However, this can be a second or two behind the streamFile call in the dial-plan.</div><div style="font-size:13px"><br></div><div style="font-size:13px">What I would like to be able to do is hook into the ICE state change in the dial-plan file and wait until I get it to start streaming the file.</div><div style="font-size:13px"><br></div><div style="font-size:13px">I have tried playing around with some of the methods found here: <a href="https://wiki.freeswitch.org/wiki/Session" target="_blank">https://wiki.freeswitch.org/wiki/Session</a>, namely session.mediaReady, session.waitForMedia, and checking the session.state to see if any of them change when I get the ice state message client side to no avail.</div><div style="font-size:13px"><br></div><div style="font-size:13px">Is there a way to accomplish this  (Listening for ICE state changes in a dial plan)?  </div></div>