Skip to main content
Once your carrier sends calls to Bolna, each number on the trunk needs an agent to answer it. This page covers assigning agents and what an agent knows about each caller. Before you start, connect your carrier: the trunk needs your carrier’s IPs and at least one number.

How an inbound call is routed

  1. Your carrier sends the INVITE to trunk.bolna.ai. Bolna accepts it only from an address on the carrier IPs of an active trunk. Any other source gets 403 Forbidden.
  2. Bolna matches the called number, the user part of the Request-URI, against that trunk’s numbers. It matches the E.164 number with or without the +, or the number’s destination key.
  3. The call goes to the number’s agent. A number without its own agent goes to the trunk’s default agent. If there is neither, the call is refused with a 404 response.
  4. The agent’s inbound rules then apply, such as blocked callers and inbound call limits, followed by your account balance and the trunk’s channel limit.
Any agent in the same organization or sub-account as the trunk can answer its numbers. The agent’s Telephony Provider setting does not affect inbound calls.

Assign an agent to a number

You can assign agents from the trunk or from the agent.
1

From the trunk's Numbers tab

Open SIP Trunks, open the trunk and go to the Numbers tab. In the Agent column, pick an agent for each number. A number with no agent, on a trunk with no default agent, is marked Unrouted, and calls to it are rejected.
Trunk Numbers tab with a Default agent selector above a table of numbers, one row's Agent dropdown open listing agents, and another row marked Unrouted

Assigning agents on the Numbers tab

2

Or set a default agent

On the same tab, Default agent answers every number that has no agent of its own. Leave it at None (optional) to reject calls to unassigned numbers instead.
3

Or from the agent

Open the agent, go to the Calling tab and, under Inbound Calling, pick the trunk number as the Inbound number.
Agent Calling tab, Inbound Calling section, with a SIP trunk number selected as the Inbound number

Linking a trunk number from the agent

Linking a number from the agent’s Calling tab makes it that agent’s only inbound number; the agent’s other numbers are unlinked. On the trunk’s Numbers tab, or through the API, several numbers can point at the same agent.
To check the setup, call the number from any phone. The call appears on the trunk’s Activity tab under Recent calls and in Call History.

What the agent knows about the caller

Every inbound trunk call fills these variables in recipient_data, so you can use them in the prompt as {from_number} and so on: Two more sources add to recipient_data:
  • Carrier headers. Bolna passes the P-Asserted-Identity and Diversion headers from the INVITE to the agent. Map either one to a variable on the agent to use it; see SIP headers.
  • Your caller data. With Identify incoming callers set up, Bolna looks up the caller in your CSV, API or Google Sheet and adds the matching row. The lookup uses from_number, or the value of a mapped header if you set an ingest lookup key. When a header variable and a looked-up value have the same name, the looked-up value wins.
Some carriers put the real caller ID in P-Asserted-Identity and a trunk or pilot number in From. If from_number is not the caller you expect, map P-Asserted-Identity to a variable and compare.

Using the API

Assign an agent to a number with assign agent, using the number’s id from get trunk. Send "agent_id": null to unassign it. To set the trunk’s default agent, update the trunk with default_inbound_agent_id.
An agent outside the trunk’s organization or sub-account is refused with 400 and agent not in tenant. To stop a trunk taking inbound calls without deleting it, update it with "inbound_enabled": false; calls to its numbers are then refused. List calls returns each call’s execution_id, direction, the far party’s number, duration_s, outcome, and the sip_code and sip_cause it ended with. direction is all, inbound, outbound or failed, and limit is at most 100.

Next steps

SIP headers

Map P-Asserted-Identity and Diversion to prompt variables.

Troubleshooting

Calls refused with 403, 404 or 486.