in a conference how to mute my microphone, all those added to the conference are muted by sip js

42 Views Asked by At

`function MuteSession(lineNum){ var lineObj = FindLineByNumber(lineNum); if(lineObj == null || lineObj.SipSession == null) return;

$("#line-"+ lineNum +"-btn-Unmute").show();
$("#line-"+ lineNum +"-btn-Mute").hide();

var session = lineObj.SipSession;
var pc = session.sessionDescriptionHandler.peerConnection;
pc.getSenders().forEach(function (RTCRtpSender) {
    if(RTCRtpSender.track && RTCRtpSender.track.kind == "audio") {
        if(RTCRtpSender.track.IsMixedTrack == true){
            if(session.data.AudioSourceTrack && session.data.AudioSourceTrack.kind == "audio"){
                console.log(session.data)
                console.log("Muting Mixed Audio Track : "+ session.data.AudioSourceTrack.label);
                session.data.AudioSourceTrack.enabled = false;

            }
        }
        console.log("Muting Audio Track : "+ RTCRtpSender.track.label);
        RTCRtpSender.track.enabled = false;
    }
});

console.log()

if(!session.data.mute) session.data.mute = [];
session.data.mute.push({ event: "mute", eventTime: utcDateNow() });
session.data.ismute = true;

$("#line-" + lineNum + "-msg").html(lang.call_on_mute);

updateLineScroll(lineNum);

// Custom Web hook
if(typeof web_hook_on_modify !== 'undefined') web_hook_on_modify("mute", session);

}`

I want only my microphone to be muted, but here all calls added to the conference are muted along with me

0

There are 0 best solutions below