Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
query version
mport socket
msg = '''OPTIONS SIP/2.0
Via: SIP/2.0/UDP;branch=z9hG4bK5cb072362f08f6a3
Content-Length: 0
From: "neko" <>;tag=4158f3dc
To: "neko" <>
User-Agent: pygay
CSeq: 55216 OPTIONS
Max-Forwards: 70
Call-ID: 1740c212b2be8e267b7c16ee1bd7
to_ip = socket.gethostbyname("")
to_port = 5060
sock = socket.socket( socket.AF_INET, socket.SOCK_STREAM )
sock.connect((to_ip, to_port))
msg, addr = sock.recvfrom(4096)
print msg
msg, addr = sock.recvfrom(4096)
print msg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment