When I want to mute microphone I use mediastream which I get from
session.sessionDescriptionHandler.on('userMedia',
onUserMediaObtained.bind(this))
function onUserMediaObtained(stream) {
localMediaStream = stream
}
Session value is from agent.invite() method.
But when I get incoming call, in onInvite event handler:
agent.on('invite', onInvite(dispatch, store))
const onInvite = (dispatch, store) => session => {
if (session.sessionDescriptionHandler) {}
else { //always undefined here}
}
I try again attach event in onaccepted event handler
session.on('accepted', onAccepted(dispatch))
There is sessionDescriptionHandler object initialized, but I think it's too late, onUserMediaObtained isn't fired.