Skip to main content

How inbound calls work with BYOT

When a call arrives on one of your DID numbers, the following happens:
  1. Your SIP provider sends the INVITE to Bolna’s SIP server (sip:13.200.45.61:5060)
  2. Bolna matches the called number against your registered phone numbers
  3. The call is routed to the AI agent mapped to that number
  4. The agent answers and handles the conversation

Prerequisites

Before setting up inbound calls, ensure:
  1. You have created a SIP trunk on Bolna
  2. You have added your phone numbers to the trunk
  3. Your SIP provider is routing those DIDs to sip:13.200.45.61:5060
  4. inbound_enabled is set to true on your trunk
  5. You have a Bolna agent created

Map a phone number to an agent

Use the Set Inbound Agent API to map a phone number to your Bolna agent.
curl -X POST https://api.bolna.ai/inbound/setup \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "agt-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "phone_number_id": "01HQNUMBER111222333"
  }'
FieldTypeRequiredDescription
agent_idstringYesThe UUID of the Bolna agent that should handle calls on this number.
phone_number_idstringYesThe phone number ID returned when you added the number to the trunk.
Once mapped, any call arriving on that DID will be answered by the specified agent. The agent’s audio format is automatically updated to ulaw to match Asterisk’s requirements.
One number, one agent: A phone number can only be mapped to one agent at a time. Mapping it to a new agent automatically unmaps it from the previous one.
To stop an agent from answering calls on a number (without removing the number from the trunk), use the unlink endpoint:
curl -X POST https://api.bolna.ai/inbound/unlink \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "agt-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "phone_number_id": "01HQNUMBER111222333"
  }'
After unlinking, inbound calls to that number will no longer be answered by an agent.

Troubleshooting inbound calls

If inbound calls are not arriving or are being rejected:
  1. Confirm your SIP provider has sip:13.200.45.61:5060 set as the origination URI for the DID
  2. Confirm the phone number has been added to the trunk
  3. Confirm the phone number has been mapped to an agent (above)
  4. Confirm inbound_enabled is true on the trunk
  5. Check that the number format in the INVITE’s Request-URI or To header matches what you stored (with or without +)

Next steps