The easiest way is to forget about the system IVR and let it be as such for prompts IVR.
Then create a user extension (name it e.g. AI IVR) and build your app (device) and assign the device to that user extension. Promote the user extension’s number so customers can dial that number directly instead of dialing the IVR.
If the above solution is not the logic you expect, then choose 1 of the following options:
- Set the IVR with a prompt e.g. press 1 to connect to our virtual agent etc. And set the key 1 to route the call to the user extension with that “device”
- Implement and subscribe for the IVR telephony session event notifications and when you detect an incoming call to that IVR, forward the call to the user extension with that “device”. This solution is complicated and requires the app to be authenticated by the main super admin user (normally the user extension 101). Check this article to learn more about the telephony session even notification.
Thanks a lot. I have managed to connect the call with open AI. but having a new issue now. I am hearing a Gittery noise. the vocie is not hearable. this might be due to audio format issue. I am using “g711_ulaw”. I am sure that realtime api can handle this format. but does ringcentral handle this format?
openAIWs.on("open", () => {
console.log(`OpenAI WebSocket connected for call ${activeCall.id}`);
// Send session update to configure the call
setTimeout(() => {
try {
const sessionUpdate = {
type: "session.update",
session: {
turn_detection: { type: "server_vad" },
input_audio_format: "g711_ulaw",
output_audio_format: "g711_ulaw",
voice: OPENAI_VOICE,
instructions: CALL_PROMPT,
modalities: ["text", "audio"],
temperature: 0.7,
},
};
console.log("Sending session update to OpenAI");
openAIWs.send(JSON.stringify(sessionUpdate));
} catch (error) {
console.error("Error sending session update:", error);
}
}, 250);
});