Skip to main content

RingCentralCallControl returning Uncaught TypeError: Object prototype may only be an Object or null: undefined

  • March 17, 2025
  • 1 reply
  • 54 views

My implementation: 
import RingCentral from "@rc-ex/core";
import { RingCentralCallControl } from "ringcentral-call-control";

const ringcentralSdk = new RingCentral({

server: "",

clientId: "",

clientSecret: "",

});


 

useEffect(() => {

if (!ringcentralSdk) {

console.error("ringcentralSdk is undefined");

return;

}

 

if (!webPhone) {

console.error("webPhone is undefined");

return;

}

 

if (ringcentralSdk && webPhone) {

const rcCall = new RingCentralCallControl({

sdk: ringcentralSdk,

});

 

rcCall.on("new", (newSession) => {

console.log(newSession, "rc call session");

});

 

// const activeSessions = rcCall.sessions;

 

// activeSessions.forEach((session) => {

// session.on("accepted", () => {

// console.log("Call accepted:", session);

// });

 

// session.on("progress", () => {

// console.log("Call in progress:", session);

// });

 

// session.on("established", () => {

// console.log("Call established:", session);

// });

 

// session.on("ringing", () => {

// toast.success("Call ringing...");

// });

 

// session.on("progress", () => {

// toast.success("Call in progress...");

// });

 

// session.on("terminated", () => {

// console.log("Call terminated:", session);

// // Handle call termination

// });

// });

 

// console.log(rcCall, "@@rcCall@@");

}

}, [ringcentralSdk, webPhone]);
RingCentralCallControl was supposed to run after initializing ringcentralSdk. However, RingCentralCallControl throws this error Uncaught TypeError: Object prototype may only be an Object or null: undefined
    at setPrototypeOf (<anonymous>)
on mounting the page without initializing 

1 reply

Embbnux
Employee
Forum|alt.badge.img+1
  • Employee
  • March 18, 2025

Hi ​@Becky for call control SDK, you need to use it with RC JS SDK “@ringcentral/sdk”. 
https://github.com/ringcentral/ringcentral-js