How outbound calling works
Place calls from your Linq numbers. Your voice platform sends each call to Linq over SIP, and Linq places it on the phone network.
Outbound calling is in early access. Contact Linq to turn it on for your numbers.
During early access, place a call only when a user asked for it: a call to that user, or a call to someone else on that user’s behalf. Don’t let your agent decide by itself to call someone (Consent and calling hours).
Your voice agent can place calls from your Linq numbers. Your platform sends each call to Linq over SIP. Linq checks your credentials and the caller ID, then places the call on the phone network.
Linq does:
- check your SIP credentials and the caller ID on every call
- place calls to numbers in the US and Canada
Linq doesn’t:
- transfer calls; call transfer isn’t available yet
- let you send a different caller ID (Caller ID)
- check consent or the time of day; that’s your responsibility (Consent and calling hours)
How a call goes out
Section titled “How a call goes out”- Your platform sends an INVITE to Linq’s SIP address over TLS. The
Request-URI holds the number you’re calling, and the
Fromheader holds your Linq number, both in E.164. - Linq challenges the INVITE with
407. Your platform sends it again with your SIP username and password. - Linq checks your credentials, that the caller ID is a Linq number on your account, that the destination is allowed, and that you’re within your account’s call rate and daily minutes.
- Linq places the call on the phone network, with your Linq number as the caller ID.
- If the phone network sends
180or183, Linq passes it back. When the person answers, Linq passes the200 OKback. YourACKgoes through Linq. - Audio flows directly between your platform and the phone network. Linq doesn’t change the SDP (the part of the INVITE and its answer that describes the audio), so the codec is negotiated end to end.
- Either side hangs up with a
BYE, which goes through Linq.
Linq stays in the signalling path for the whole call, as it does for inbound calls.
Where to send calls
Section titled “Where to send calls”Enter these values in your platform. On a hosted voice-agent platform, they go in its outbound SIP trunk settings; some consoles call this termination or an outbound trunk.
| Setting | Value |
|---|---|
| Host | Linq’s SIP host name. Contact Linq for it. |
| Port | 5061 |
| Transport | TLS (sips:) |
| Authentication | SIP digest, with the SIP username and password Linq gives you (Authentication) |
Caller ID (From user part) |
Your Linq number in E.164, for example +14155550100 |
| Number you’re calling (Request-URI user part) | E.164, for example +14155550142 |
| Codecs | At least one of PCMU, PCMA, G.722, AMR-WB or Opus. Offer G.722, AMR-WB or Opus for HD. |
| Media encryption | RTP or SRTP, as negotiated in SDP. OpenAI’s Live API requires SRTP (OpenAI’s Live API). |
The INVITE’s request line looks like this, where <linq-sip-host> is the host
name Linq gives you:
INVITE sips:+14155550142@<linq-sip-host>:5061 SIP/2.0OpenAI’s Live API
Section titled “OpenAI’s Live API”OpenAI’s Live API has no trunk settings page. You send the trunk settings in each request that places a call.
Place the call with POST https://api.openai.com/v1/live/sessions:
| Field | Value |
|---|---|
transport.type |
sip |
transport.destination |
The number you’re calling, in E.164. SIP URIs aren’t supported. |
transport.trunk.provider_url |
sips:<linq-sip-host>:5061, with no credentials, paths or parameters in the URI |
transport.trunk.auth |
{ "type": "digest", "username": "...", "password": "..." }, with the SIP username and password Linq gives you. OpenAI answers Linq’s 407 with them. |
transport.trunk.caller_number |
Your Linq number, in E.164 |
session.audio.format |
Leave it out. SIP negotiates the codec. |
{ "session": { "model": "gpt-live-1", "instructions": "Help the user schedule an appointment.", "audio": { "output": { "voice": "marin" } }, "delegation": { "type": "client" } }, "transport": { "type": "sip", "destination": "+14155550142", "trunk": { "provider_url": "sips:<linq-sip-host>:5061", "auth": { "type": "digest", "username": "<your-sip-username>", "password": "<your-sip-password>" }, "caller_number": "+14155550100" } }}OpenAI requires SRTP for the audio, with the keys exchanged in SDP (SDES-SRTP), and TLS for the signalling.
The reply holds the session’s ID in session.id. A 200 reply means OpenAI
started the call, not that anyone answered.
Watch the call on the sideband WebSocket,
wss://api.openai.com/v1/live/sessions/{session_id}/attach. Connect right
away: it replays only the last 3 seconds of events. The events to watch are
transport.ringing, transport.answered, transport.failed and
session.closed.
The model may stay silent until the other person speaks. To have your agent speak first, follow OpenAI’s guide, Greet before the caller speaks:
- Put the greeting instructions in a
developermessage insession.inputwhen you create the session. - Send the greeting instructions once on the sideband, in a
session.commentary.appendevent with a uniqueevent_idanddelegation_id: null.delegation_idis required, but it can benull.
OpenAI’s guide says to send that event after session.started. On an outbound
call, session.started arrives before the phone rings. In Linq’s test calls,
sending the event when transport.answered arrived made the agent speak as the
person picked up. OpenAI’s guide also says these instructions don’t guarantee
that the model speaks, and that it may paraphrase the greeting.
transport.answered also arrives when voicemail picks up; see
Voicemail.
Hang up with
POST https://api.openai.com/v1/live/sessions/{session_id}/hangup.
Hang up every call you no longer need, because a stuck call keeps your number
busy; see
One outbound call at a time per number.
Keep your OpenAI API key and your SIP password on your server. Never put them in an app or a web page.
OpenAI’s guide has the full request: Place an outbound call.
Transport and encryption
Section titled “Transport and encryption”Use TLS. Linq accepts your SIP credentials only over TLS, so calls sent without TLS aren’t accepted. Check Linq’s TLS certificate against the host name.
TLS encrypts the signalling between your platform and Linq. The audio flows between your platform and the phone network, using RTP or SRTP as negotiated in SDP; Linq forwards the SDP unchanged. Some platforms accept only SRTP: OpenAI’s Live API is one (OpenAI’s Live API).
Allow the phone network’s audio
Section titled “Allow the phone network’s audio”Accept audio from the phone network’s media addresses, and advertise a public address in your SDP. These are the same addresses as for inbound calls; see Allow Linq’s addresses.
What the person you call sees
Section titled “What the person you call sees”The call shows your Linq number as the caller ID, and you can’t send a different one; see Caller ID. The call also carries an attestation level, which the called party’s carrier uses to decide how to show it; see Attestation.
Events and call records
Section titled “Events and call records”The Voice API’s webhooks and call records cover inbound calls only. For outbound calls, use your SIP platform’s call logs and SIP replies.
Place your first outbound call
Section titled “Place your first outbound call”- Ask Linq to turn on outbound calling for your account. Say which numbers you’ll call from, and which numbers you’ll call while you test (Destinations). Linq gives you a SIP username and password.
- Make sure each number you call from is set up for voice (a SIP profile
assigned; see Assign numbers)
and published, and that your SIP credentials are from the same environment
as the number. A number that isn’t published fails with
2033, and an environment mismatch fails with2006, when you assign the SIP profile (API errors during setup). - In your platform, add an outbound SIP trunk with the values in Where to send calls.
- Allow the phone network’s audio.
- Have your agent call your own mobile phone from your Linq number.
You should see:
- Your mobile phone rings and shows your Linq number.
- When you answer, audio works in both directions.
Then have your agent call your mobile phone from one of your own Linq numbers
that isn’t published (assigning a SIP profile to it fails with 2033). Never
use a number that isn’t yours. Linq refuses the call, and your phone should
never ring; see
Caller ID.