Skip to content

Add a Plivo telephony example #44

Description

@sarveshpatil-plivo

What

Currently voice-examples/agent/telephony/ has one example, xai/, a Grok-native integration over Twilio Media Streams. We'd like to add a second telephony provider, Plivo, as a sibling example.

Proposed structure

We'd suggest grouping by provider under xai/, moving the current example into xai/twilio/ and adding xai/plivo/ alongside it:

voice-examples/agent/telephony/
  xai/
    twilio/    (the current xai/ example)
    plivo/     (new)

It keeps the examples consistent as more providers are added, and shows Grok working across different telephony providers.

Why

Grok realtime uses mu-law 8 kHz audio (audio/pcmu). Plivo Audio Streaming is also mu-law 8 kHz, so the bridge forwards audio both ways with no transcoding or resampling, a minimal and easy-to-follow example. It also shows the realtime pattern isn't tied to a single telephony provider.

What the Plivo example covers

Mirrors the existing xai/ example:

  • Node and TypeScript, Express with express-ws
  • Inbound calls (answer webhook + media stream) and outbound calls
  • Bidirectional mu-law 8 kHz passthrough between Plivo and Grok realtime
  • Barge-in, i.e. bot audio is cleared when the caller starts speaking

Additional functionality:

  • A sample tool call (end the call)
  • Startup auto-provisioning that points a Plivo application at the server webhooks

The Plivo example is complete and verified end to end against a live Plivo account — inbound call, outbound call, barge-in, and the end-call tool all work. Ready to open the PR once you let us know the structure you'd prefer, and we're happy to match it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions