Skip to main content

Telephony Overview

Overview

This page provides an overview of setting up and managing telephony for Piopiy Voice AI.

Piopiy allows you to purchase phone numbers, map them to your Voice AI agents, and build sophisticated voice logic using our WebRTC-ready framework.

Telephony at a glance
from piopiy.agent import Agent

# Connect your agent to the Piopiy telephony network
agent = Agent(
agent_id="your_agent_id",
agent_token="your_agent_token",
create_session=create_session
)
await agent.connect()

With Piopiy, you buy numbers in the portal, map them to your Voice AI agent, and build only the Voice AI logic in your orchestrator.

TeleCMI Transport uses a WebRTC stack with PSTN, so your telephony setup is production-ready from day one.

Key Terms

  • PSTN: Traditional public phone network used for inbound/outbound calls.
  • WebSocket: Real-time audio stream channel between telephony provider and your runtime.
  • WebRTC: Real-time media stack optimized for network variation and production-grade streaming.

Telephony Connection Options

WebSocket Telephony

Best for basic telephony workflows.

  • Direct audio streaming over WebSocket
  • Fast setup path
  • Good for standard inbound/outbound voice flows
  • Supported by Piopiy, but typically used for simpler/controlled traffic profiles

WebRTC Telephony Stack

Best for production deployments.

  • Better handling of real-world network conditions
  • Stable low-latency media path
  • Recommended when quality, reliability, and high call volume matter

Why Not WebSocket as Primary Production Path

WebSocket is fully supported, but for high-scale production telephony, Telephony + WebRTC is usually the better default.

  • WebRTC handles jitter/loss variation better in real network conditions
  • WebRTC media path is more resilient for long-running live calls
  • Better consistency under concurrent call load
  • Smoother real-time voice quality for production traffic

Use WebSocket when you want a lightweight integration path. Use Telephony + WebRTC when you need stronger production stability and scale.

Use TeleCMI Transport (WebRTC stack + PSTN) for production workloads.

Prerequisites

  • Piopiy dashboard account:
  • Agent created in portal with AGENT_ID and AGENT_TOKEN
  • Phone number purchased from Piopiy portal
  • Number mapped to your Voice AI agent in routing settings
  • STT provider key ready
  • LLM provider key ready
  • TTS provider key ready
  • Runtime environment for your Voice AI orchestrator

How to Set Up

  1. Create your Voice AI agent in portal.
  2. Buy a phone number from portal.
  3. Map number routing to your Voice AI agent.
  4. Configure STT, LLM, and TTS provider credentials.
  5. Start your Voice AI orchestrator runtime.
  6. Place test calls and validate voice quality, latency, and call flow.