jfernandz / pyst2

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

manager-.hostname is always the host running the code, not the server we are connected to #48

Open TrevorPH opened 5 years ago

TrevorPH commented 5 years ago

When using manager = asterisk.manager.Manager() then manager.hostname is always set to the hostname of the machine running the python code. Am I alone in expecting that this should really be the hostname of the client we're talking to instead?

TrevorPH commented 5 years ago

Well, this makes it work how I think it probably should work. I cannot see any point in having it tell me what the hostname of the machine running the pyst2 code is. If I do want to know that then there are already ways to do that. What I want it to tell me is the remote hostname of the connected asterisk manager that this asterisk.manager.Manager() is connected to and the patch attached makes it do that though I am unsure about setting it to "Unconnected" in _init though it is accurate (otherwise it also shows up as the pyst2 code machine when the manager isn't connected)

pyst2-manager-hostname.patch.txt