Keep any SIP carrier you use today, then plug in your AI voice agent.
Reach markets with local service providers—our Ultra Elastic SIP trunks work worldwide.
Send HD sound to every call, everywhere.
One-click links to VAPI™, ReTell™, and other voice-AI partners.
Attach cloud apps, carriers, or on-premise SIP gear in one step.
Use simple CXML documents to provide Cloudonix as straight forward routing scenario. Be it provided via a Container Application or as a remote webhook, routing calls is as simple as it gets with Cloudonix.
+12025551234
CXML
?
const httpClient = require('https');
/* ReTell API Config */
const retell_token = "xxxxxx";
const retell_agent = "yyyyyyy";
async function httpsRequest(url, method = 'GET', headers = {}, body = null) {
let response;
if (method === 'POST') {
response = await httpClient.post(url, { headers, body });
} else if (method === 'PUT') {
response = await httpClient.put(url, { headers, body });
} else if (method === 'DELETE') {
response = await httpClient.delete(url, { headers });
} else if (method === 'GET') {
response = await httpClient.get(url, { headers });
} else {
throw new Error(`Unsupported method: ${method}`);
}
const status = response.status || response.statusCode || 0;
const ok = status >= 200 && status < 300;
const responseBody = typeof response.body === 'string'
? response.body
: JSON.stringify(response.body || {});
return {
status,
ok,
body: responseBody,
headers: response.headers || {}
};
}
async function generateReTellCall(ev) {
const url = 'https://api.retellai.com/v2/register-phone-call';
// SIP headers from Cloudonix
const inboundSipHeaders = JSON.parse(ev.body).SessionData.profile['trunk-sip-headers'];
const retellDynamicVariables = {
cloudonix_callerid: ev.parameters.From,
cloudonix_destination: ev.parameters.To,
cloudonix_token: ev.parameters.Session,
cloudonix_domain: ev.parameters.Domain
};
for (const key in inboundSipHeaders) {
retellDynamicVariables[key] = inboundSipHeaders[key];
}
const payload = {
agent_id: retell_agent,
from_number: ev.parameters.From,
to_number: ev.parameters.To,
retell_llm_dynamic_variables: retellDynamicVariables
};
console.log(`Payload: ${JSON.stringify(payload)}`);
const headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + retell_token
};
try {
const response = await httpsRequest(url, 'POST', headers, JSON.stringify(payload));
if (!response.ok) {
throw new Error(`ReTell call creation failed: ${response.status} - ${response.body}`);
}
const data = JSON.parse(response.body);
console.log(`Success: ${data.call_id}`);
return data.call_id;
} catch (error) {
console.error(`Error:`, error.message || error);
await deleteSession(ev.parameters.Domain, ev.parameters.Session);
return false;
}
}
function dialToRetellScript(ev, retellCallId) {
let result = ``;
result += ` ${retellCallId} `;
result += ``;
return result;
}
function response(content) {
let result = ``;
result += `${content} `;
return result;
}
exports.handler = async (ev) => {
let retellCallId = await generateReTellCall(ev);
let cxmlResponse = dialToRetellScript(ev, retellCallId);
return response(cxmlResponse);
};
Learn about Cloudonix’s agentic voice trunking.
It is similar, but not exactly. Platforms such as VAPI™, ReTell™, LiveKit™ and others, enable their users to directly initiate calls to their voice agents – a direct SIP connection. However, each platform is different and requires a different SIP methodology. Cloudonix provides a single black-box experience to all of these, making them easily accessible – even without creating a SIP trunk to the agent voice platform.
Connecting your carrier to Cloudonix is a relatively simpler process. Unlike other platforms, Cloudonix takes a “black-box” approach to SIP Trunking, taking much of the “In-Depth Technical Know-How” and hides it, making the trunking process simple and quick.
Click here to learn more about Cloudonix Voice Trunk Management.
Yes, you can find our vendor, service and providers compatibility list here.
To connect to various Voice Agent services, you don’t need a full SIP trunk, this can be performed using our <DIAL><Service>
CXML verbs – read more here.
Sure, just join our community Discord server and talk to our staff directly.