Skip to main content

Inbound Calls

Inbound agents answer incoming phone calls automatically. When someone calls your configured phone number, Vocobase routes the call to the assigned agent, which handles the conversation using its prompt, voice, and knowledge base.

How inbound calls work

  1. A caller dials your Twilio phone number
  2. Twilio forwards the call to Vocobase using a TwiML webhook
  3. Vocobase identifies the inbound agent associated with the phone number
  4. The agent greets the caller and handles the conversation
  5. When the call ends, a session.completed webhook is sent with the transcript, duration, and ₹ used

Prerequisites

Inbound calling is supported with Twilio, Plivo, Vobiz, and Tata Smartflo. MCube inbound is not yet available. The flow below uses Twilio as the example; for Plivo, Vobiz, and Tata Smartflo, use the V2 phone-numbers API section at the bottom of this page to manage DIDs and agent assignment programmatically.
If you create telephony connections through the V2 API, use the returned connection_id when syncing DIDs or starting outbound calls. The same active DID can exist on multiple connections for outbound caller ID use, but only one active row can have inbound_enabled: true, which keeps inbound routing deterministic.

Set up inbound calling

1

Create an inbound agent

Create an agent with agent_type set to "inbound". This tells Vocobase that this agent should handle incoming calls rather than making outbound ones.
The intro_message is what the agent says immediately when answering the call. Keep it short and welcoming — the caller is waiting.
2

Configure your Twilio phone number

In the Twilio Console, navigate to Phone Numbers > Manage > Active Numbers and select the phone number you want to use for inbound calls.Under Voice Configuration, set the inbound webhook URL provided by Vocobase for your account:
Do not append your API key or any query parameters to the inbound webhook URL. Vocobase identifies your account from the telephony credentials you configured.
3

Link the agent to your phone number

After creating the inbound agent and configuring the Twilio webhook, Vocobase automatically routes incoming calls on your configured Twilio number to your inbound agent.If you have multiple inbound agents, the most recently created active inbound agent is used by default. Contact the Vocobase team if you need to route different phone numbers to different agents.
4

Test with a phone call

Call your Twilio phone number from any phone. You should hear your agent’s intro_message, and then you can have a conversation with it.After the call ends, check your webhook endpoint for the session.completed event:
Notice the direction field is "inbound" in the webhook payload, making it easy to distinguish from outbound calls.

Inbound vs. outbound agents

An agent’s type is set at creation and determines how it handles calls. You cannot use the same agent for both inbound and outbound calls. Create separate agents for each purpose.

Adding a knowledge base

Inbound agents benefit greatly from a knowledge base. Upload your FAQs, product documentation, and support articles so the agent can answer caller questions accurately.
See the Knowledge Base guide for the full workflow.

Troubleshooting

Calls go to Twilio voicemail instead of the agent

  • Verify the webhook URL in Twilio matches the inbound webhook URL provided by Vocobase
  • Check that the HTTP method is POST
  • Ensure your Twilio credentials are configured in Vocobase (Twilio Setup)

Agent does not answer

  • Confirm you have an active inbound agent (agent_type: "inbound", status: "active")
  • Check that your ₹ balance is not zero
  • Review the Twilio Console error logs for any connection failures

Caller hears silence

  • Make sure the intro_message is set on your inbound agent
  • Verify the voice_id is valid — list available voices with GET /agent/voices

Webhook shows wrong direction

  • If direction shows "outbound" for an inbound call, ensure you created the agent with agent_type: "inbound", not "outbound"

Use the V2 phone-numbers API (Plivo + Vobiz + Tata Smartflo)

For Plivo, Vobiz, and Tata Smartflo, use the V2 phone-numbers endpoints to sync DIDs, list local inventory, and assign inbound agents. Plivo pulls inventory from the carrier, Vobiz accepts an explicit numbers array, and Tata Smartflo pulls DIDs from Smartflo GET /v1/my_number.
Tata Smartflo inbound DIDs must also be routed in the Smartflo panel to the Voice-Bot streaming app so Smartflo invokes Vocobase’s Dynamic Voice-Bot resolver for incoming calls.

