I'm trying to get the status of an Asterisk Server using a python socket but nothing happens.
Here is my code:
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
HOST = '192.168.1.105'
PORT = 5038
s.connect((HOST, PORT))
params = """Action: login
Events: off
Username: admin
Secret: mypass
Action: status
Action: Logoff
"""
s.send(params)
data = s.recv(1024)
print data + '\n'
s.close()
I just get a message saying Asterisk Version and nothing more.
I hope somebody could help me with this.
Thanks in advance.