Documentation Index
Fetch the complete documentation index at: https://www.bolna.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
What this does
When you bring your own SIP trunk, your carrier often attaches custom headers to inboundINVITE messages — caller ID values, session IDs, account references, transfer hints. SIP header variables let your agent declare which of those headers it cares about and what to call them inside the prompt.
{...}:
This feature is only active when the agent’s telephony provider is SIP Trunk. Twilio, Plivo, Exotel and Vobiz inbound calls ignore it — for those providers, all per-call context already arrives through the provider’s own webhooks.
When to use it
Per-call data from the carrier
Your carrier sends per-call metadata (campaign ID, line ID, agent transfer flag) on every INVITE and you want the LLM to use it.
CSV / API lookup keyed by a header
The number in the
From: SIP URI is not the lookup key your data is organized around — it’s a different field on the INVITE (e.g. X-CALLERNO, X-ACCOUNT).Configure the agent
Two fields on the agent control the behaviour. Both are optional and independent — an agent with neither set behaves exactly as before.| Field | Type | Purpose |
|---|---|---|
sip_header_variables | object | Map of {"<SIP-header-name>": "<prompt-variable-name>", …}. Each header that arrives on the INVITE is renamed to your declared variable name and merged into recipient_data before the prompt is rendered. |
ingest_lookup_key | string | Name of a SIP header whose value should be used as the lookup key for your CSV / API / Google-Sheet data source, instead of the caller’s phone number. Falls back to the phone number if the header isn’t present on the specific call. |
- Dashboard
- API
Open the agent, switch to the Call tab, and set Telephony Provider to SIP Trunk. The SIP Header Variables section appears in the inbound settings card.
- For each header your carrier sends, add a row: header name on the left (case-sensitive, e.g.
X-CALLERNO), prompt variable name on the right (e.g.caller_no). - If you want the data-source lookup to use a header value instead of the caller’s phone number, pick that header from the Ingest lookup key dropdown. The dropdown is populated from the headers you just declared.
- Save.
Worked example
A carrier sends this INVITE for every inbound call:- Read
X-CALLERNO,X-UCID,X-ACCOUNTfrom the INVITE. - Look up the CSV row where
contact_number = 0XXXXXXXXXX(theX-CALLERNOvalue, not the SIPFromnumber). - Render the prompt with
caller_no = 0XXXXXXXXXX,ucid = XXXXXXXXXXXXXXXXX,account = <account_id>,first_name = Ramesh,plan = Pro.
How CSV / API enrichment interacts with header pass-through
Both can be active on the same agent. The merge order is:- Header pass-through runs first — the declared variables land in
recipient_data. - CSV / API / Sheet enrichment runs second, using
ingest_lookup_key’s value (or the caller’s phone number if unset), and overrides any header-supplied variable with the same name.
Tips and gotchas
Header names are case-sensitive
Header names are case-sensitive
SIP allows mixed case but most carriers send
X-FOO exactly as configured. Inspect a packet capture or your trunk provider’s documentation, then copy the header name verbatim into sip_header_variables. X-CALLERNO and x-callerno are not the same.Missing headers do not fail the call
Missing headers do not fail the call
If a declared header is absent on a specific call, that prompt variable renders as the empty string. The call still goes through. If you depend on a header for the lookup key but it’s missing, Bolna logs a warning and falls back to the caller’s phone number.
Use {…} placeholders in the prompt
Use {…} placeholders in the prompt
Reference declared variables with curly braces:
{caller_no}, {ucid}, {account}. The same syntax works in welcome messages, system prompts and webhook URLs.Other telephony providers ignore these fields
Other telephony providers ignore these fields
sip_header_variables and ingest_lookup_key are only consulted when the agent’s telephony provider is sip-trunk. Setting them on a Twilio or Plivo agent is harmless but has no effect.Related features
Identify incoming callers
Match inbound calls to user records via CSV, API, or Google Sheets.
BYOT setup
Connect your carrier’s SIP trunk to Bolna.
BYOT inbound calls
Receive inbound calls on your trunk and route them to agents.
Using context
Pass dynamic variables into prompts at call time.

