You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried this code in Android and iOS devices (hybrid apps with ionic), as well as webclients (chrome and safari). It works good in every device but iOS.
I've chased it and I found what was happening. The issue was the toggleMuteAudio function in the JsSIP library.
In iOS devices, the value of sender.track is undefined. It seems to be one level up, so accessing sender.track should be sender. I thought that it may be an error in the ontrack event, but having it working in Android confuses me.
This is the solution that works for me:
key: "_toggleMuteAudio",
value: function _toggleMuteAudio(mute) {
var senders = this._connection.getSenders().filter(function (sender) {
var senderTrack = (sender.track) ? sender.track : sender;
return senderTrack && senderTrack.kind === 'audio';
});
var _iterator8 = _createForOfIteratorHelper(senders),
_step8;
try {
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
var sender = _step8.value;
var senderTrack = (sender.track) ? sender.track : sender;
senderTrack.enabled = !mute;
}
} catch (err) {
_iterator8.e(err);
} finally {
_iterator8.f();
}
}
Please, note that the only fix was to add the ternary operation.
Hi,
first of all, thank you guys for your work here.
I've found an issue an its solution, and I would like to discuss it, just in case it is a matter of configuration.
The issue is regarding the mute and unmute function.
When I open a new SIP session, and the session is established, I have the need to mute/unmute the microphone, so I call the mute/unmute functions.
I have an API that uses the JsSIP:
The variable this.session contains the rtcsession previously stored during the negotiation
I tried this code in Android and iOS devices (hybrid apps with ionic), as well as webclients (chrome and safari). It works good in every device but iOS.
I've chased it and I found what was happening. The issue was the toggleMuteAudio function in the JsSIP library.
In iOS devices, the value of sender.track is undefined. It seems to be one level up, so accessing sender.track should be sender. I thought that it may be an error in the ontrack event, but having it working in Android confuses me.
This is the solution that works for me:
Please, note that the only fix was to add the ternary operation.
And this is the ontrack function:
I'd like you guys to shed some light here, if possible.
Thank you and cheers,
Borja.
The text was updated successfully, but these errors were encountered: