Prerequisites
Before you begin, ensure you have an active phone number on your Wavix account. If you need to purchase one, see our guide on how to buy a phone number.Receive calls with Wavix and OpenAI Realtime API
Create OpenAI webhook
- Sign in to your OpenAI account at https://platform.openai.com.
- Go to your Organization settings.
- In the left menu, select Webhooks, then choose Create.
- Enter the URL where OpenAI should send events, select
realtime.call.incomingfrom the Event types dropdown, and optionally add a name.

OpenAI automatically generates a signing secret. Save this secret in a secure location, because you will not be able to view it again. OpenAI uses the signing secret to sign webhook requests. You can use it to verify that each request is from OpenAI and not from a third party.
Set up inbound call routing in Wavix
Wavix can route inbound calls to a SIP trunk on the platform, SIP URI, or forward them to a phone number. OpenAI requires calls to be routed to a SIP URI. Before setting up a Wavix number:- In your OpenAI account, go to General → Project.
- Copy the value from Project ID. You’ll need it to configure inbound call routing in Wavix.

- In Wavix, open Numbers & trunks → My numbers.
- Select your number by clicking the ⋯ menu → Edit number.
- Set the inbound call destination type to SIP URI, and enter the destination in the format of:
- Save your changes.
Managing calls using OpenAI Realtime API
You can answer, decline, monitor, refer, and hang up calls using the OpenAI API.To learn more, see the OpenAI Realtime SIP API documentation.
Answer a call
When OpenAI receives SIP traffic linked to your project, it triggers your webhook. The event type isrealtime.call.incoming, as shown in the example below:
call_id parameter is a unique identifier of the call in the OpenAI platform. Use it when answering the call.
To answer the call, use the OpenAI Accept call endpoint.
When answering the call, you should provide the required configuration, including instructions, voice, and other settings, for the Realtime API session.
$call_id: unique identifier of the call in OpenAI.$OPENAI_API_KEY: your OpenAI API Key.
Decline the call
To decline the call, use the OpenAI Reject call endpoint. You can optionally include a SIP response code to return to the caller.Transfer the call
Wavix supports using theSIP REFER command. To transfer a call, you need two Wavix numbers, one for an active call and one to receive the transferred call. Make sure inbound call routing is set up on the second number.
To transfer an active call, use the OpenAI Refer call endpoint. In the request, the target_uri parameter should contain the Wavix number.
Hang up the call
To hang up the call, use the OpenAI Hang up call endpoint. In the request, thecall_id parameter should contain the OpenAI unique call identifier.
Monitor call events
After you answer a call, open a WebSocket connection to the session to stream events and send realtime commands.call_id- unique identifier of the call in OpenAI. See OpenAI Webhooks and server-side controls for more information.
Troubleshooting
- If inbound calls aren’t reaching your OpenAI project, make sure Inbound call routing is set up correctly in Wavix.
- Make sure all phone numbers are in international E.164 format, e.g.
19085594899(US) or4408001218915(UK). Do not dial local formats like9085594899. Strip prefixes like0,00, or011if needed.