1. Bulk dialer with retries

Run a campaign from a CSV at 5 cps, retry busy / no-answer numbers once.
import asyncio, csv
from collections import defaultdict
from telequick.client import TeleQuickClient
from telequick.method_id import MethodID

RETRY_CAUSES = {{17, 18, 19}}  # busy, no-user-response, no-answer

async def run_campaign(csv_url: str):
    client = TeleQuickClient(
        "quic://engine.telequick.dev:9090",
        "/etc/telequick/service-account.json",
    )

    final_cause: dict[str, int] = {{}}
    retried: set[str] = set()

    def on_event(payload):
        sid, status = client.deserialize_call_event(payload)
        # Real apps should parse the full CallEvent for q850_cause; this
        # shorthand uses status as a proxy.
        if status in ("BUSY", "NO_ANSWER"):
            final_cause[sid] = 17

    client.on_call_event = on_event

    async with client.connect_async():
        await client.originate_bulk(
            csv_url=csv_url,
            trunk_id="default",
            calls_per_second=5,
            max_concurrent=50,
            campaign_id="campaign-2026-04",
        )
        await asyncio.sleep(600)  # let it run for 10 minutes

asyncio.run(run_campaign("https://example.com/numbers.csv"))

2. AI voicebot — bridge to OpenAI Realtime

Hand inbound audio to OpenAI’s Realtime API; pipe its synthesized response back to the caller.
import asyncio, base64, json, websockets
from telequick.client import TeleQuickClient

REALTIME_URL = "wss://api.openai.com/v1/realtime?model=gpt-realtime"

async def ai_bot(call_sid: str):
    client = TeleQuickClient("quic://engine.telequick.dev:9090", "/etc/svc.json")
    realtime = await websockets.connect(
        REALTIME_URL,
        extra_headers={{"Authorization": f"Bearer {{os.environ['OPENAI_API_KEY']}}"}}
    )

    async def voice_to_ai(payload):
        pcm = client.deserialize_audio_frame(payload)
        await realtime.send(json.dumps({{
            "type": "input_audio_buffer.append",
            "audio": base64.b64encode(pcm).decode(),
        }}))

    client.on_audio_frame = voice_to_ai

    async with client.connect_async():
        await client.dial(
            to=call_sid,
            trunk_id="default",
            ai_websocket_url=REALTIME_URL,
        )

        async for msg in realtime:
            ev = json.loads(msg)
            if ev["type"] == "response.audio.delta":
                pcm = base64.b64decode(ev["delta"])
                await client.push_audio(call_sid, pcm)
The same pattern works with Anthropic, Deepgram, ElevenLabs, etc. The SDK doesn’t know or care what’s on the other side of the audio pipe.

3. Click-to-answer agent (inbound)

Show ringing calls in a CLI; let the operator pick one to answer.
import asyncio
from telequick.client import TeleQuickClient

async def main():
    client = TeleQuickClient("quic://engine.telequick.dev:9090", "/etc/svc.json")

    async with client.connect_async():
        # Configure inbound trunk: queue calls, don't auto-answer.
        await client.set_inbound_routing(
            trunk_id="my-did-trunk",
            rule=2,  # NOTIFY_AND_HANGUP would NOT queue; we want HANDLE_AI=3
        )

        while True:
            await client.get_incoming_calls(trunk_id="my-did-trunk")
            print("> Enter call_sid to answer (or Enter to refresh):")
            sid = input().strip()
            if sid:
                await client.answer_incoming_call(
                    sid,
                    ai_websocket_url="",
                    ai_quic_url="",
                )

asyncio.run(main())

4. Cross-runtime fan-out — Python originator + browser listener

A Python service originates an AI call; a separate browser tab streams the live audio to a speaker. Both share the same call_sid.
# Python originator
async with client.connect_async():
    sid = "call-2026-04-26-001"
    await client.dial(
        to="sip:+15551234567@example.sip.livekit.cloud",
        trunk_id="default",
        call_sid=sid,
    )
    # Hand 'sid' off to your operator UI through any side channel.
// Browser audio listener (TypeScript SDK)
const client = new TeleQuickClient("https://engine.telequick.dev:9090", browserJwt, true);
client.onAudioFrame = (pcm) => playToSpeaker(pcm);
await client.connect();
// Subscribe to the same call_sid via streamEvents; no `barge` here —
// `barge` is the AI-interruption RPC, not a "join an existing call" call.
await client.streamEvents("operator-listener-1");
The gateway routes the same audio to both sides — neither needs to know the other exists.

5. Hold music + park

async with client.connect_async():
    sid = await client.dial(...)  # see quickstart
    # Park them with hold music after answer:
    await client.execute_dialplan(
        call_sid=sid,
        action=2,  # MUSIC_ON_HOLD
        app_args="https://cdn.example.com/hold-loop.wav",
    )
When the agent is ready:
await client.execute_dialplan(call_sid=sid, action=4)  # UNPARK_AND_BRIDGE