Giter VIP home page Giter VIP logo

Comments (13)

ettoreleandrotognoli avatar ettoreleandrotognoli commented on June 1, 2024 2

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.

ilya-savichev avatar ilya-savichev commented on June 1, 2024 1

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
image

from python-ami.

ilya-savichev avatar ilya-savichev commented on June 1, 2024

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

image
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.

ettoreleandrotognoli avatar ettoreleandrotognoli commented on June 1, 2024

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.

ilya-savichev avatar ilya-savichev commented on June 1, 2024

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)

image

from python-ami.

ettoreleandrotognoli avatar ettoreleandrotognoli commented on June 1, 2024

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.

ilya-savichev avatar ilya-savichev commented on June 1, 2024

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
image

from python-ami.

ettoreleandrotognoli avatar ettoreleandrotognoli commented on June 1, 2024

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.

ilya-savichev avatar ilya-savichev commented on June 1, 2024

image
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.

ilya-savichev avatar ilya-savichev commented on June 1, 2024

image

from python-ami.

ilya-savichev avatar ilya-savichev commented on June 1, 2024

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?

image

Hello, I started sending data after adding a callback))). tell me how to get out of the endless loop try?

from python-ami.

nelsonyoneyama avatar nelsonyoneyama commented on June 1, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.