Comments (13)
The events don't go to the response, you need to add a listener to collect them
This is the response:
Response: Success
...
This
Event: QueueParams
...
and this:
Event: QueueMember
...
are events
from python-ami.
Work!
but after a minute of work, freepbx (DOWN) freezes, . although I filter events.
how can I get a QueueStatus response?, because here I get queue joining events, and I need queue agents registered at this moment
from python-ami.
The events don't go to the response, you need to add a listener to collect them
This is the response:
Response: Success ...
This
Event: QueueParams ...
and this:
Event: QueueMember ...
are events
Thank you, I didn't understand how to do it? response
this is the 'asterisk.ami.response' type.Response'> . Do I need to iterate somehow? then how? or send response 3 to
def event_listener(event,**kwargs):
from python-ami.
try something like that:
def event_listener(event):
print(event)
# add the event listener before send the action
client.add_event_listener(event_listener)
future = client.send_action(action)
print(future.response)
from python-ami.
try something like that:
def event_listener(event): print(event) # add the event listener before send the action client.add_event_listener(event_listener) future = client.send_action(action) print(future.response)
from python-ami.
But this time you sent the action twice, in the lines 27 and 34
Try to add the listener before the line 27
from python-ami.
But this time you sent the action twice, in the lines 27 and 34 Try to add the listener before the line 27
I added 2 times to show that the response is returned and the event is not
from python-ami.
The response returns before the events, so it really can happen, maybe your process was closed before receiving the events
In your example that worked you did a while
to keep the process running, that makes some sense, but I don't know why your response is None
I have one concern with your while, in the way that you did I imagine that it is consuming a lot of CPU time, I would try to use a sleep inside the while
Is there any event that ends the event stream?
from python-ami.
I already tried to connect to another PBX, the result is the same. in the example where everything is read from the ATs port, for some reason it freezes after a minute and hangs after stopping the python (((((maybe my version of asterisk.ami is old?
from python-ami.
from python-ami.
The response returns before the events, so it really can happen, maybe your process was closed before receiving the events In your example that worked you did a
while
to keep the process running, that makes some sense, but I don't know why your response is NoneI have one concern with your while, in the way that you did I imagine that it is consuming a lot of CPU time, I would try to use a sleep inside the while
Is there any event that ends the event stream?
Hello, I started sending data after adding a callback))). tell me how to get out of the endless loop try?
from python-ami.
try putting the parameter timeout=None in the client.login line like this:
client = AMIClient(address='127.0.0.1',port=5038,timeout=None)
from python-ami.
Related Issues (20)
- A little bug of response.is_error HOT 1
- Login timeout setting HOT 1
- AutoReconnect goes into an endless loop HOT 5
- Pass multiple variables
- Secure connection to AMI over TLS HOT 2
- Informação do Retorno da função HOT 2
- Compatibility issue with Python3.7 and re._pattern_type HOT 3
- AttributeError: module 're' has no attribute '_pattern_type' HOT 1
- Problema ao tentar dar um Playback em um arquivo HOT 1
- New version with Python3.7 compatibility HOT 2
- username and secret??? HOT 1
- dont work with python 3.8 HOT 9
- How to pass parameters via "-" HOT 3
- default timeout on socket is only 3 seconds. It is too small. HOT 2
- No event is being captured HOT 8
- AutoReconnect ping always returns None HOT 2
- Update pypi package HOT 1
- Event listener
- Ami disconection
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-ami.