-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No event is being captured #49
Comments
Do you have more info about the |
astmanager] ; this must be generated automatically |
I have even tried read=all and write = all |
Your settings looks right for me I'm running it: # ...
def event_notification(source, event):
print(event)
client = AMIClient(**connection)
future = client.login(**login)
if future.response.is_error():
raise Exception(str(future.response))
print(future.response)
client.add_event_listener(event_notification)
# ... And getting this: Response: Success
ActionID: 0
Message: Authentication accepted
Event : SuccessfulAuth -> {'Privilege': 'security,all', 'EventTV': '2022-04-18T11:44:12.568+0000', 'Severity': 'Informational', 'Service': 'AMI', 'EventVersion': '1', 'AccountID': 'admin', 'SessionID': '0x7fdeec002b60', 'LocalAddress': 'IPV4/TCP/0.0.0.0/5038', 'RemoteAddress': 'IPV4/TCP/127.0.0.1/39788', 'UsingPassword': '0', 'SessionTV': '2022-04-18T11:44:12.568+0000'} |
Same trouble. with previous version no problem to get the event. but now no event caugth. with no timeout set (as it is in previous version), events are well caught |
Same here |
You can workarround this problem by passing the timeout parameter to the initialization of client: client = asterisk.ami.AMIClient(address='127.0.0.1',port=5038,timeout=None) |
#!/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:
time.sleep(10)
except (KeyboardInterrupt, SystemExit):
client.logoff()
this code is running without error but shows no even on the terminal when I run it
The text was updated successfully, but these errors were encountered: