Blog: Product

xAI voice agents and G.722 wideband, now supported

By the TelecomsXChange engineering team ·

Two additions: calls to an xAI voice agent over SIP and TLS, as a destination like any other, and G.722 wideband audio in the analysis pipeline, the HD codec those agents and most modern endpoints prefer. Agent calls are recorded in stereo, transcribed and scored.

Voice AI destinations

A voice agent as a destination

xAI, now part of SpaceX, exposes its voice agents as SIP endpoints: you register a number with them, point your SIP provider at their host, and the agent answers. Open Voice Shield is that SIP provider. A destination of kind Voice AI holds the agent's host, the TLS port and the agent's number, and from then on the platform treats the agent the way it treats any carrier route.

You can then do three things with it. You can dial the agent from the web dialer and hear it, with the transcript and verdict a minute after hangup. You can make it the target of an automation rule, so a flagged caller's next call is answered by the agent instead of your customer. And you can put the agent in front of any traffic you route through the platform, with every call recorded and analyzed.

The Add a destination dialog in the customer portal with kind set to Voice AI: agent SIP host sip.voice.x.ai, port 5061, transport TLS, the agent ID +15145550123 and the label xAI voice agent.
A Voice AI destination: the agent's host, TLS on 5061, and the agent's number as the Agent ID. The port and transport default to what xAI expects.

How the call travels

  1. The proxy opens a TLS connection to the agent's host on port 5061 and verifies the certificate. xAI only accepts TLS on that port. The defaults in the dialog match.
  2. The INVITE carries the agent's number as the request URI, with the leading plus that xAI's routing expects. Type the number with or without it. The platform adds it.
  3. If the agent challenges with SIP digest authentication, the proxy answers with the credentials configured for the deployment. If you registered the platform's address in xAI's IP allow-list instead, there is no challenge.
  4. Media is plain RTP through the platform's relay, in G.711 or G.722, whichever the agent picks. Both legs are recorded.
  5. On hangup the recording is decoded, transcribed and analyzed, and the call record fills in: recording, transcript, verdict, SIP ladder, per-leg quality.

The dialog defaults to TLS on 5061 because that is the only combination that works with xAI. A common mistake while we were testing was pointing the destination at an IP address on 5060, where there is no TLS listener, so the call never connects. Use the host name and the TLS port. The other common mistake is a digest realm that does not match what the agent sends, which comes back as an authentication error. The credentials on both sides have to agree on user, realm and password.

Wideband audio

G.722, decoded

G.722 is the codec behind HD voice. It carries 16 kHz audio at 64 kbit/s, twice the bandwidth of G.711, so speech has the sibilants and the room that a telephone call normally loses. Desk phones, softphones, SBCs and voice agents offer it first when the far end lets them. Our first call to an xAI agent was answered in G.722, and while the call was recorded, the analysis stopped with an unsupported codec: the pipeline only knew how to decode G.711.

It now decodes G.722 with the ITU-T reference implementation. One quirk: G.722's RTP clock is 8000 Hz although the audio is sampled at 16 kHz, a compatibility detail kept in the RTP profile since the 1990s. The decoder accounts for it, so timing, silence gaps and the alignment between the two legs are correct. A call where one leg is G.711 and the other G.722 is handled leg by leg and shown as mixed on the record.

What you see
The call record shows the codec, G711 µ-law, G711 A-law, G722 or mixed. Transcript, verdict, red flags and estimated MOS per leg are produced as for any call.
What you hear
Telephone quality, for now. The G.722 leg is decoded at 16 kHz and then folded into the pipeline's 8 kHz stereo recording. Keeping the wideband copy for playback and export is on the list. It changes storage, not analysis.
What it means for fraud analysis
Calls that land on modern endpoints, agents and HD trunks are analyzed like the rest, and a route that negotiates G.722 no longer shows up as a gap in your records.

Setup

Five minutes in the portal

  1. On the xAI side, register a Direct SIP number for your agent, and either add the platform's address to the allow-list or set the digest username and password you were given for the deployment.
  2. Under Network, add a destination of kind Voice AI: host sip.voice.x.ai, port 5061, transport TLS, and the agent's number as the Agent ID.
  3. Open the Web Dialer, pick that destination, dial the agent's number, and talk to it. Hang up and open the call record: codec, transcript, verdict.
  4. Optionally, under Automation, point a divert rule at the destination so flagged callers meet the agent instead of your customers.

Nothing else changes for the rest of your traffic. G.722 support needs no configuration. Any call that negotiates it is decoded from now on.

Scope

What is and is not covered

Summary

The takeaway

An xAI voice agent is now a destination you can dial, divert to and route through, with every call recorded and analyzed. And a call answered in G.722, which is most calls to an agent and a growing share of calls everywhere, is analyzed like any other.

Related: divert known fraud callers to an AI voice agent, the web dialer, or start free with $5 credit.

Questions

Frequently asked questions

How does Open Voice Shield connect to an xAI voice agent?

You add a Voice AI destination under Network with the agent's SIP host, TLS on port 5061 and the agent's number. The proxy opens a TLS connection to sip.voice.x.ai, verifies the certificate, sends the agent's number as the request URI with a leading plus, and answers the digest challenge with the credentials configured for the deployment. Media is plain RTP in G.711 or G.722, whichever the agent picks.

Does the call to a voice agent get recorded and analyzed?

Yes. A Voice AI destination is a destination like any other: the call is relayed and recorded in stereo, transcribed, scored, and its SIP ladder and per-leg quality are kept. It is billed per second and counts against your ports while it is up.

What is G.722 and why did it matter?

G.722 is the wideband voice codec behind HD voice: 16 kHz audio at 64 kbit/s, RTP payload type 9. Modern SIP endpoints and voice agents prefer it. Until now a call answered in G.722 was recorded but could not be analyzed, because the pipeline only decoded G.711. It now decodes G.722 and treats the call like any other.

What happens on a call where one leg is G.711 and the other is G.722?

Each leg is decoded with its own codec and the two are folded into the usual stereo recording, caller on the left and callee on the right. The call record shows the codec as mixed. Transcript, verdict and estimated MOS are produced as normal.

Is the wideband audio kept at full quality?

Not yet. The G.722 leg is decoded at 16 kHz and then folded into the pipeline's 8 kHz recording, so playback in the portal is telephone quality. Transcription and analysis are unaffected. Keeping the wideband copy is on the list.