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.1.tar.gz (47.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.1-cp314-cp314t-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.14tWindows x86-64

siphon_control-0.1.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ x86-64

siphon_control-0.1.1-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.8 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ ARM64

siphon_control-0.1.1-cp314-cp314t-macosx_11_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

siphon_control-0.1.1-cp314-cp314-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.14Windows x86-64

siphon_control-0.1.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

siphon_control-0.1.1-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.8 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ ARM64

siphon_control-0.1.1-cp314-cp314-macosx_11_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: siphon_control-0.1.1.tar.gz
  • Upload date:
  • Size: 47.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.1.tar.gz
Algorithm Hash digest
SHA256 e34a5fc17ebcb1c3c2899054d1e9d961e08c7f7103bf299cb510c520c7d744e7
MD5 ae226a24ac8cd579fbbc3fbc139787a7
BLAKE2b-256 8882e6f17d301d9b28e76be58cbb274e37f60a1e25b3ebea25502652cbce81d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for siphon_control-0.1.1.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.1-cp314-cp314t-win_amd64.whl.

File metadata

File hashes

Hashes for siphon_control-0.1.1-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 337082d244ee13605428a844fdd1b3145e58e11971ccd8d97d30e9ba39e81310
MD5 78432ee2d2b3c20afbb027f374d43e61
BLAKE2b-256 183cfad7fe25b3b5c1f9aefa5cb1fc7a059dbcd7cd9d95b167945a1d5d7b749b

See more details on using hashes here.

Provenance

The following attestation bundles were made for siphon_control-0.1.1-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.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for siphon_control-0.1.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2e56914383a1e6f39f60cd89fdaf3239fd5dbea04d65102b6a86285ae1fea6c9
MD5 577447aef258395a6713fb2d60360ac4
BLAKE2b-256 3864df66fcaf5b92cfa62915899224abebe4c9207bf64477c11fcef7429ef2a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for siphon_control-0.1.1-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.1-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for siphon_control-0.1.1-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f2e36a5eea6ff0b0646b8d5098aaf1dc80c18a70bc16edf6eea5009a0bee936b
MD5 ae4c6148fa74a3e16c25fbb1bde7e0ae
BLAKE2b-256 317a2edb2b489238bfec8a986f56d21a04fc0004543eca0dc461ff23a1395f9b

See more details on using hashes here.

Provenance

The following attestation bundles were made for siphon_control-0.1.1-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.1-cp314-cp314t-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for siphon_control-0.1.1-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0bee299219b5d00ab2a10918caefd2163c09313cceef398e7004640ccec5b33c
MD5 5900ba345e8aca2618ad8579ee4cab7c
BLAKE2b-256 a845f1f6375c113cfc3d3edc6360e20198ed961f4554cb4cc182c593ff9c2377

See more details on using hashes here.

Provenance

The following attestation bundles were made for siphon_control-0.1.1-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.1-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for siphon_control-0.1.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 d6723c5d7f2f78ca81309af747675b9955aff9f5d409c0befcdcdc59d7114e43
MD5 e603620e0d92d933e0fa751ab462039a
BLAKE2b-256 1d07fc7f6e8dcc0fe8422bf2cecb7c2d883a40d1c8e01242936fcd01c3d18dc4

See more details on using hashes here.

Provenance

The following attestation bundles were made for siphon_control-0.1.1-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.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for siphon_control-0.1.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 97535757cafe35b07eb289ebdea0d27fcfa0501d0725e17c898453c2beeb1dff
MD5 a142c34164f52908861a2bc6d9ad6959
BLAKE2b-256 1050a310bb5dff631a756e893a0f3e68cf53832938efefef3a8186015edc93e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for siphon_control-0.1.1-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.1-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for siphon_control-0.1.1-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 531485bb54e11fb0673d0aeb674a525905aedaab1b277dc7ce8542c44e9dd3a7
MD5 58b13f939368e0e3f0f1480009015214
BLAKE2b-256 a4139fb2d59250c560259462a5f9b9717cf569755a9fb40e8d634457de548704

See more details on using hashes here.

Provenance

The following attestation bundles were made for siphon_control-0.1.1-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.1-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for siphon_control-0.1.1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6fb9257198d3fba5c48c3aa3b21ba01eba0dbf4ff4107d1e8ff7bad4f7ddc89c
MD5 79bd8e992f1d8800bdae5f539297f3da
BLAKE2b-256 828d057c2e2268387cfe717f3e781bbb2307852d3bc5ff784c2792660d660458

See more details on using hashes here.

Provenance

The following attestation bundles were made for siphon_control-0.1.1-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

0.1.2

9 files

This release

0.1.1 This release

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