Skip to main content

siphon-control (Python)

Python client for the SIPhon external control plane (siphon-control.v1) — an ARI/ESL-class rail for driving handed-over calls out of process. Built with PyO3 over the async Rust client, so the wire is hidden: no manual JSON, no request-id bookkeeping.

Two connection modes

The plane runs in one of two modes; both are exposed here and share the SAME @on_call decorator and the SAME Call handle — only the transport differs.

  • Inbound-persistent (ControlClient) — the app dials siphon and holds one long-lived socket (does the hello handshake). Simplest to reason about; use it for development and single-process controllers.
  • Per-call-connect (ControlServer) — siphon dials the app per handed-over call, so the app is a WebSocket server. Each accepted connection owns exactly one call and the first frame is a pushed StasisStart (no hello). This is the documented production default for multi-pod controllers: because the accepting socket is the call, "the audio lands on the wrong pod" can't happen.

Inbound-persistent

import asyncio
from siphon_control import ControlClient, ControlError

client = ControlClient(app="ivr-app", token="s3cr3t",
                       url="ws://siphon:9090/control/ws")

@client.on_call
async def handle(call):
    await call.answer()
    try:
        await call.transfer("sip:agent@pbx")   # REFER, awaits correlated reply
    except ControlError as error:
        print("transfer rejected:", error.code)

asyncio.run(client.run())

Per-call-connect

import asyncio
from siphon_control import ControlServer, ControlError

server = ControlServer(app="ivr-app", token="s3cr3t", bind="0.0.0.0:8790")

@server.on_call
async def handle(call):
    await call.answer()
    try:
        await call.transfer("sip:agent@pbx")
    except ControlError as error:
        print("transfer rejected:", error.code)

asyncio.run(server.serve())

API

ControlClient (inbound-persistent)

  • ControlClient(app, token, url=…, protocol=1, reply_timeout_ms=…, reconnect_backoff_ms=…)
  • @client.on_call — register an async (or sync) per-call handler.
  • await client.connect() / await client.run() — connect / drive (reconnect + resync).
  • await client.command(verb, module=None, target=None, args=None) — the generic {module, verb, target, args} primitive for any adapter (SIP today; SMPP/SS7 later).
  • await client.describe() — adapter schema.
  • client.shutdown() — stop the client and unblock run().

ControlServer (per-call-connect)

  • ControlServer(app, token, bind="0.0.0.0:8790", reply_timeout_ms=…)bind is the address the app listens on for siphon to dial; the token is validated on the incoming upgrade.
  • @server.on_call — the SAME decorator + Call handle as ControlClient.
  • await server.bind() — bind the listener; resolves to the bound address string (bind to …:0 to learn the ephemeral port before siphon dials in).
  • server.local_addr — the bound address once bind() / serve() has run, else None.
  • await server.serve() / await server.run() — accept siphon's per-call dials forever (stop by cancelling the task).

Call (shared by both modes)

  • Call verbs: answer(), answer_with(code, …), progress(), reject(code, reason), hangup(reason=None), refer(to) / transfer(to), set_header(name, value), get_header(name), set_var(key, value), get_var(key), command(verb, args=None), next_event().
  • Media verbs play_file(file) / dtmf(digits) raise ControlError with code == "unsupported_verb" until the server implements media.

Errors

A rejected command raises ControlError carrying a stable .code (not_found, forbidden, unsupported_verb, unauthorized, …).

Build

maturin develop        # into the active venv
maturin build --release

The target interpreter is free-threaded CPython 3.14t (the SIPhon runtime); the wheel also loads on a standard GIL build.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

