Posts

Showing posts from February, 2018

Asterisk-AMI

Install Install asterisk-ami pip install asterisk-ami Install latest asterisk-ami pip install git+https://github.com/ettoreleandrotognoli/python-ami Usage Connect from asterisk.ami import AMIClient client = AMIClient ( address = '127.0.0.1' , port = 5038 ) client . login ( username = 'username' , secret = 'password' ) Disconnect client . logoff () Send an action from asterisk.ami import SimpleAction action = SimpleAction ( 'Originate' , Channel = 'SIP/2010' , Exten = '2010' , Priority = 1 , Context = 'default' , CallerID = 'python' , ) client . send_action ( action ) Send an action with adapter from asterisk.ami import AMIClientAdapter adapter = AMIClientAdapter ( client ) adapter . Originate ( Channel = 'SIP/2010' , Exten = '2010' , Priority = 1 , Context = 'default' , CallerID = '