I am trying to make an outbound call with Twilio Voice SDK in HTML.
I am getting the following error when I instantiate Twilio.Call function
const device = new Device(token);
params = {
params: {
To: phone
}
};
const call = device.connect(params);
var callTemp = new Twilio.Call(call);
Error
Uncaught TypeError: Cannot read properties of undefined (reading 'info')
at Object.Call (twilio.min.js:1:26960)
at HTMLDivElement.eval (eval at <anonymous> (jquery.min.js:4:4994), <anonymous>:501:20)
at HTMLDivElement.dispatch (jquery.min.js:5:14129)
at v.handle (jquery.min.js:5:10866)
What is the correct way to instantiate the Twilio.Call?
You should not instantiate a
Twilio.Call
object yourself. The methoddevice.connect
returns a promise that resolves to aTwilio.Call
object.Or with async/await: