Skip to content

Guides

Bring your own agent

Want to connect your own voice platform - ElevenLabs Conversational AI on your own workspace, Vapi, Retell, or even a plain Asterisk/FreeSWITCH IVR - to a volai number instead of the built-in agent? This page covers both directions: inbound and outbound calls. For outbound, you also skip the agent surcharge of 2.50 CZK/min (~EUR 0.10) - you run (and pay for) the agent yourself on your own platform.

1Own agent vs. the built-in one

Both paths run on the same number and the same credit - they only differ in WHO runs the conversation logic and how much that costs on top:

CriterionBuilt-in agentYour own agent
Who drives the conversationWe do - one systemPrompt, our voice and our ElevenLabs workspace.You do - any platform, your own prompt, your own voice, your own tools.
SetupOne POST /v1/agents call.The number's SIP credentials + your platform's configuration (this page).
Call price0.92 CZK/min (~EUR 0.04) outbound, 0.50 CZK/min (~EUR 0.02) inboundsame - 0.92 CZK/min (~EUR 0.04) outbound, 0.50 CZK/min (~EUR 0.02) inbound
Agent surcharge+ 2.50 CZK/min (~EUR 0.10)none (0 CZK) - you only pay for call minutes
Transcript, summary, voicemail detectionYes, automatically.No - your own platform handles it (or doesn't).

You skip the agent surcharge, but you don't get anything extra from us for free either - you pay for your own platform (ElevenLabs, Vapi...) directly, at its own rates. We only bill call minutes on the volai line, same as with a SIP client or the built-in agent. Rates exclude VAT, like the whole price list.

2Inbound calls to your own agent

No new mechanics - just the existing mode: "sip" routing (same as for your own softphone, see SIP) with your platform's sipUri address. For an ElevenLabs SIP-trunk number registered on YOUR OWN workspace, that's one with the same number as your volai line:

bash
curl -X PATCH "https://volai.cz/v1/numbers/+420601234567" \
  -H "Authorization: Bearer vk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"routing": {"mode": "sip", "sipUri": "sip:+420601234567@sip.rtc.elevenlabs.io"}}'

And on your ElevenLabs account (Settings → Phone Numbers → Import → SIP trunk) you register this number with inbound_trunk_config:

json
{
  "provider": "sip_trunk",
  "phone_number": "+420601234567",
  "label": "My own agent",
  "inbound_trunk_config": {
    "allowed_addresses": ["0.0.0.0/0"],
    "media_encryption": "allowed"
  }
}

Using a different platform than ElevenLabs? Same principle - find out the SIP address it expects calls for your number on, and put that into sipUri.

3Outbound calls from your own agent (relay)

This is the reverse direction - your platform dials out on its own. Most voice AI platforms (ElevenLabs included) can't permanently register a phone line as a SIP client - they only send a single authenticated call using your line's credentials. The phone network won't let such a call straight through to the destination number, so you route it through a short-lived relay connection instead:

1. Point your platform at your line

Fetch your line's SIP credentials:

bash
curl "https://volai.cz/v1/numbers/+420601234567/sip" \
  -H "Authorization: Bearer vk_YOUR_KEY"
json
{
  "server": "sip.volai.cz",
  "username": "123456",
  "password": "a1b2c3d4e5f6"
}

And set them as your platform's outbound trunk. For ElevenLabs, that's the outbound_trunk_config of the phone number in question (Settings → Phone Numbers → your number → Outbound calling), in exactly this shape:

json
{
  "outbound_trunk_config": {
    "address": "sip.volai.cz",
    "transport": "udp",
    "media_encryption": "allowed",
    "credentials": {
      "username": "123456",
      "password": "a1b2c3d4e5f6"
    }
  }
}

2. Create a relay connection

Right before the call (the connection has a short lifetime, see the limits below), call:

bash
curl -X POST https://volai.cz/v1/relay \
  -H "Authorization: Bearer vk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to": "+420777123456", "from": "+420601234567"}'
json
{
  "id": "rl_4f2a91cd",
  "sipName": "volai_relay_2",
  "sipUri": "sip:volai_relay_2@sip.volai.cz",
  "expiresAt": 1756111760000,
  "callId": "c_9d4e2b7f"
}

3. Tell your platform to call the sipName

The bare name, not the full SIP URI

ElevenLabs to_number rejects a full SIP URI with "SipCallTo should be a phone number or SIP user, not a full SIP URI" - that's why the response above returns sipName (the bare volai_relay_2) and sipUri (the full sip:volai_relay_2@sip.volai.cz) SEPARATELY. Only the former belongs in to_number - never the full URI.

For ElevenLabs, this means calling /v1/convai/sip-trunk/outbound-call with to_number set directly to the sipName:

json
{
  "agent_id": "agent_...",
  "agent_phone_number_id": "phnum_...",
  "to_number": "volai_relay_2"
}

Using your own SIP client or PBX instead of ElevenLabs? Dial the full sipUri directly, like an ordinary SIP call - that restriction only applies to platforms that want a bare name without the sip: prefix.

4. What happens next

The phone network accepts the call under the name volai_relay_2, transfers it to your to and sets the visible caller ID to your from - the callee sees your volai line on their display, not the relay slot's internal name. Once the call ends, the lease is released and the minutes are billed exactly like a regular outbound call - 0.92 CZK/min (~EUR 0.04), no agent surcharge.

4Limits, quotas and security

WhatValue
Lease waiting for the first call (pending)120 s default, ttlSecs 15 to 300 s
Call in progress (active)15 minutes
Active leases per one of your numbersat most 1
Active leases per accountat most 2
Lease usageone-time - a second call on the same lease is rejected
  • from must be your own volai number - otherwise from_number_not_owned. Without this check, you could spoof someone else's line as your caller ID.
  • Same gates as a regular call - do-not-call list (calls only, not SMS), automatic 30-day block after 3 failed attempts to the same number within 24 hours, premium-rate lines, protection against loops between volai numbers, the callee-number lock, and the general call rate limit. None of this can be bypassed through the relay.
  • Pool full → 503 capacity_busy - relay slots are a shared concurrency cap for the WHOLE platform, not just your account. On capacity_busy nothing is billed, try again shortly.
  • The full REST reference (error codes, GET/DELETE on leases) is in the REST API reference.