python-ami
python-ami copied to clipboard
Python AMI Client
#!/usr/bin/python import os import time from asterisk.ami import AMIClient from asterisk.ami import EventListener def event_listener(event,**kwargs): print(event) client = AMIClient(address='127.0.0.1',port=5038) future = client.login(username='astmanager',secret='Xn75CFbVfjRg71v') if future.response.is_error(): raise Exception(str(future.response)) client.add_event_listener(event_listener) try: while True:...
hi, in the telenet I successfully get the queue state, the same thing in python comes empty. what's wrong?  `client = AMIClient(address='чччччч',port=5038) client.login(username='python',secret='5bdadc4820df193691d5848b8cb566de') action = SimpleAction( 'QueueStatus',) resp1=client.send_action(action) response3...
Action: UpdateConfig ActionID: SrcFilename: DstFilename: Reload: PreserveEffectiveContext: **Action-000000:** Cat-000000: Var-000000: Value-000000: Match-000000: Line-000000: Options-000000: ``` action = SimpleAction('UpdateConfig', reload='yes', dstfilename='test.conf', srcfilename='test.conf', Action-000000='NewCat', Cat-000000='test', Var-000000='foo', Value-000000='bar') ``` ` SyntaxError: expression cannot...
Hello. I've added fix to to the bug https://github.com/ettoreleandrotognoli/python-ami/issues/26. Thank you.
Hey. Faced a problem. When a session fails, it often does not work through reconnection. The try_reconnect method goes into an infinite loop and always throws a BrokenPipeError exception: [Errno...
Hello, how about to add option of secure connection to AMIClient?!
module 're' has no attribute '_pattern_type'
Boa tarde. estou tentando dar um playback em uma extensão que esta ativa. mas ele so retorna `None` ``` action = SimpleAction( 'Originate', Channel='SIP/12-0000002c', Exten='12', Application='Playback', Data='/home/asterisk/apiinter/ativa.wav' ) future =...
Hello. Unfortunately, AMIClient dispatches responses and events incorrectly. There are a few types of responses which is marked as EventList. These responses contain a several elements divided by '\r\n\r\n'. As...