[Freeswitch-users] Sound delays when using WebRTC

Robert Smallwood rdsmallwood928 at gmail.com
Thu Jan 15 23:36:53 MSK 2015

Hi All,

I'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'd like
to hook onto some event that lets me know that all of session.streamFile()
will be heard and not cut off.

We have a dial plan,  and in that dial plan (js file) we do this sequence
of events... (psuedo code)

   ...some reading of headers...
   session.streamFile("Our welcome prompt", func return true)

On the client side I can watch the logs and notice that I hear media as
soon as this log comes through:

| jssip.rtcsession.rtcmediahandler | ICE connection state changed to

However, this can be a second or two behind the streamFile call in the

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.

I have tried playing around with some of the methods found here:
https://wiki.freeswitch.org/wiki/Session, 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.

Is there a way to accomplish this  (Listening for ICE state changes in a
dial plan)?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20150115/c6f94d8f/attachment.html 

Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list