API tester quickstart

Use this as a copy-paste runbook when testing the V2 inbound flow.
Confirm the partner is active and the carrier is configured:
Expected:
  • success is true
  • data.status is active
  • data.telephony.vobiz.configured is true for Vobiz, data.telephony.plivo.configured is true for Plivo, or data.telephony.tata_smartflo.configured is true for Tata Smartflo
  • the provider appears in data.allowed_telephony_providers
If the provider is not configured, configure it first. For new multi-connection BYOP builds, prefer POST /api/v2/telephony/connections and save the returned connection_id; the older config endpoints update the default connection.
List connections when you need to choose a specific Plivo, Vobiz, or Tata Smartflo connection:
Create or choose an inbound agent:
Save the returned data.id as AGENT_ID.
1

Sync your DIDs to Vocobase

Plivo — Vocobase pulls your inventory directly from Plivo’s REST API:
Plivo response:
Vobiz — pass an explicit numbers list (Vobiz has no inventory pull):
Vobiz response:
The Vobiz request body field is numbers, not phone_numbers.
Tata Smartflo — Vocobase pulls your DID inventory from Smartflo GET /v1/my_number:
Tata Smartflo response:
Syncing a Tata Smartflo DID into Vocobase does not change the Smartflo panel route by itself. Route the DID to the Voice-Bot streaming app in Smartflo before testing inbound calls.
2

List imported DIDs

List the partner’s imported phone numbers and save the id for the DID you want to assign:
Save the phone number id as PHONE_NUMBER_ID.
3

Assign an agent to a DID

PUT /api/v2/phone-numbers/:id with agent_id. By default, assigning an agent also sets inbound_enabled to true. For outbound-only testing with the same DID on another account, send "inbound_enabled": false.
Successful response:
If carrier-side assignment fails, you’ll get a provider sync error such as 502 VOBIZ_SYNC_FAILED, 502 PLIVO_SYNC_FAILED, or 502 TATA_SMARTFLO_SYNC_FAILED. Retry after confirming the credentials, DID ownership, and provider-side routing.
4

Reconcile with one call

If you edit something in the carrier’s console directly or rotate credentials, POST /api/v2/phone-numbers/resync refreshes the assignment for every DID on that provider:
5

Receive the call

Call your DID. Vocobase routes the incoming call to the assigned agent and sends the same session.completed webhook payload as the Twilio flow above, with provider in the metadata.Expected result:
  • caller hears the assigned agent’s greeting
  • call creates an inbound session
  • session.completed webhook fires after hangup
  • webhook data.call.direction is inbound
  • webhook data.call.to_number is the DID
  • no VOBIZ_SYNC_FAILED, PLIVO_SYNC_FAILED, TATA_SMARTFLO_SYNC_FAILED, or 5xx appears during the assignment or call
See the per-provider setup guides for credential configuration — Plivo Setup, Vobiz Setup, and Tata Smartflo Setup. For multiple named connections, use Telephony Connections.

End-to-end Vobiz test script

This script assumes the agent already exists and the DID belongs to the partner’s Vobiz account.

Troubleshooting V2 inbound


Next steps

Knowledge Base

Upload documents to improve your agent’s answers.

Billing (₹)

Understand how call ₹ is calculated, including 15s buckets and tier pricing.

Plivo Setup

Configure Plivo credentials and DIDs.

Vobiz Setup

Configure Vobiz credentials and DIDs.

Tata Smartflo Setup

Configure Tata Smartflo credentials and DID routing.

Telephony Connections

Create and manage multiple named BYOP connections.

Twilio Setup

Configure Twilio credentials for your account.

Webhook Payloads

See the full payload structure for completed calls.