Configure the SIP Request tool
Before you start, read SIP Request tool for what the tool does, the call requirements, and how to choose a SIP method.
Create the tool
Put everything your receiving system needs in the headers and body. For example, to tell your contact center the caller is verified, send an X-Call-Event header and a body with accountNumber and reason fields.
Dashboard
API
- In the Dashboard, select Tools, then select Create Tool.
- Select SIP Request.
- Give the tool a name and description. The description tells the assistant when to send the request and which method to use.
- Under SIP verb, select
INFO,MESSAGE, orNOTIFY. - Under Headers, add the SIP headers to send. For each header, add a description so the assistant knows what value to fill in. To limit a header to specific values, add them under Enum Values.
- Select Lock schema so the assistant can’t add headers you didn’t define.
- Under Body, select one:
- Raw string: a fixed body, sent as written.
- Schema builder: a structured body. Define the fields and the assistant fills them in during the call.
- Save the tool, then add it to your assistant.
Fields
For the full schema, see SIP Request tool in the Create Tool API reference.
Tell the assistant when to use it
Add instructions to your system prompt that say when to send the request and what to include. Refer to the tool by the name you gave it. For example:
Clear field descriptions in your headers and body schemas also help the assistant fill in the right values.
Send a request from an assistant hook
To send a SIP request when a call event happens, instead of when the assistant decides to, run the tool from an assistant hook. For example, this hook sends a timeout-transfer event to your platform after the caller has been silent twice:
In a hook, header and body fields with a default value are sent as written. Any other field, including the method, is filled in by the assistant from the conversation, so the method warning still applies.
Tool messages
If you don’t configure messages, the assistant says “The request was successful” out loud after the request is sent, and “Sorry, an unexpected error occurred” if it fails.
This tool’s messages all play after the request is sent, not before it. Vapi uses the first one that applies:
- Request Failed (
request-failed), if the request returned an error. - Request Start (
request-start), if you set one. It plays instead of Request Complete. - Request Complete (
request-complete).
Because nothing plays before the request, write any Request Start message as something the caller hears afterward, not “Sending that now.”
Most SIP requests are background signals the caller doesn’t need to hear about. To keep the conversation natural, set your own request-complete and request-failed messages. With role set to system, the message content goes to the model as a hint instead of being spoken, and the assistant continues the conversation in its own words:
For all message options, see SIP Request tool messages in the Create Tool API reference.
Variables
You can use variables such as {{customer.number}} in the header schema, the body (string or schema), and tool messages. Vapi fills them in when the call starts.
For example, this tool sends the call ID, the caller’s number, and a campaign ID in a fixed string body:
The {{call.id}} and {{customer.number}} variables are built in. Pass campaignId in assistantOverrides.variableValues when you start the call.
The SIP Request tool doesn’t support static parameters.
Verify the request was sent
Place a test call over your SIP connection and say whatever should make the assistant send the request. Then check these places:
- The tool call and its result. In the Dashboard, select Logs, open the call, and select the Messages tab. Find the SIP Request tool call to see the values the assistant generated for the request, and the result that came back. An error result explains why nothing was sent, for example when the call isn’t on Vapi’s SIP transport.
- The call logs. If the assistant’s Logging setting is enabled, the call’s Logs tab includes a Tool calls finished entry under the Tool category, showing the tool’s result or error.
- The call’s SIP signaling. For calls on Vapi numbers and BYO SIP trunks, Vapi records a packet capture (PCAP) of the call’s SIP signaling by default. Download it with PCAP on the call’s page, or from
artifact.pcapUrlon the call record, and open it in a SIP analysis tool such as Wireshark. See Call recording for thepcapEnabledsetting. - Your receiving system. A success result in Vapi doesn’t confirm that the other end received or accepted the request. Check the logs on your PBX, SBC, or contact center platform to confirm it received the request and acted on it.
If the request didn’t work: