Luis
04/23/2025, 8:47 AMVapi Support Bot
04/23/2025, 8:49 AM{{customer.number}}
variable in your prompt. This variable contains the caller's phone number in E.164 format (with the "+" prefix).
The caller's number is extracted from the From
field in the SIP request body and passed to Vapi as customer.number
. Here's an example of how it's processed:
python
From = request_body.get("From", "")
payload = {
# other fields...
"customer": {
"number": From
},
}
Sources:
- [Discord Channel](https://discord.com/channels/1211482211119796234/1343574701909344297)
- [Vapi Documentation](https://docs.vapi.ai/assistants/dynamic-variables)Kings_big💫
04/23/2025, 8:54 AMLuis
04/23/2025, 9:14 AMLuis
04/23/2025, 9:16 AMKings_big💫
04/23/2025, 9:22 AMLuis
04/23/2025, 9:23 AMLuis
04/23/2025, 9:24 AMKings_big💫
04/23/2025, 10:25 AMKings_big💫
04/23/2025, 10:26 AMLuis
04/23/2025, 4:03 PMLuis
04/23/2025, 4:03 PMKings_big💫
04/23/2025, 4:27 PMLuis
04/24/2025, 8:05 AMKyle Brunker
04/24/2025, 12:31 PMLuis
04/24/2025, 2:13 PMLuis
04/24/2025, 2:15 PMKyle Brunker
04/27/2025, 7:15 PMKyle Brunker
04/27/2025, 7:16 PMLuis
05/12/2025, 3:00 PMLuis
05/12/2025, 3:09 PMLuis
05/12/2025, 3:23 PMLuis
05/12/2025, 3:40 PMLuis
05/27/2025, 7:25 PMVapi Support Bot
05/27/2025, 7:27 PMjs
app.post("/api/assistant-selector", (req, res) => {
// Example: extract caller ID from SIP "From" header (pseudo-code)
const sipFromHeader = req.headers['from'];
const callerId = parseCallerId(sipFromHeader); // Implement this function as needed
res.json({
assistantId: "your-assistant-id",
assistantOverrides: {
variableValues: {
callerId: callerId
}
}
});
});
Now, you can use {{callerId}}
as a dynamic variable in your assistant's prompts.
Note: You must implement the SIP header parsing logic appropriate to your environment.
Sources:
- [Personalization with user information](https://docs.vapi.ai/assistants/personalization)
- [Using dynamic variables in a phone call](https://docs.vapi.ai/assistants/dynamic-variables)
- [SIP integration](https://docs.vapi.ai/advanced/sip)Vapi Support Bot
05/27/2025, 7:27 PMFrom: "34605160984" <sip:34605160984@185.237.200.99>
You can set up your call request as:
json
{
"assistantId": "your-assistant-id",
"assistantOverrides": {
"variableValues": {
"callerId": "34605160984"
}
},
"customer": {
"number": "34605160984"
},
"phoneNumberId": "your-phone-id"
}
This way, you can use {{callerId}}
or {{customer.number}}
in your assistant's prompts.
Note: There is currently no built-in dynamic variable for `{{customer.sipUri}}`; you must handle extraction and mapping yourself ([see docs](https://docs.vapi.ai/assistants/dynamic-variables)).
Sources:
- [Using dynamic variables in a phone call](https://docs.vapi.ai/assistants/dynamic-variables)
- [SIP integration](https://docs.vapi.ai/advanced/sip)Kyle Brunker
05/28/2025, 12:34 PM