SignalWire
Put a short SWML script (SignalWire’s call-handling script) on your SignalWire number to send its calls to a SIP trunk (a standing internet phone connection). You set up the trunk in Vapi’s dashboard (Connect in Vapi), then pick the number in Vapi for CX. This page gives both scripts to paste.
- Receive calls: Through a SignalWire SWML script that connects calls to the Vapi trunk, as SignalWire’s Vapi guide describes.
- Transfer to a phone number: Offered. Vapi passes the call to SignalWire.
- Transfer to a SIP address: Offered. Vapi passes the call to SignalWire.
- Return the call to their system: Only when a contact center or phone system that takes calls back is linked to the line. See Handing callers to people.
- Place calls: Through a second script, as SignalWire’s Vapi guide describes (see Place calls from SignalWire numbers under Other options). The caller ID is the one number set in the script.
Send calls to the agent
You need a SignalWire space with a number, out of Trial Mode.
Add the SIP trunk in Vapi's dashboard
In Vapi’s dashboard, open Integrations, choose SIP Trunk under Phone Number Providers, then Configure New SIP Trunk. Under Gateway Configuration, add SignalWire’s 15 signaling IP addresses, from SignalWire’s Vapi guide, each with Allow inbound calls. SignalWire says these addresses can change, so check the list with dig sip.signalwire.com before you add it.
Add each number in Vapi's dashboard
In Vapi’s dashboard, open Phone Numbers, choose Create Phone Number, then BYO SIP Trunk Number. Enter each number once, in full international format with a leading +, and pick the trunk under SIP Trunk Credential.
Keep this one trunk, and one entry per number, for both directions. SignalWire’s guide adds the number a second time, on a second trunk, for calls out. On this page, the calls-out gateway goes on the same trunk instead.
Copy the trunk's Credential ID
In Vapi’s dashboard, open the trunk and copy its Credential ID. The script in the next step sends calls to <credential id>.sip.vapi.ai.
Create the inbound SWML script
In your SignalWire space’s dashboard, choose Resources, Add, Script, then SWML Script. Paste this script, with your Credential ID in the address:
%{call.to} is the number that was dialed. For more information, see SignalWire’s Vapi guide.
Assign the script to the number
Open Phone Numbers, then the number, and choose Edit Settings. Under Inbound Call Settings, choose Assign Resource and pick the script. Or, on the script, choose Addresses & Phone Numbers, + Add, then Phone Number. SignalWire’s ElevenLabs guide shows these menus.
Number the agent sees: the caller’s own number, unless the script changes it. SignalWire’s script reference describes adding X- headers to the connect step; the agent reads headers whose names start with X- as caller details.
Check it: when Vapi for CX shows Call this number from your phone, call the number from another phone. The check passes when your call reaches the agent. Calls out need the outbound script under Other options.
Stop answering. In Vapi for CX, Stop answering on a number set up in Vapi’s dashboard takes the agent off the number. The number stays in Vapi’s dashboard with no agent on it, and nothing changes at SignalWire.
Hand callers to your team
On a SignalWire trunk, Vapi passes each handoff to SignalWire (SIP’s own transfer message) rather than placing a new call, for both Transfer to a phone number and Transfer to a SIP address. SignalWire documents sending a passed-on call, not accepting one on a call it joined to Vapi. The summary rides as a SIP header, so it doesn’t reach a phone number. For how handoffs work, see Handing callers to people.
Limitations
- A space in Trial Mode can’t take calls from real callers: it has one number, allows calls only to and from purchased and verified numbers, and places no calls out from SIP endpoints and no international calls. Leaving it takes a card and at least $5.
- Calls out show the one caller ID set in the script, not the caller’s own number.
- International calling stays off until you turn it on.
- Calls out get STIR/SHAKEN attestation level C by default. Levels A and B need vetting through SignalWire support.
- SignalWire’s signaling addresses can change. A refused call leaves no record in Vapi, so if an address is missing from the trunk, Vapi for CX can only say that no call arrived.
- A SignalWire number alone doesn’t allow Return the call to their system. See Handing callers to people.
- SignalWire bills the call in and its connection to Vapi as separate call legs, and Vapi bills its own minutes. A joined call is capped at 4 hours by default.
Other options
Place calls from SignalWire numbers
Calls out go through a second SWML script and a gateway on the same trunk.
Create the outbound SWML script
In your space’s dashboard, choose Resources, Add, Script, then SWML Script again, and paste:
Replace +14155550100 with a SignalWire number from your space, in full international format, or a verified caller ID. For more information, see SignalWire’s Vapi outbound guide and its caller ID page.
Add a SIP Address with a password
On that script, choose Addresses & Phone Numbers, Add, then SIP Address. Keep User as * and set a password. The address’s host looks like <your space>-<domain>.dapp.signalwire.com.
Add the host to the same trunk in Vapi's dashboard
In Vapi’s dashboard, open the trunk under Integrations › SIP Trunk. Add the SIP Address’s host as a gateway with Allow outbound calls only. Under Advanced Settings (Optional), turn on Enable leading plus for outbound calls. Under Authentication (Optional), enter the number in full international format as the username, and the SIP Address’s password.
Other ways to connect SignalWire
- A Compatibility (cXML) application. Its Dial verb sends a call to a SIP address.
- Forward the number to a Vapi number. A
connectto a number in full international format. It goes over the phone network, bills a second SignalWire leg, and carries no caller details.