Skip to content
@x-phone

x-phone

Embeddable SIP/RTP libraries for real applications. Tested, scriptable, open-source.

x-phone

Open-source SIP/RTP library for making real phone calls from code.

License: MIT


xphone is a single library — no gateway, no PBX, no infrastructure to deploy. Add it to your project, point it at a SIP trunk, and you're making real phone calls. Available in Go and Rust.

Go · Go Reference

phone := xphone.New(
    xphone.WithCredentials(
        "agent", "secret", "sip.provider.com",
    ),
)

phone.OnIncoming(func(call xphone.Call) {
    call.Accept()
    // call.PCMReader() → your STT pipeline
})

phone.Connect(ctx) // ← that's it. Real calls.

xphone-go · pkg.go.dev

Rust · Crates.io

let phone = Phone::new(Config {
    username: "agent".into(),
    password: "secret".into(),
    host: "sip.provider.com".into(),
    ..Config::default()
});

phone.on_incoming(|call| {
    call.accept()?;
    // call.pcm_reader() → your STT pipeline
    Ok(())
});

phone.connect()?; // ← that's it. Real calls.

xphone-rust · docs.rs

SIP registration, RTP media, codec negotiation, NAT traversal — xphone handles the protocol complexity. You get clean PCM audio frames in and out.

Use xphone directly in Go or Rust for full control over calls and media. Use xbridge when you want REST/WebSocket access from any language without writing SIP code.

Who is this for?

  • AI voice agent builders — pipe call audio into your STT/LLM/TTS pipeline without a telephony platform
  • VoIP developers — embed SIP calling into any app with a clean, testable API
  • Teams moving off hosted voice APIs — own the media path, run on your infra

What xphone handles

SIP signaling · RTP media · SRTP (SDES; see per-project docs for transport security details) · G.711, G.722, Opus, G.729 · H.264, VP8 · STUN/TURN/ICE-Lite · hold, transfer, mute, DTMF · SIP MESSAGE, presence, BLF

Tested against

  • SIP trunks: Telnyx, Twilio SIP, VoIP.ms, Vonage
  • PBXes: Asterisk, FreeSWITCH, 3CX
  • Test infrastructure: fakepbx (in-process SIP server, real SIP over loopback) + xpbx (Dockerized Asterisk) in CI
  • Unit tests: MockPhone & MockCall — test call flows without any SIP server

See each repo's README for detailed compatibility notes.

What xphone is not

  • Not a hosted platform. No cloud service, no dashboard, no managed infrastructure. You run it, you operate it.
  • Not a full Twilio replacement. xphone is the voice data plane — SIP and media. Billing, number provisioning, call routing rules, recording storage, and HA are your responsibility.
  • Not batteries-included for security. SRTP is SDES-based. DTLS-SRTP is not currently supported. See each repo's README for the current security surface.

Status — Beta

xphone is in active development and used in internal production workloads. APIs may change between minor versions. If you're evaluating, start with the examples and xphone-go (the more mature implementation).

Other repositories

Project Status What it does
xbridge Active Self-hosted voice gateway — exposes xphone as WebSocket audio + REST API. Single-node, stateless. For teams using Python, Node, or other languages without a native xphone library.
xpbx Active Dockerized Asterisk PBX with web UI — useful for local development and testing against a real PBX.
fakepbx Stable In-process SIP server for Go tests. Real SIP over loopback — no Docker, no Asterisk.
fakepbx-rust Stable Same concept for Rust tests.
demos Active Working examples for the x-phone ecosystem. Start here if you're evaluating.

MIT Licensed · Built with Rust and Go

Popular repositories Loading

  1. xphone-rust xphone-rust Public

    Rust library for SIP calling and RTP media — register with a trunk or accept calls as a SIP server. Decoded PCM audio via crossbeam channels.

    Rust 3

  2. xphone-go xphone-go Public

    Go library for SIP calling and RTP media — register with a trunk or accept calls as a SIP server. Decoded PCM audio via Go channels.

    Go 2

  3. xbridge xbridge Public

    Self-hosted voice gateway — connects SIP phone calls to WebSocket audio and REST API. Single binary, stateless, Twilio-compatible WebSocket framing.

    Rust 2

  4. fakepbx fakepbx Public

    In-process SIP server for Go tests. Real SIP over loopback — no Docker, no Asterisk, no hardcoded ports.

    Go 1

  5. xpbx xpbx Public

    Dockerized Asterisk PBX with web management UI — extensions, trunks, and dialplan management out of the box.

    Go 1

  6. .github .github Public

    Organization profile and community health files

Repositories

Showing 8 of 8 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…