twilio mute not working outging calls

502 views Asked by At

I am using

function call() {
    // get the phone number to connect the call to
    params = {"PhoneNumber": $("#number").val()};
    Twilio.Device.connect(params);
}

to make a call and

function mute() {
    connection.mute(true);
} 

to mute a call.

This works for incoming call but does not work for outgoing calls.

Can anyone assist?

1

There are 1 answers

0
Paolo Broccardo On

I just had the same issue working on outgoing calls.

What worked for me was naming the connection, and then muting that.

For example:

var connection = Twilio.Device.connect(params);

function mute() {
    connection.mute(true);
} 

Before when it wasn't named, it didn't work. Setting it to the connection variable got it working for me.

Hope that helps!