Testing calls
Before you start, make sure that:
- You’re using your test API key (see Sandbox & live modes).
- The sandbox reference number is assigned to the Voice App or SIP Trunk you want to test (see Sandbox numbers).
- The phone you’ll test with is a verified number.
Outbound calls
Section titled “Outbound calls”Place the call as you would in live mode, with two differences:
from_numberis your sandbox reference number.to_numbermust be a verified number.
The person you call sees your sandbox virtual number as the caller ID.
import osfrom teler import Client
client = Client(os.environ["TELER_API_KEY"]) # test API key
call = client.voice.calls.create( from_number="+91XXXXXXXXXX", # sandbox reference number to_number="+91XXXXXXXXXX", # a verified number flow_url="https://your-domain.com/flow", status_callback_url="https://your-domain.com/webhook",)print(call.id)import { Client } from "@frejun/teler";
const client = new Client(process.env.TELER_API_KEY!); // test API key
const call = await client.voice.calls.create({ fromNumber: "+91XXXXXXXXXX", // sandbox reference number toNumber: "+91XXXXXXXXXX", // a verified number flowUrl: "https://your-domain.com/flow", statusCallbackUrl: "https://your-domain.com/webhook",});console.log(call.id);curl -X POST https://api.frejun.ai/api/v1/voice/calls/initiate \ -H "Content-Type: application/json" \ -H "X-API-Key: $TELER_API_KEY" \ -d '{ "from_number": "+91XXXXXXXXXX", "to_number": "+91XXXXXXXXXX", "flow_url": "https://your-domain.com/flow", "status_callback_url": "https://your-domain.com/webhook" }'For a SIP Trunk, import the sandbox reference number into your AI agent platform or SIP system and place calls from it. The same verified-number rule applies.
Inbound calls
Section titled “Inbound calls”Every Voice App and SIP Trunk created in the sandbox mode gets a 4-digit PIN. The PIN tells Teler which app or trunk the call is for.
- From a verified number, dial your sandbox virtual number.
- When prompted, enter the 4-digit PIN of the Voice App or SIP Trunk you want to test.
- Teler routes the call the way that app or trunk is configured: it fetches the Voice App’s Call Flow, or forwards the call over the SIP Trunk’s inbound route.
Next steps
Section titled “Next steps” Sandbox numbers Reference and virtual numbers, and how to verify your own numbers.
Call Flows The JSON your flow URL returns to control the call.
Call events Lifecycle webhooks for your test calls.