Created
July 13, 2013 08:55
-
-
Save muromec/5990047 to your computer and use it in GitHub Desktop.
query texr.net version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mport socket | |
msg = '''OPTIONS sip:texr.net SIP/2.0 | |
Via: SIP/2.0/UDP texr.net;branch=z9hG4bK5cb072362f08f6a3 | |
Content-Length: 0 | |
From: "neko" <sip:neko@texr.net>;tag=4158f3dc | |
To: "neko" <sip:neko@texr.net> | |
User-Agent: pygay | |
CSeq: 55216 OPTIONS | |
Max-Forwards: 70 | |
Call-ID: 1740c212b2be8e267b7c16ee1bd7 | |
''' | |
to_ip = socket.gethostbyname("sip.texr.net") | |
to_port = 5060 | |
sock = socket.socket( socket.AF_INET, socket.SOCK_STREAM ) | |
sock.connect((to_ip, to_port)) | |
sock.send(str(msg)) | |
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