I can't get the values
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 = resp1.response print(response3)

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
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):
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)
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

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)

But this time you sent the action twice, in the lines 27 and 34 Try to add the listener before the line 27
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

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?
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?

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
whileto 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?
try putting the parameter timeout=None in the client.login line like this: client = AMIClient(address='127.0.0.1',port=5038,timeout=None)
try putting the parameter timeout=None in the client.login line like this: client = AMIClient(address='127.0.0.1',port=5038,timeout=None)
Thanks SOOOOOOO much - this was driving me nuts, and such a simple solution :-)