diff options
author | Benny Prijono <bennylp@teluu.com> | 2009-03-12 11:25:11 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2009-03-12 11:25:11 +0000 |
commit | ba9d8ca28eb209571c0bd6a080a8bb03d0fa2d33 (patch) | |
tree | 6f32a52e5bb80196bdffa66de1292ea5bda050c4 /tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_3.py | |
parent | 42ee8666dff7f9689ea1ff50409d5170a8417838 (diff) |
Initial fixes for ticket #747: bugs in parsing SIP torture messages (RFC 4475):
- SIP version components may be separated by whitespaces (e.g. "SIP / 2.0")
- parsing of mangled header when for unknown/generic header
- Via parameters were parsed with paramchar rather than token
- handling NULL character inside quoted string
Some torture messages have been added in the Python test.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2505 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_3.py')
-rw-r--r-- | tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_3.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_3.py b/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_3.py new file mode 100644 index 00000000..4f32e979 --- /dev/null +++ b/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_3.py @@ -0,0 +1,35 @@ +# $Id$ +import inc_sip as sip +import inc_sdp as sdp + +# Torture message from RFC 4475 +# 3.1.1. Valid Messages +# 3.1.1.3. Valid Use of the % Escaping Mechanism +complete_msg = \ +"""INVITE sip:sips%3Auser%40example.com@example.net SIP/2.0 +To: sip:%75se%72@example.com +From: <sip:I%20have%20spaces@example.net>;tag=$FROM_TAG +Max-Forwards: 87 +i: esc01.239409asdfakjkn23onasd0-3234 +CSeq: 234234 INVITE +Via: SIP/2.0/UDP host5.example.net;rport;branch=z9hG4bKkdjuw +C: application/sdp +Contact: + <sip:cal%6Cer@$LOCAL_IP:$LOCAL_PORT;%6C%72;n%61me=v%61lue%25%34%31> +Content-Length: 150 + +v=0 +o=mhandley 29739 7272939 IN IP4 192.0.2.1 +s=- +c=IN IP4 192.0.2.1 +t=0 0 +m=audio 49217 RTP/AVP 0 12 +m=video 3227 RTP/AVP 31 +a=rtpmap:31 LPC +""" + + +sendto_cfg = sip.SendtoCfg( "RFC 4475 3.1.1.3", + "--null-audio --auto-answer 200", + "", 200, complete_msg=complete_msg) + |