Connect to Vapi

Connect a Callr Phone Number to a Vapi AI Agent

📘

This guide explains how to connect a Callr phone number to a Vapi voice AI agent using SIP.

  • Callr handles telephony worldwide: phone numbers, carrier connectivity, call routing, SIP, reliability, compliance.
  • Vapi handles real-time AI: speech recognition, reasoning, tool use, and speech synthesis.
➡️

The result: anyone can call your Callr number, and the call is handled live by your Vapi AI agent.


🏗️ Architecture Overview

  1. A user dials your Callr phone number.
  2. Callr receives the Inbound Call.
  3. A Callr scenario uses dial@v1 to connect the call to a Vapi SIP endpoint.
  4. Vapi answers the SIP call and runs your voice AI agent.
  5. Audio flows bidirectionally between the caller and the AI.

⚙️Prerequisites

Before starting, make sure you have:

  • A Callr account
  • A purchased Callr phone number
  • A Callr Actions scenario
  • A Vapi account
  • A created Vapi assistant

When SIP is enabled on your Vapi assistant, Vapi provides a SIP URI in this format:

sip:<assistant-id>@sip.vapi.ai;transport=tls

🤖 Step 1 – Configure Your Vapi Assistant

In Vapi:

  1. Create or configure an assistant.
  2. Configure:
  • Model (LLM)
  • Voice
  • System prompt
  • Tools (if needed)
  1. Enable SIP connectivity for the assistant.
  2. Copy your SIP URI:
sip:<assistant-id>@sip.vapi.ai;transport=tls

Vapi handles:

  • Speech-to-text
  • LLM reasoning
  • Tool execution
  • Text-to-speech
  • Conversation state

Callr does not process AI logic - it securely transports the audio stream over SIP.


⚡ Step 2 – Create a Callr Scenario

Create a Callr Actions scenario that dials the Vapi SIP endpoint when your number receives a call.

description: Route inbound call to Vapi AI

compat:
  version: "2025-09-01"

defaults:
  autoAnswer: false

branches:
  inbound-call:
    actions:
      - action: dial@v1
        params:
          targets:
            - number: sip:<assistant-id>@sip.vapi.ai;transport=tls
              timeout: 60

How it works

  • inbound-call is triggered when someone calls your Callr number.
  • dial@v1 creates an outbound SIP call.
  • The target is the Vapi SIP endpoint.
  • transport=tls ensures encrypted SIP signaling.
Callr handles
  • PSTN termination
  • SIP negotiation
  • Secure TLS signaling
  • RTP media bridging
  • Global carrier reliability
Vapi handles
  • Real-time audio processing
  • AI conversation
  • Voice synthesis

🔗 Step 3 – Attach the Scenario to Your Phone Number

In the Callr dashboard:

  1. Go to your phone numbers.
  2. Select the number.
  3. Attach the scenario you created.

Your number is now connected to the Vapi AI agent.


🧩 Optional – Add Fallback or Business Logic

Because routing happens inside Callr, you can add:

  • Time-based routing (business hours vs after hours)
  • Failover to a human agent if SIP fails
  • Geographic routing
  • Call recording (if compliant in your jurisdiction)
  • Pre-call IVR before sending to AI

Example with fallback and call recording:

branches:
  inbound-call:
    actions:
      - action: startRecording@v1

      - action: dial@v1
        params:
          targets:
            - number: sip:<assistant-id>@sip.vapi.ai;transport=tls
              timeout: 20
            # this PSTN number will be called if Vapi fails to answer the call
            - number: '+33199001234' 
              timeout: 60
        result: $dial

      - if: '!$dial.ok'
        action: say@v2
        params:
          what: "Sorry, we are unable to connect you at the moment."
ℹ️

This keeps telephony logic inside Callr and AI logic inside Vapi.


🚀Why This Architecture Works Well

Callr
  • Own and manage phone numbers worldwide
  • Carrier-grade voice quality
  • Global PSTN connectivity
  • High availability
  • Regulatory compliance
Vapi
  • Voice-first AI orchestration
  • Flexible model selection
  • Tool integrations
  • Real-time streaming speech
  • Fast iteration of prompts and flows
👍

Each platform focuses on its core expertise.