Skip to main content
Dograh is an open-source, self-hostable voice AI platform for building phone agents. Plivo Audio Streaming bridges a phone call to a Dograh voice agent over a WebSocket.

How it works

Call flowDograh
  1. Phone Call
    PlivoAudio Stream
    DograhVoice agent
Dograh handles the Plivo setup. It creates a Plivo Application and points the Application’s Answer URL to a Dograh endpoint, so hosting an Answer URL is not required. The Dograh endpoint hosts the WebSocket server that streams the call’s audio. On a call, Plivo requests the Answer URL of the auto-created Application and connects to Dograh’s WebSocket server, then streams the live call audio in both directions. Dograh’s voice agent transcribes the caller, generates a response, and streams the reply back as speech to Plivo over the same WebSocket.

Prerequisites


Outbound call setup

For outbound calls, Dograh dials out with a caller ID from the Plivo configuration. No Plivo console changes are required.
1

Get the Plivo credentials

Sign in to the Plivo console and copy the Auth ID and Auth Token from the dashboard.
2

Add a Plivo configuration in Dograh

Send the Plivo credentials to Dograh, authenticated with a Dograh API key.The application_id should be unset and Dograh creates a Plivo Application automatically.
  • config.auth_id, config.auth_token — the Plivo Auth ID and Auth Token.
  • is_default_outbound: true — makes this the default configuration for outbound calls.
Refer to Create a telephony configuration for all parameters.
The response returns the configuration’s ID. Use it as the config_id when adding the default caller ID in the next step.
3

Add the default caller ID

Add a phone number to the saved configuration in E.164 format, for example +14150000001. This is the From number (the caller ID) for outbound calls.
Add the number to the configuration and mark it as the default caller ID, authenticated with a Dograh API key.Use the config_id returned when the configuration is created, or shown on the saved configuration in Dograh.
  • address — the phone number in E.164 format.
  • is_default_caller_id: true — makes it the default caller ID for outbound calls.
Refer to Add a phone number for all parameters.
This number is not linked to a specific agent. Any agent can use this number as its caller ID when the call is started in Dograh.
4

Place an outbound call

Trigger a Dograh agent to call a destination number. The call dials from the default caller ID set above.
Dograh dials the destination number and runs the agent on the call, authenticated with a Dograh API key.
  • workflow_uuid — in the URL path, the agent that places the call.
  • phone_number — the destination number in E.164 format.
  • telephony_configuration_id — optional, routes the call through a specific configuration instead of the default.
Refer to Trigger an outbound agent run for all parameters.
On a self-hosted deployment, Dograh must be reachable at a public URL so Plivo can fetch the Answer URL and open the call’s media WebSocket. See Self-hosted setup for how to set this up.

Inbound call setup

For inbound calls, an external caller dials the Plivo number. The number must route to the Plivo Application that holds Dograh’s Answer URL, and it needs an inbound workflow that decides which agent answers.
1

Get the Plivo credentials

Sign in to the Plivo console and copy the Auth ID and Auth Token from the dashboard.
2

Add a Plivo configuration in Dograh

Send the Plivo credentials to create the configuration and add the inbound number, authenticated with a Dograh API key.The application_id should be unset and Dograh creates a Plivo Application with the Answer URL already set.Refer to Create a telephony configuration and Add a phone number for all parameters.
4

Assign an inbound workflow

Each inbound number needs an inbound workflow, which is the agent that answers calls to the number.
Update the phone number in Dograh to set its inbound workflow, authenticated with a Dograh API key.
  • inbound_workflow_id — the workflow that answers calls to the number.
  • clear_inbound_workflow: true — removes the workflow later. On its own, inbound_workflow_id: null is treated as no change.
Refer to Update a phone number for all parameters.
5

Receive an inbound call

Once the workflow is saved, calls to this number are answered by the assigned agent.
A single Plivo configuration can hold multiple phone numbers, each with its own Inbound workflow.

Self-hosted setup

The Plivo integration works the same on Dograh Cloud and on a self-hosted instance. The only difference is that Plivo has to reach the self-hosted instance directly, so it needs a public HTTPS address. Dograh handles this automatically. Its self-hosting guide starts the whole stack with a single Docker command, and this command brings up a Cloudflare tunnel that exposes the instance at a public HTTPS URL. This default tunnel needs no Cloudflare account or token but the tunnel’s subdomain changes each time it restarts. Dograh uses the URL as the base of the Answer URL that Plivo fetches, for example https://<random>.trycloudflare.com/api/v1/telephony/inbound/run. For a stable hostname, run a named Cloudflare tunnel. This requires a Cloudflare account, and the same guide walks through the setup. Once Dograh is reachable at its public URL, the outbound and inbound setup is identical to Dograh Cloud.

Troubleshooting


Plivo Audio Streaming

How Plivo streams call audio over a WebSocket.

Dograh

The open-source Dograh voice AI platform.

Dograh Plivo docs

Dograh’s own Plivo configuration reference.