# Connect RTB calls over SIP — a SIP address on every reservation

# Connect RTB calls over SIP — a SIP address on every reservation

## Why this matters

When you ping our RTB endpoint and win a reservation, you need a way to route the
live call to us. Until now, getting a routable destination back depended on the
shape of your request and we were returning and inbound number to route the call to.
Sometimes there was also a sip address.

Now every successful RTB reservation comes back with a **SIP address** you can dial
to connect the call — no matter how you pinged us. Note that the publisher should 
be whitelisted with IP or username and password to successfully send the call. 

## What's new

Reserved (and confirmed) RTB responses now include a `sip_address` field alongside
the `inbound_number` you already receive.

The SIP address is **dynamic**: it's unique to each reservation, so you always dial
the exact destination tied to that specific call.

Most importantly, you get a `sip_address` back **whether or not you provide a
`caller_number`** in your ping. Whichever way you reserve, you'll have a SIP target
to connect to.

## How to use it

Ping the RTB endpoint as usual. With a caller number:

```bash
curl -X POST "https://rtb.retreaver.com/rtbs.json" \
  -d "key=YOUR_POSTBACK_KEY" \
  -d "caller_number=+18888888888"
```

…or without one:

```bash
curl -X POST "https://rtb.retreaver.com/rtbs.json" \
  -d "key=YOUR_POSTBACK_KEY"
```

Either way, a successful reservation now returns `sip_address`:

```json
{
  "rtb": {
    "uuid": "0c4d6f2a-1b3e-4a9d-8c7f-9e2b1a6d4f30",
    "status": "reserved",
    "retreaver_payout": 12.5,
    "retreaver_seconds": 60,
    "inbound_number": "+18005551234",
    "sip_address": "0c4d6f2a-1b3e-4a9d-8c7f-9e2b1a6d4f30@sip.rtb.retreaver.com",
    "expires_at": "2026-06-17T14:32:05Z"
  }
}
```

Dial the `sip_address` to connect the call over SIP, or keep using `inbound_number`
to connect over PSTN — both point to the same reservation.

## Access

The `sip_address` is returned only on `reserved` and `confirmed` reservations. Pings
that don't result in a reservation won't include it.
