---
title: How outbound calling works | API Docs
description: Place calls from your Linq numbers. Your voice platform sends each call to Linq over SIP, and Linq places it on the phone network.
---

**Early access**

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](/channel/voice/guides/outbound-calling/limits-and-fraud-controls#consent-and-calling-hours/index.md)).

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.

**What Linq does and doesn't do on outbound calls**

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](/channel/voice/guides/outbound-calling/caller-id-and-attestation#caller-id/index.md))
- check consent or the time of day; that’s your responsibility ([Consent and calling hours](/channel/voice/guides/outbound-calling/limits-and-fraud-controls#consent-and-calling-hours/index.md))

## How a call goes out

1. Your platform sends an INVITE to Linq’s SIP address over TLS. The Request-URI holds the number you’re calling, and the `From` header holds your Linq number, both in E.164.
2. Linq challenges the INVITE with `407`. Your platform sends it again with your SIP username and password.
3. 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.
4. Linq places the call on the phone network, with your Linq number as the caller ID.
5. If the phone network sends `180` or `183`, Linq passes it back. When the person answers, Linq passes the `200 OK` back. Your `ACK` goes through Linq.
6. 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.
7. 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

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](/channel/voice/guides/outbound-calling/authentication/index.md)) |
| 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](#openais-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.0
```

### 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](https://developers.openai.com/api/docs/guides/live-conversations#greet-before-the-caller-speaks):

1. Put the greeting instructions in a `developer` message in `session.input` when you create the session.
2. Send the greeting instructions once on the sideband, in a `session.commentary.append` event with a unique `event_id` and `delegation_id: null`. `delegation_id` is required, but it can be `null`.

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](/channel/voice/guides/outbound-calling/limits-and-fraud-controls#voicemail/index.md).

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](/channel/voice/guides/outbound-calling/limits-and-fraud-controls#one-outbound-call-at-a-time-per-number/index.md).

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](https://developers.openai.com/api/docs/guides/voice-sip#place-an-outbound-call).

### 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](#openais-live-api)).

### 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](/channel/voice/getting-started/connect-your-sip-endpoint#allow-linqs-addresses/index.md).

## 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](/channel/voice/guides/outbound-calling/caller-id-and-attestation#caller-id/index.md). The call also carries an attestation level, which the called party’s carrier uses to decide how to show it; see [Attestation](/channel/voice/guides/outbound-calling/caller-id-and-attestation#attestation/index.md).

## 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](/channel/voice/guides/outbound-calling/limits-and-fraud-controls#when-a-call-is-refused/index.md).

## Place your first outbound call

1. 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](/channel/voice/guides/outbound-calling/limits-and-fraud-controls#destinations/index.md)). Linq gives you a SIP username and password.
2. Make sure each number you call from is set up for voice (a SIP profile assigned; see [Assign numbers](/channel/voice/getting-started/connect-your-sip-endpoint#assign-numbers/index.md)) 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 with `2006`, when you assign the SIP profile ([API errors during setup](/channel/voice/getting-started/connect-your-sip-endpoint#api-errors-during-setup/index.md)).
3. In your platform, add an outbound SIP trunk with the values in [Where to send calls](#where-to-send-calls).
4. Allow the [phone network’s audio](#allow-the-phone-networks-audio).
5. 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](/channel/voice/guides/outbound-calling/caller-id-and-attestation#caller-id/index.md).

## Related

- [Authentication](/channel/voice/guides/outbound-calling/authentication/index.md)
- [Caller ID and attestation](/channel/voice/guides/outbound-calling/caller-id-and-attestation/index.md)
- [Limits and fraud controls](/channel/voice/guides/outbound-calling/limits-and-fraud-controls/index.md)
- [Connect your SIP endpoint](/channel/voice/getting-started/connect-your-sip-endpoint/index.md) (inbound calls)