siphon_control-0.1.2.tar.gz (59.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

siphon_control-0.1.2-cp314-cp314t-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.14tWindows x86-64

siphon_control-0.1.2-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ x86-64

siphon_control-0.1.2-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.0 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ ARM64

siphon_control-0.1.2-cp314-cp314t-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

siphon_control-0.1.2-cp314-cp314-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.14Windows x86-64

siphon_control-0.1.2-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

siphon_control-0.1.2-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.0 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ ARM64

siphon_control-0.1.2-cp314-cp314-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

File details

Details for the file siphon_control-0.1.2.tar.gz.

File metadata

  • Download URL: siphon_control-0.1.2.tar.gz
  • Upload date:
  • Size: 59.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for siphon_control-0.1.2.tar.gz
Algorithm Hash digest
SHA256 43d99a674bcf371eecb10017e31ba75ca46a07a0c6d24ab89fc6f1c20b6dc8ff
MD5 abb92331396df47c9678ae24ad0e996f
BLAKE2b-256 a3b6dbef310d9d558e95fb6983d67367c16034f3fa33ee9ca346f6ee9d02b54c

See more details on using hashes here.

Provenance

The following attestation bundles were made for siphon_control-0.1.2.tar.gz:

Publisher: release-control-sdk.yaml on siphon-project/siphon-sip

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file siphon_control-0.1.2-cp314-cp314t-win_amd64.whl.

File metadata

File hashes

Hashes for siphon_control-0.1.2-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 4c034b5ba25f055d54f7644c510cefc05a09943452e9ff979ba3e8d9766c2b3f
MD5 a323e648816abda12a471437df229113
BLAKE2b-256 6c49a90f3753d2e6ce654f5407d81d575efc883c6bfcae8968574370d47e8d34

See more details on using hashes here.

Provenance

The following attestation bundles were made for siphon_control-0.1.2-cp314-cp314t-win_amd64.whl:

Publisher: release-control-sdk.yaml on siphon-project/siphon-sip

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file siphon_control-0.1.2-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for siphon_control-0.1.2-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f685a14a08003e2f7a7e2b277b21aed902c5516d3e4afd92be7af9a79891261c
MD5 a33a01f2a0d85bfac579680622b9633c
BLAKE2b-256 76751f458d5244e1702ffbeff289c89c6862de50d3cfe6b822b5bdf03fdf9010

See more details on using hashes here.

Provenance

The following attestation bundles were made for siphon_control-0.1.2-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release-control-sdk.yaml on siphon-project/siphon-sip

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file siphon_control-0.1.2-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for siphon_control-0.1.2-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f08094c3801951097ca94fabc3c72b9de4dc12abcbeca325a47b64dc3335c337
MD5 765b68b1ae062898a8f6a58e252c0053
BLAKE2b-256 7cfeefc9cd5626bed62dd54a02db7a0fdc468718a3d36c9037fa907800db8a8a

See more details on using hashes here.

Provenance

The following attestation bundles were made for siphon_control-0.1.2-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release-control-sdk.yaml on siphon-project/siphon-sip

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file siphon_control-0.1.2-cp314-cp314t-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for siphon_control-0.1.2-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 03d319eff7ae199e0ac69dc77650c22ca3c2a8ab86eeb9172880bbd548a7ce75
MD5 d8e871849636fb9858283bca733dcf69
BLAKE2b-256 5d0f4e076250d3ff13f2a52c3ef0556b0632ebdfe20bef64216422f0975663c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for siphon_control-0.1.2-cp314-cp314t-macosx_11_0_arm64.whl:

Publisher: release-control-sdk.yaml on siphon-project/siphon-sip

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file siphon_control-0.1.2-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for siphon_control-0.1.2-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 ebc84b5fe07cf8c1e1acff71d65d1d8c77e2d38b0f2e5b31d4e4c3a049a59d0c
MD5 5e3e949c64fd21783ded2a687024a9c9
BLAKE2b-256 4034a3c523caa94f00353d446142a0772bb1a1fccacb9f09734c680aea06528b

See more details on using hashes here.

Provenance

The following attestation bundles were made for siphon_control-0.1.2-cp314-cp314-win_amd64.whl:

Publisher: release-control-sdk.yaml on siphon-project/siphon-sip

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file siphon_control-0.1.2-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for siphon_control-0.1.2-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a41f28586e359ba09410c4e9faecd405659a846c6cbc264afb384acc05aaece2
MD5 dc3279674a390d6499f69cc85624b308
BLAKE2b-256 92e904a5460107aa2466e07fd3e417b70a1778c75f8576d97645f2168aa70523

See more details on using hashes here.

Provenance

The following attestation bundles were made for siphon_control-0.1.2-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release-control-sdk.yaml on siphon-project/siphon-sip

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file siphon_control-0.1.2-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for siphon_control-0.1.2-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 24e791fae7c1de9e74420b180f0ba455954d8494d14064362589a42efc191309
MD5 d4319a56b2b60b97d711d43bf04c2021
BLAKE2b-256 db1b49dc1dcc2e31ecaec1a26908c9cddf1dd765f8611a603d71766132e7f811

See more details on using hashes here.

Provenance

The following attestation bundles were made for siphon_control-0.1.2-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release-control-sdk.yaml on siphon-project/siphon-sip

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file siphon_control-0.1.2-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for siphon_control-0.1.2-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1ea52afed942adfdf756ceb48647514e83f93bc2611ce46c25c6f708ca50869b
MD5 957dea5f6d4285a729f5f81b50430762
BLAKE2b-256 0a24b1b00bd631342029f9a1d22b862ca3c33ea15740587d5a949a548ba2165a

See more details on using hashes here.

Provenance

The following attestation bundles were made for siphon_control-0.1.2-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: release-control-sdk.yaml on siphon-project/siphon-sip

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.2 This release

9 files

0.1.1

9 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page