jfernandz / pyst2

A fork of the famous python pyst library for Asterisk.
139 stars 105 forks source link

send_action - result #33

Open Revent opened 7 years ago

Revent commented 7 years ago
class MyManager(asterisk.manager.Manager):

    def queuestatus(self):
        cdict = {"Action": "QueueStatus"}
        response = self.send_action(cdict)
        return response

in response.data raw output, why not dict? and how parse this output? why in response.headers hasn't events? why events not in events thread?

Hex4919 commented 3 years ago

Same Problem here. Did you find a solution? Got nothing in events and I dont know how to parse the response, if the data is in there.

joshuaboniface commented 1 year ago

Running into this bug too.

The data is there, it's in response.data, in raw form, rather than being parsed as a ManagerMsg into the callback.

I'm doing some digging into it and will hope to have a PR soon.

joshuaboniface commented 1 year ago

I believe the fix for this is altering this conditional:

https://github.com/jfernandz/pyst2/blob/develop/asterisk/manager.py#L340

to not have and not wait_for_marker. The responses from my Asterisk 20.1 server don't seem to send END COMMAND, so I assume this conditional is a workaround for inconsistent behaviour in older versions of Asterisk.

joshuaboniface commented 1 year ago

Confirmed that changing this does indeed fix QueueStatus responses, and so far doesn't seem to negatively affect any other commands that I'm using.