Closed raady07 closed 5 years ago
@raady07 I found this issue with asterisk. If possible/applicable to your situation, please try modifying src/tinyMEDIA/src/tmedia_session_jsep.js the way I did:
tmedia_session_jsep01.onIceCandidate = function (o_event, _This) {
var This = (tmedia_session_jsep01.mozThis || _This);
if (!This || !This.o_pc) {
tsk_utils_log_error("This/PeerConnection is null: unexpected");
return;
}
var iceState = (This.o_pc.iceGatheringState || This.o_pc.iceState);
tsk_utils_log_info("onIceCandidate = " + iceState);
if (!tmedia_session_jsep01.ice_timer) {
tmedia_session_jsep01.ice_timer = setTimeout(function() {
console.log("ICE timer...");
tmedia_session_jsep01.onIceGatheringCompleted(This);
tmedia_session_jsep01.ice_timer = null;
},2000);
};
if (iceState === "complete" || (o_event && !o_event.candidate)) {
tsk_utils_log_info("ICE GATHERING COMPLETED!");
tmedia_session_jsep01.onIceGatheringCompleted(This);
}
else if (This.o_pc.iceState === "failed") {
tsk_utils_log_error("Ice state is 'failed'");
This.o_mgr.callback(tmedia_session_events_e.GET_LO_FAILED, This.e_type);
}
}
it almost half the time
Instead of using google ICEservers, I created a local ICE server and the issue is resolved for the moment. I am not sure if it is a permanent solution, but the call connection is faster and getting connected in 3~4 seconds. I had been using this setup since 3 months and there were no problems till now.
I change the code setTimeout(..., 2000)
to setTimeout(..., 0)
. and It become faster@raady07. I don't know why it needs 2000ms ,so I change it to 0 ms, and it works.
Thank you
40 secs delay occurs because of delay in ICE gatherings, Reasons: Required ports might be blocked on your network or you might be under a VPN. In either of the cases, chrome waits till timeout (default is 40 secs). Decreasing timeout to 0 sec can be dangerous because you are not giving time for ICE negotiation and this might result in one-way audio issues.
I am trying to make calls from browser to a mobile by loggingin through demo page provided. I could login and make the call, but when I dail an audio call it remains 40 seconds in connecting status and then changes to ringing status to make the call. So it takes approx 45 seconds for me to get call to mobile after dailing from browser. Are there any special setting that i need to make the application faster? My internet speed is 7.8Mbps and I am checking this on Chrome browser.