# Vapi

Use [Vapi assistants](https://vapi.ai/) with **DIDWW SIP Trunking** to handle inbound and outbound calling over standard
phone lines.
Connect your DIDWW SIP trunks with Vapi to route incoming calls to assistants, place outbound calls through DIDWW
trunks, and manage voice conversations using your existing DIDWW phone numbers.

- Route incoming calls from DIDWW numbers to Vapi assistants.
- Connect callers to AI assistants for real-time conversations.
- Import existing DIDWW numbers into Vapi.

- Place outbound calls through DIDWW Outbound Trunks.
- Transfer active calls to external phone numbers through DIDWW.
- Assign Vapi assistants to individual DIDWW phone numbers.

---

## 1. Route Incoming Calls to Vapi

Configure an **Inbound SIP Trunk** in the DIDWW User Panel to send incoming calls from your DIDWW numbers to Vapi.
This trunk defines the SIP path that delivers calls to your Vapi assistant and can be configured to support SIP REFER
call transfers.

### Before You Begin

- At least one active **DID number** with capacity to receive incoming calls is required. [Buy Numbers](https://my.didww.com/users/sign_up#/coverage).
- A private Vapi API key is required to use the cURL examples. See [Get Your API Credentials](https://docs.vapi.ai/chat/quickstart#1-get-your-api-credentials) in the Vapi documentation. Keep the key secure and do not expose it in client-side code.

### Step 1: Create New SIP Trunk

1. In the [DIDWW User Panel](https://my.didww.com/#/trunks), go to **Voice > Inbound Trunks**.
2. Click **Create New > SIP Trunk**.

![Creating a new inbound SIP trunk](../../_images/inbound12.png)


Fig. 1. Creating a new inbound SIP trunk

### Step 2: Configure General SIP Trunk Settings

In the **General** tab, configure the endpoint and network settings used to deliver calls from DIDWW to Vapi.

1. Enter a descriptive **Name** for the trunk (e.g., `Vapi`).
2. Select **Static Endpoint**.
3. Enter the **Host** value `sip.vapi.ai`.
4. Select the **Transport** used by Vapi: **UDP**, **TCP**, or **TLS**.
5. Enter the corresponding **Port**: `5060` for **UDP** or **TCP**, or `5061` for **TLS**.
6. Set **Network Protocol** to match the IP version used by your DIDWW outbound trunk. If you allowed IPv4 addresses in the outbound trunk, use **Prefer IPv4 over IPv6** or **IPv4 only**.

![SIP trunk configured for Vapi](../../_images/generalsettings2.png)


Fig. 2. SIP trunk configured for Vapi

### Step 3: Enable Call Transfer Signaling

To support call transfers, configure the inbound trunk to allow in-dialog SIP REFER requests.

1. Open the **Signalling** tab.
2. Set **Max transfers** value to `1` or higher.

![Enable Call Transfer Signaling](../../_images/inbound_advanced_signaling.png)


Fig. 3. Enable Call Transfer Signaling

### Step 4: Save the Inbound SIP Trunk

When all required fields in the Create Inbound SIP Trunk are filled, click **Create** to save your inbound SIP trunk.

Note

For advanced SIP trunk configuration, see [Advanced Inbound SIP Trunk
documentation](../../voice/inbound-trunks/sip-trunks/sip-trunk-settings-reference.html#user-panel-sipin-trunk-advanced-configuration).

![Inbound SIP trunk created](../../_images/inbound21.png)


Fig. 4. Create the Inbound SIP Trunk

### Step 5: Locate Your DID Numbers

After creating the Inbound SIP Trunk for Vapi, locate the DID number(s) that will deliver incoming calls to your Vapi
assistant.

1. In the DIDWW User Panel, go to **Phone Numbers > My Numbers**.
2. Find the DID number(s) you want to connect to Vapi.

![Locate your DID numbers](../../_images/inbound31.png)


Fig. 5. Locate your DID numbers

### Step 6: Assign Inbound SIP Trunk to Your DID Numbers

1. Select the DID number(s) you located in the previous step.
2. At the bottom of the page, click **Batch Actions > Update Trunks**.

![Assigning a SIP trunk to DID numbers](../../_images/inbound3.5.png)


Fig. 6. Selecting **Update Trunks** from the Batch Actions menu

3. From the dropdown menu, choose the **Vapi SIP trunk** you created earlier.
4. Click **Confirm** to apply the changes.

![Assigning a SIP trunk to DID numbers](../../_images/inbound42.png)


Fig. 7. Assigning the Vapi SIP trunk to the selected DID(s)



---

## 2. Enable Outbound Calling from Vapi Through DIDWW

Configure an Outbound SIP Trunk in the DIDWW User Panel to allow Vapi assistants to place outbound calls through DIDWW.
This trunk also provides the SIP credentials required for authenticated SIP REFER call transfers to external phone
numbers.

### Before You Begin

- An active DIDWW account is required. [Sign in to DIDWW](https://my.didww.com/users/sign_in) or [Create DIDWW account](https://my.didww.com/users/sign_up#/users/sign_up).
- Access to **DIDWW Outbound Trunks** is required for making outbound calls. See [Get Access to DIDWW Outbound Termination](../../voice/outbound-trunks/get-access.html#user-panel-voice-out-get-access).

### Step 1: Create New Outbound Voice Trunk

1. In the [DIDWW User Panel](https://my.didww.com/#/trunks), go to **Voice > Outbound Trunks**.
2. Click **Create New**.

![Creating a new outbound SIP trunk](../../_images/outbound12.png)


Fig. 8. Creating a new outbound SIP trunk

### Step 2: Configure Authentication

1. Update the **Friendly Name** (e.g., `Vapi`).
2. Keep the default **Credentials & IP-based** authentication method selected. The SIP digest credentials (username and password) will be provided after the trunk is created.
3. In **Allowed SIP IP addresses**, enter the public SIP signaling IP addresses for your Vapi region:

   - US: `44.229.228.186/32` and `44.238.177.138/32`
   - EU: `44.233.34.47/32` and `44.233.34.48/32`

   Then add the DIDWW inbound SIP addresses used for call transfers:

   - New York: `46.19.209.14`
   - Frankfurt: `46.19.210.14`
   - Los Angeles: `46.19.212.14`
   - Miami: `46.19.213.14`
   - Singapore: `46.19.214.14`
   - Hong Kong: `46.19.215.14`
   - Amsterdam: `185.238.173.14`

Note

Vapi SIP signaling IP addresses depend on the region where your Vapi organization is hosted and may change. Refer to the
official Vapi documentation for the most up-to-date information: [Vapi SIP Networking and Firewall
Configuration](https://docs.vapi.ai/advanced/sip/sip-networking)

Warning

You can allow all traffic by adding `0.0.0.0/0`, which removes all IP restrictions.
Although SIP Digest Authentication will still verify requests using valid credentials, this setup is not recommended.
Restrict access to known Vapi SIP signaling IPs whenever possible.

![Configuring allowed SIP IP addresses for outbound trunk authentication](../../_images/outbound21.png)


Fig. 9. Entering allowed SIP IP addresses for outbound authentication

### Step 3: Save the Outbound SIP Trunk

When all required fields in the Create Outbound SIP Trunk are filled, click **Create** to save your outbound SIP trunk.

Note

For advanced outbound SIP trunk configuration, see [Outbound SIP Trunk
Guide](../../voice/outbound-trunks/how-to-guides/index.html#outbound-trunk-create).

![Outbound SIP trunk created](../../_images/outbound32.png)


Fig. 10. Outbound SIP trunk created and ready for use

### Step 4: Copy Outbound Trunk Credentials

When the outbound trunk is created, you can view its credentials by selecting the key icon in the Credentials column on
the Outbound Trunks page.

1. Go to **Voice > Outbound Trunks**.
2. Locate your outbound trunk and click the **key icon** in the **Credentials** column.
3. The trunk credentials will appear, showing the **Username** and **Password** (click the **eye icon** to reveal the password).
4. Copy and securely store these credentials. You will need them later when configuring Vapi in [Step 1: Create Outbound Trunk](#vapi-create-vapi-outbound-trunk) and [Step 2: Create Inbound Trunk](#vapi-create-vapi-inbound-trunk).

![Accessing outbound trunk credentials](../../_images/outbound42.png)


Fig. 11. Opening the outbound trunk credentials view

### Step 5: Add Outbound Credentials to the Inbound Trunk

To support call transfers, configure the DIDWW inbound trunk to authenticate SIP REFER requests with the credentials
generated for the outbound trunk.

1. Go to **Voice > Inbound Trunks** and locate the Vapi inbound trunk.
2. Click the **Actions (⋯)** icon, then select **Edit**.
3. Open the **Authorization** tab.
4. Turn on **Enable Authorization**.
5. In **Auth User**, paste the outbound trunk **Username**.
6. In **Auth Password**, paste the outbound trunk **Password**.
7. Click **Submit**.

![Adding outbound trunk credentials to the inbound trunk Authorization tab](../../_images/inbound_auth.png)


Fig. 12. Adding outbound trunk credentials to the inbound trunk



---

## 3. Connect DIDWW SIP Trunks in Vapi

Connect the DIDWW SIP trunks in Vapi so your assistant can receive incoming calls, place outbound calls, transfer active
calls, and use your DIDWW phone numbers.
This setup adds the required SIP trunk credentials, enables call transfer tooling, and links your DIDWW phone numbers to
a Vapi assistant.

### Before You Begin

- An active **Vapi account** is required. [Sign in to Vapi](https://dashboard.vapi.ai/) or create an account if needed.
- A configured **Vapi assistant** is required. See the [Vapi Quickstart Guide](https://docs.vapi.ai/assistants/quickstart) for guidance on creating an assistant.
- A private Vapi API key is required to use the cURL examples. See [Get Your API Credentials](https://docs.vapi.ai/chat/quickstart#1-get-your-api-credentials) in the Vapi documentation. Use `https://api.vapi.ai` for US organizations or `https://api.eu.vapi.ai` for EU organizations.

### Step 1: Create Outbound Trunk

Create a Vapi outbound SIP trunk credential that uses DIDWW as the SIP provider.

Dashboard

1. In Vapi, open the **Integrations** menu.
2. Locate **Phone Number Providers** and open **SIP Trunk** integrations.

![Opening the SIP Trunk provider in Vapi integrations](../../_images/vapi_out1.png)


Fig. 13. Opening the SIP Trunk provider in Vapi

3. Click **Configure New SIP Trunk**.

![Starting a new SIP trunk configuration in Vapi](../../_images/vapi_out2.png)


Fig. 14. Starting a new SIP trunk configuration in Vapi

4. Enter a friendly **Name** (e.g., `DIDWW Outbound Trunk`).
5. In **IP Address / Domain**, enter any of the DIDWW [outbound signaling endpoints](../../voice/outbound-trunks/outbound-sip-information.html#voice-out-signaling-endpoints) (e.g., `fra.eu.out.didww.com`).
6. Configure the transport protocol and port. Use `5060` for UDP/TCP or `5061` for TLS.
7. Uncheck **Allow inbound calls**, leaving only **Allow outbound calls** selected.

![Configuring DIDWW gateway settings for the Vapi outbound trunk](../../_images/vapi_out3.png)


Fig. 15. Configuring DIDWW gateway settings

8. In **Authentication**, enter the **Username** and **Password** copied from [Step 4: Copy Outbound Trunk Credentials](#vapi-create-outbound-trunk-copy-credentials).
9. Click **Save SIP Trunk**.

![Configuring authentication for the Vapi outbound trunk](../../_images/vapi_out4.png)


Fig. 16. Configuring outbound trunk authentication


cURL

```
curl -X POST https://api.vapi.ai/credential \
  -H "Authorization: Bearer YOUR_VAPI_PRIVATE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "byo-sip-trunk",
    "name": "DIDWW Outbound Trunk",
    "gateways": [
      {
        "ip": "YOUR_DIDWW_OUTBOUND_ENDPOINT",
        "port": 5060,
        "inboundEnabled": false,
        "outboundEnabled": true,
        "outboundProtocol": "udp"
      }
    ],
    "outboundAuthenticationPlan": {
      "authUsername": "YOUR_DIDWW_TRUNK_USERNAME",
      "authPassword": "YOUR_DIDWW_TRUNK_PASSWORD"
    }
  }'
```

Replace the endpoint with the DIDWW signaling endpoint selected for your deployment.

### Step 2: Create Inbound Trunk

Create the Vapi inbound trunk that will accept calls from DIDWW.
Because Vapi allows only one allowed IP address per gateway, create one gateway for each required DIDWW SIP signaling
IP.

Dashboard

1. In Vapi, open the **SIP Trunk** integration and click **Configure New SIP Trunk**.

![Starting an inbound SIP trunk configuration in Vapi](../../_images/vapi_in1.png)


Fig. 17. Starting an inbound SIP trunk configuration in Vapi

2. Enter a friendly **Name** (e.g., `DIDWW Inbound Trunk`).
3. In the gateway settings, enter one of the [DIDWW SIP IPs](../../voice/inbound-trunks/sip-trunks/sip-connectivity-reference.html#service-did-sip) as the allowed signaling IP for the gateway (e.g., `46.19.209.14`).
4. Configure the transport protocol and port. Use `5060` for UDP/TCP or `5061` for TLS. This must match the transport protocol selected on the [DIDWW inbound SIP trunk](#vapi-inbound).
5. Uncheck **Allow outbound calls**, leaving only **Allow inbound calls** selected.
6. Click **Add Another Gateway** and repeat steps 3-5 until you have added all [DIDWW SIP IPs](../../voice/inbound-trunks/sip-trunks/sip-connectivity-reference.html#service-did-sip) to the inbound trunk gateways. This is required because Vapi allows only one IP per gateway.

![Configuring DIDWW gateway IPs for the Vapi inbound trunk](../../_images/vapi_in2.png)


Fig. 18. Configuring DIDWW gateway IPs for the inbound trunk

7. In **Authentication**, enter the **Username** and **Password** copied from [Step 4: Copy Outbound Trunk Credentials](#vapi-create-outbound-trunk-copy-credentials).
8. Click **Save SIP Trunk**.

![Configuring authentication for the Vapi inbound trunk](../../_images/vapi_in3.png)


Fig. 19. Configuring inbound trunk authentication


cURL

```
curl -X POST https://api.vapi.ai/credential \
  -H "Authorization: Bearer YOUR_VAPI_PRIVATE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "byo-sip-trunk",
    "name": "DIDWW Inbound Trunk",
    "gateways": [
      { "ip": "46.19.209.14", "port": 5060, "netmask": 32, "inboundEnabled": true, "outboundEnabled": false },
      { "ip": "46.19.210.14", "port": 5060, "netmask": 32, "inboundEnabled": true, "outboundEnabled": false },
      { "ip": "46.19.212.14", "port": 5060, "netmask": 32, "inboundEnabled": true, "outboundEnabled": false },
      { "ip": "46.19.213.14", "port": 5060, "netmask": 32, "inboundEnabled": true, "outboundEnabled": false },
      { "ip": "46.19.214.14", "port": 5060, "netmask": 32, "inboundEnabled": true, "outboundEnabled": false },
      { "ip": "46.19.215.14", "port": 5060, "netmask": 32, "inboundEnabled": true, "outboundEnabled": false },
      { "ip": "185.238.173.14", "port": 5060, "netmask": 32, "inboundEnabled": true, "outboundEnabled": false }
    ],
    "outboundAuthenticationPlan": {
      "authUsername": "YOUR_DIDWW_TRUNK_USERNAME",
      "authPassword": "YOUR_DIDWW_TRUNK_PASSWORD"
    }
  }'
```

Save the returned credential `id`; it is required when you [import the DIDWW
number](https://docs.vapi.ai/phone-numbers/didww).

### Step 3: Create Call Transfer Tool

Create a call transfer tool in Vapi so the assistant can transfer an active call to a live person through DIDWW.

Dashboard

1. In Vapi, open the **Tools** page and click **Create Tool** and select **Transfer Call**.

![Selecting the Transfer Call tool in Vapi](../../_images/vapi_transfer2.png)


Fig. 20. Selecting the Transfer Call tool

2. Enter a **Tool Name** (for example, `transfer_call_tool`).
3. In **Description**, enter a short explanation of when the tool should be used, for example: `Transfers the active call to a live person through DIDWW when the caller requests human assistance.`.
4. Under **Destinations**, click **Add Destination** and select **SIP**.

![Configuring the Transfer Call tool settings in Vapi](../../_images/vapi_transfer3.png)


Fig. 21. Configuring the Transfer Call tool settings

5. In **SIP URI**, enter the SIP URI in the format `sip:+E164_NUMBER@OUTBOUND_ENDPOINT`, where the phone number is in E.164 format with the `+` symbol and the outbound endpoint is one of the DIDWW [Outbound Trunk Signaling Endpoints](../../voice/outbound-trunks/outbound-sip-information.html#voice-out-signaling-endpoints), for example `sip:+1234567890@fra.eu.out.didww.com`.
6. In **Message to Customer**, enter the message that should be played before the transfer starts, for example `Please wait while I transfer your call`.
7. In the destination **Description** field, enter when this transfer destination should be used, for example `Trigger this tool when a caller asks to be transferred to a live person`.
8. In **Transfer Mode**, keep the default **Blind Transfer** mode.

![Configuring the SIP destination for the Transfer Call tool in Vapi](../../_images/vapi_transfer4.png)


Fig. 22. Configuring the SIP destination for the Transfer Call tool

9. Click **Save** to create the call transfer tool.


cURL

```
curl -X POST https://api.vapi.ai/tool \
  -H "Authorization: Bearer YOUR_VAPI_PRIVATE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "transferCall",
    "destinations": [
      {
        "type": "sip",
        "sipUri": "sip:+447700900123@YOUR_DIDWW_OUTBOUND_ENDPOINT",
        "message": "Please wait while I transfer your call.",
        "description": "Use when the caller asks to speak with a live person.",
        "transferPlan": {
          "mode": "blind-transfer",
          "sipVerb": "refer"
        }
      }
    ]
  }'
```

Save the returned tool `id` for the next step.

### Step 4: Add Call Transfer Tool to Your Assistant

Add the transfer tool to the assistant that will handle calls for your DIDWW number.

Dashboard

1. In Vapi, go to **Assistants** and open the assistant that will handle your DIDWW calls.
2. Open the **Tools** tab and click **Add tool**.
3. Select the **Transfer Call Tool** you created in the previous step.

![Adding the transfer tool to a Vapi assistant](../../_images/vapi_assistant1.png)


Fig. 23. Adding the transfer tool to a Vapi assistant

4. Click **Publish** to apply the assistant changes.

![Transfer tool attached to a Vapi assistant](../../_images/vapi_assistant2.png)


Fig. 24. Transfer tool attached to the assistant

5. In the pop-up window, click **Publish** again to confirm the changes.

![Publishing the Vapi assistant after adding the transfer tool](../../_images/vapi_assistant3.png)


Fig. 25. Publishing the assistant changes


cURL

Retrieve the assistant, add the transfer tool ID to `model.toolIds`, and PATCH the complete model back. The example uses
`jq` to preserve the existing model configuration and tool IDs.

```
VAPI_API_BASE="https://api.vapi.ai"
ASSISTANT_ID="YOUR_ASSISTANT_ID"
TRANSFER_TOOL_ID="YOUR_TRANSFER_TOOL_ID"

CURRENT_MODEL=$(curl -s "$VAPI_API_BASE/assistant/$ASSISTANT_ID" \
  -H "Authorization: Bearer YOUR_VAPI_PRIVATE_KEY" | jq '.model')

UPDATED_MODEL=$(printf '%s' "$CURRENT_MODEL" | jq \
  --arg toolId "$TRANSFER_TOOL_ID" \
  '.toolIds = (((.toolIds // []) + [$toolId]) | unique)')

jq -n --argjson model "$UPDATED_MODEL" '{model: $model}' | \
  curl -X PATCH "$VAPI_API_BASE/assistant/$ASSISTANT_ID" \
    -H "Authorization: Bearer YOUR_VAPI_PRIVATE_KEY" \
    -H "Content-Type: application/json" \
    --data-binary @-
```

### Step 5: Import DIDWW Phone Numbers

Import your DIDWW phone number to Vapi and assign it to the assistant that will handle incoming calls.

Dashboard

1. In Vapi, open the **Phone Numbers** menu and click **Create Phone Number**.

![Opening the Phone Numbers page in Vapi](../../_images/vapi_number1.png)


Fig. 26. Opening the Phone Numbers page in Vapi

2. Select **BYO SIP Trunk Number**.
3. In **Phone Number**, enter your DIDWW number in E.164 format with the `+` symbol (for example, `+18648301018`).
4. Leave **Allow non-E164 phone numbers** unchecked.
5. In **SIP Trunk Credential**, select the Vapi inbound SIP trunk created in [Step 2: Create Inbound Trunk](#vapi-create-vapi-inbound-trunk).
6. Optionally, in **Label**, enter a descriptive name for the number (for example, `My DIDWW Phone Number`).
7. Click **Import SIP Phone Number**.

![Importing a BYO SIP trunk number in Vapi](../../_images/vapi_number2.png)


Fig. 27. Importing a BYO SIP trunk number

8. In **Assistant**, select the Vapi assistant that will handle inbound calls.
9. Click **Save** to confirm the changes.

![Assigning an assistant to an imported phone number in Vapi](../../_images/vapi_number3.png)


Fig. 28. Assigning an assistant to the imported phone number

After saving, the imported number will appear in the **Phone Numbers** list and incoming calls to your DIDWW number will
be routed to the selected assistant.


cURL

```
curl -X POST https://api.vapi.ai/phone-number \
  -H "Authorization: Bearer YOUR_VAPI_PRIVATE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "byo-phone-number",
    "name": "DIDWW Number",
    "number": "+14155550123",
    "numberE164CheckEnabled": true,
    "credentialId": "YOUR_CREDENTIAL_ID",
    "assistantId": "YOUR_ASSISTANT_ID"
  }'
```

Use the credential `id` returned when you created the `DIDWW Inbound Trunk`. The optional `assistantId` assigns the
assistant that handles inbound calls; omit it if you plan to configure inbound routing later.

### Step 6: Test the Configuration

Verify that inbound calling, outbound calling, and call transfers are working as expected.

1. Place a test call to your **DIDWW DID number** to confirm that inbound calls are routed to Vapi and handled by the assigned **assistant**.
2. In the Vapi dashboard or API, place a test [outbound call](https://docs.vapi.ai/calls/outbound-calling) through your DIDWW outbound trunk.
3. Place another test call to your DIDWW DID number and trigger the call transfer condition, for example by asking to speak with a live person.
4. Confirm that Vapi sends the transfer request and the call is connected to the live-person destination through DIDWW.

Ensure that calls are successfully established in both directions, that the correct assistant handles the interaction,
and that transferred calls connect with two-way audio.

Note

You can review call activity and verify call status or error codes in the DIDWW **Inbound** and **Outbound Call Logs**.
See [Inbound Call Logs](../../logs-analytics/call-logs/inbound-logs.html#inbound-cdr-logs) and [Outbound Call
Logs](../../logs-analytics/call-logs/outbound-logs.html#outbound-cdr-logs) for more details.

On this page
