Skip to main content

AsyncIO-based Asterisk Manager Interface (AMI) client for Python

Project description

basicami

AsyncIO-based Asterisk Manager Interface (AMI) client for Python.

Companion to basicagi.

Install

pip install basicami

Usage

import asyncio
from basicami import BasicAMI

async def main():
    ami = await BasicAMI.connect("localhost", 5038, "admin", "secret")

    # Send any AMI action
    resp = await ami.send_action({"Action": "Ping"})
    print(resp)

    # Originate a call
    resp = await ami.originate(
        channel="Local/100@from-internal",
        application="Wait",
        data="30",
        caller_id="Test <15550099999>",
        timeout=30,
    )

    # Collect events
    events = await ami.get_events(timeout=2.0)
    for event in events:
        print(event)

    await ami.close()

asyncio.run(main())

Marker Parsing

Includes a marker parser for Asterisk Verbose/Log markers used in PBX testing:

from basicami import parse_marker, MarkerTrace

marker = parse_marker("SBC_ENTER: 001D tenant=001D-dev-testing")
print(marker.name)     # "SBC_ENTER"
print(marker.context)  # "001D"
print(marker.kv)       # {"tenant": "001D-dev-testing"}

License

MIT

Project details


Download files

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

Source Distribution

basicami-0.1.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

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

basicami-0.1.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file basicami-0.1.0.tar.gz.

File metadata

  • Download URL: basicami-0.1.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for basicami-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6a33e8a2dd8e0ee58b8fc12902c25be1a146269f9ddaa570e0cf1f2a0e072f2e
MD5 c8d1794ba9f360e6b9f08a87f378361a
BLAKE2b-256 210e4c355e11aa58fb591c55c27ed1be3d077597aa21c8521701804aeee8666a

See more details on using hashes here.

Provenance

The following attestation bundles were made for basicami-0.1.0.tar.gz:

Publisher: ci-cd.yml on andrius/asterisk-basicami

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

File details

Details for the file basicami-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: basicami-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for basicami-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9247642903172e7a1fa546d21d9ae022f86637da0343524dad01e92f55144cc1
MD5 f41367714b2f7eb36bb7764952325b39
BLAKE2b-256 588e79635b49f06a42ac6e62ea3fb969c13704e7f19785342e3f4087463857fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for basicami-0.1.0-py3-none-any.whl:

Publisher: ci-cd.yml on andrius/asterisk-basicami

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

Supported by

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