Skip to content
Nameko Asterisk Manager Interface client
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Nameko AMI client

Example of usage

from import EventDispatcher
from nameko.dependency_providers import Config
from nameko.rpc import rpc
from nameko_ami import AmiClientExtension, ami

logger = logging.getLogger(__name__)

class AmiBroker:
    name = 'asterisk_ami'
    config = Config()
    ami_client = AmiClientExtension()
    dispatch = EventDispatcher()

    def send_action(self, action):
        result = self.ami_client.manager.send_action(action)        
        return {
            'headers': result.headers,

    def on_ami_event(self, event, manager):
        if self.config.get('ASTERISK_AMI_TRACE_EVENTS'):
            logger.debug('AMI Event: %s', event.headers)
        self.dispatch(event.headers['Event'], {'headers': event.headers,

You can’t perform that action at this time.