AI Features 6 min read

Connecting xAI to Your Phone Number

Click2Call has a built-in xAI connection profile, so the routing is one dropdown. The work is at the xAI end: register a bring-your-own-trunk number, host a webhook, and open a WebSocket to answer each call.

Last reviewed: September 2026

Before you start: this one needs code

xAI’s SIP integration is a developer integration. You register the phone number through their API, host a webhook that receives the realtime.call.incoming event, and open a WebSocket to answer each call. If you want an agent you configure in a dashboard with no server of your own, ElevenLabs, Retell or Synthflow are the simpler choices.

At a glance

Mandatory Click2Call field
None — just pick the connection type
Where Click2Call sends calls
sip:sip.voice.x.ai:5061;transport=tls
Authentication
IP allowlist (allowed_addresses) on the xAI side — add 103.212.52.19
Number format
+E.164, set automatically
Code required
Yes — a webhook plus a WebSocket connection
Provider documentation
xAI SIP phone calls

Connecting xAI, Step by Step

1

Register a Direct SIP phone number with xAI

Using the xAI API, create a Direct SIP phone number with origin set to byo_trunk — the number is yours, arriving over your own trunk. Include the webhook URL that should receive incoming-call events.

xAI returns a signing secret once and never again. Store it before you close the response; you need it to verify webhook signatures.

2

Choose an authentication method

xAI accepts either an IP allowlist, via allowed_addresses, or SIP digest credentials.

Click2Call cannot present a username and password on an outbound INVITE, so the provider has to trust us by IP allowlist. Allowlist 103.212.52.19 — that is the address our switch sends INVITEs from. If a provider will only accept authenticated INVITEs, the connection has to run the other way round — the provider registers to Click2Call as the number, which is the generic method in connecting an AI voice agent.

3

Handle the incoming-call webhook

When a call arrives, xAI posts a realtime.call.incoming event to your webhook. Verify the signature with your signing secret, then read the call_id from the payload.

4

Open a WebSocket to answer

Connect to wss://api.x.ai/v1/realtime with the call_id and your API key. Send session.update to configure the agent for this call, then response.create when it should start speaking.

5

Create the profile in Click2Call

In the Click2Call portal open Voice → Profiles and set Connection Type to xAI.

There are no extra fields. The Inbound SIP URI Route line already shows sip:sip.voice.x.ai:5061;transport=tls — note that xAI uses TLS on 5061 rather than plain TCP on 5060 — and the number format is set to +E.164 automatically.

The Click2Call profile settings with Connection Type set to xAI, showing the pre-configured Inbound SIP URI Route sip:sip.voice.x.ai:5061;transport=tls.
6

Assign your number, then check the time zone

Open Voice → Line Manager and set the Profile column for your number to the profile you just created.

The Default profile applies to every line with no profile assigned, and new numbers land on it automatically — a number left on Default will ignore everything you just configured. While you are in the profile, set the Time Zone to where the business operates: business hours, after-hours routing and queue schedules all read it.

7

Test the call

Ring the number from a mobile. Your webhook should receive the incoming-call event, and the agent answers once your WebSocket session is established.

Troubleshooting

The provider replies 407 Proxy Authentication Required

The provider is challenging our INVITE for a username and password, which means our signalling address is not on their allowlist. Click2Call cannot answer that challenge on an outbound call, so the fix is always at the provider end — allowlist 103.212.52.19 rather than issuing credentials. While this is happening, callers hear “the number you have called is not available from this service”.

The phone rings but nothing answers

Almost always the webhook. Either the Direct SIP number was registered without a webhook URL, the endpoint is not reachable from the internet, or it receives the event but never opens the WebSocket. Check your endpoint logs for a realtime.call.incoming event.

Webhook signature verification fails

The signing secret is only returned when the number is created. If it was not stored, register the number again to get a fresh one.

xAI rejects the call before it rings

The allowed_addresses list does not include the address Click2Call is signalling from. Ask support for the current addresses.

Calls go to Click2Call voicemail instead

The number is still on the Default profile rather than the provider profile, so the call never leaves for the provider at all. Check the Profile column in Line Manager.

Frequently Asked Questions

Do I need to write code?

Yes — a webhook and a WebSocket. Same shape as OpenAI. For a dashboard-only agent, use ElevenLabs, Retell or Synthflow.

What does byo_trunk mean?

That the number is yours and arrives over your own SIP trunk rather than being provisioned by xAI. Provisioning xAI numbers through the API is not supported, so this is how an Australian number reaches a Grok voice agent.

Why port 5061 and TLS?

xAI terminates SIP over TLS. The built-in profile already uses sip:sip.voice.x.ai:5061;transport=tls, so there is nothing to change.

Are calls still recorded and transcribed?

Yes, provided Recording Enabled is ticked on the profile. Recording, transcription, summaries and sentiment all work as normal on the Click2Call side, stored in Australia and New Zealand. See AI voice tools.

Can I use my existing business number?

Yes — port it across first, then assign it to the profile. Local and mobile numbers typically port in 5 to 10 business days.

Still need help?

Our Australian support team is available to assist you.