A Python client for the Issabel PBX REST API (pbxapi). Supports dynamic CRUD for all 40+ resources, batch provisioning with a single final reload, and a full Asterisk Manager Interface (AMI) wrapper.
Features
- Dynamic method generation — Automatic CRUD for all PBX resources (
get_,create_,update_,delete_). - Batch provisioning —
with client.batch():runs N write operations with zero per-call reloads; onemanager/reloadfires automatically at the end. - AMI wrapper (
client.manager) — All 18 Asterisk Manager actions:originate,queuestatus,dbget,dbput,hangup,reload, and more. - Automatic token renewal — Detects HTTP 401 and legacy
{"status": "expired"}responses and renews transparently. - Read-only guards —
NotImplementedErrorraised client-side for write attempts on read-only resources. - Configurable timeout — All HTTP calls share a single
timeoutsetting. - Context manager —
with IssabelClient(...) as client:closes the session on exit. - SSL support — Configurable certificate verification (self-signed certs common on PBX appliances).
Installation
pip install issabel-sdk
Or from source:
git clone https://gitlab.com/libandpackages/issabel-sdk.git
cd issabel-sdk
pip install -e .[dev]
Quick Start
from issabel_client import IssabelClient
with IssabelClient("your-pbx-ip", use_ssl=True, verify_ssl=False) as client:
client.authenticate("admin", "yourpassword")
# List all extensions
extensions = client.get_extensions()
# Create one with immediate reload (default)
client.create_extensions({"extension": "2000", "name": "John Doe", "secret": "pswd123"})
# Batch provisioning — single reload at the end
with client.batch():
for ext in range(3001, 3100):
client.create_extensions({"extension": str(ext), "name": f"User {ext}", "secret": "s3cr3t"})
# ↑ Asterisk reloaded exactly once here
# AMI: originate a call
client.manager.originate(channel="SIP/1001", extension="1002", context="from-internal", priority=1)
# AMI: reload Asterisk manually
client.manager.reload()
Documentation
Full usage guide, payload schemas, and the complete resource catalogue are in docs/documentation.md.
Examples
Ready-to-run scripts are in the examples/ directory:
Contributing
Pull Requests are welcome at gitlab.com/libandpackages/issabel-sdk. Please run pytest and flake8 before submitting.
Resource Capabilities
| Category | Resources |
|---|---|
| Full CRUD | announcements, blacklist, bosssecretary, callback, callflow, cidlookup, classofservice, conferences, customdestinations, customextensions, dahdichanneldids, dialplaninjection, disa, dynamicroutes, extensions, inboundroutes, ivr, languages, mailboxes, miscapplications, miscdestinations, musiconhold, outboundroutes, paging, parkinglots, pinsets, queuepriorities, queues, recordingrules, recordings, ringgroups, setcallerid, timeconditions, timegroups, trunks, vmblast, writequeuelog |
| GET + PUT only | classofserviceadmin, routecongestionmessages |
| Read-only | alldestinations, allextensions, featurecodes, modules, systemrecordings |
| AMI wrapper | client.manager.originate, .queuestatus, .dbget, .dbput, .dbdel, .reload, .hangup, and 11 more |
License
MIT — see LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file issabel_sdk-0.2.0.tar.gz.
File metadata
- Download URL: issabel_sdk-0.2.0.tar.gz
- Upload date:
- Size: 15.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fff9948ba27f87039de68a4d62548c5b1c9031ae17e68052d7f99aa3d72e966f
|
|
| MD5 |
cfa57a38997911c6d5e699ce9a457756
|
|
| BLAKE2b-256 |
6ccb263c5553cb73673c42e0be4ec2f7982a99dea90f7da21eac07bab9afd600
|
File details
Details for the file issabel_sdk-0.2.0-py3-none-any.whl.
File metadata
- Download URL: issabel_sdk-0.2.0-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14690dfc07a8f26898cb07e89cb8a7dd436ac3739a8b1d15276049e476bdb617
|
|
| MD5 |
e4a2463aabc0eddf4f3d23c5ba4f599c
|
|
| BLAKE2b-256 |
e0eb15b035d2ea5ccd902221f7622ee214dbb9e3c05ad4a1c1b41d3880aaf441
|