From 059d687249f0f95e0b30785c418e1aa47555615a Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Sun, 1 Aug 2010 09:48:51 +0000 Subject: Implemented core multipart support and support in the invite session (re #1070) - incoming multipart message will be handled automatically - for testing, enable HAVE_MULTIPART_TEST in pjsua_app.c git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3243 74dad513-b988-da41-8d7b-12977e46ad98 --- .../scripts-sendto/251_multipart_ok_simple.py | 38 +++++++++++++++++ .../scripts-sendto/252_multipart_ok_clutter.py | 47 ++++++++++++++++++++++ .../scripts-sendto/260_multipart_err_no_sdp.py | 38 +++++++++++++++++ 3 files changed, 123 insertions(+) create mode 100644 tests/pjsua/scripts-sendto/251_multipart_ok_simple.py create mode 100644 tests/pjsua/scripts-sendto/252_multipart_ok_clutter.py create mode 100644 tests/pjsua/scripts-sendto/260_multipart_err_no_sdp.py (limited to 'tests/pjsua/scripts-sendto') diff --git a/tests/pjsua/scripts-sendto/251_multipart_ok_simple.py b/tests/pjsua/scripts-sendto/251_multipart_ok_simple.py new file mode 100644 index 00000000..42163199 --- /dev/null +++ b/tests/pjsua/scripts-sendto/251_multipart_ok_simple.py @@ -0,0 +1,38 @@ +# $Id$ +import inc_sip as sip +import inc_sdp as sdp + +body = \ +""" +--12345 +Content-Type: application/sdp + +v=0 +o=- 0 0 IN IP4 127.0.0.1 +s=pjmedia +c=IN IP4 127.0.0.1 +t=0 0 +m=audio 4000 RTP/AVP 0 101 +a=rtpmap:0 PCMU/8000 +a=sendrecv +a=rtpmap:101 telephone-event/8000 +a=fmtp:101 0-15 + +--12345 +Content-Type: text/plain + +Hi there this is definitely not SDP + +--12345-- +""" + +args = "--null-audio --auto-answer 200 --max-calls 1" +extra_headers = "Content-Type: multipart/mixed; boundary=12345" +include = ["v=0", "m=audio"] +exclude = [] + +sendto_cfg = sip.SendtoCfg( "Valid multipart/mixed body containing SDP", + pjsua_args=args, sdp="", resp_code=200, + extra_headers=extra_headers, body=body, + resp_inc=include, resp_exc=exclude) + diff --git a/tests/pjsua/scripts-sendto/252_multipart_ok_clutter.py b/tests/pjsua/scripts-sendto/252_multipart_ok_clutter.py new file mode 100644 index 00000000..65038488 --- /dev/null +++ b/tests/pjsua/scripts-sendto/252_multipart_ok_clutter.py @@ -0,0 +1,47 @@ +# $Id$ +import inc_sip as sip +import inc_sdp as sdp + +body = \ +""" +This is the preamble. It is to be ignored, though it +is a handy place for composition agents to include an +explanatory note to non-MIME conformant readers. + +--123:45 +Content-Type: text/plain + +The first part is definitely not SDP + +--123:45 + +This is implicitly typed plain US-ASCII text. +It does NOT end with a linebreak. +--123:45 +Content-Type: application/sdp + +v=0 +o=- 0 0 IN IP4 127.0.0.1 +s=pjmedia +c=IN IP4 127.0.0.1 +t=0 0 +m=audio 4000 RTP/AVP 0 101 +a=rtpmap:0 PCMU/8000 +a=sendrecv +a=rtpmap:101 telephone-event/8000 +a=fmtp:101 0-15 + +--123:45-- +This is the epilogue. It is also to be ignored. +""" + +args = "--null-audio --auto-answer 200 --max-calls 1" +extra_headers = "Content-Type: multipart/mixed; boundary=\"123:45\"" +include = ["v=0", "m=audio"] +exclude = [] + +sendto_cfg = sip.SendtoCfg( "Valid but cluttered multipart/mixed body containing SDP", + pjsua_args=args, sdp="", resp_code=200, + extra_headers=extra_headers, body=body, + resp_inc=include, resp_exc=exclude) + diff --git a/tests/pjsua/scripts-sendto/260_multipart_err_no_sdp.py b/tests/pjsua/scripts-sendto/260_multipart_err_no_sdp.py new file mode 100644 index 00000000..7827ec11 --- /dev/null +++ b/tests/pjsua/scripts-sendto/260_multipart_err_no_sdp.py @@ -0,0 +1,38 @@ +# $Id$ +import inc_sip as sip +import inc_sdp as sdp + +body = \ +""" +--12345 +Content-Type: application/notsdp + +v=0 +o=- 0 0 IN IP4 127.0.0.1 +s=pjmedia +c=IN IP4 127.0.0.1 +t=0 0 +m=audio 4000 RTP/AVP 0 101 +a=rtpmap:0 PCMU/8000 +a=sendrecv +a=rtpmap:101 telephone-event/8000 +a=fmtp:101 0-15 + +--12345 +Content-Type: text/plain + +Hi there this is definitely not SDP + +--12345-- +""" + +args = "--null-audio --auto-answer 200 --max-calls 1" +extra_headers = "Content-Type: multipart/mixed; boundary=12345" +include = [] +exclude = [] + +sendto_cfg = sip.SendtoCfg( "Multipart/mixed body without SDP", + pjsua_args=args, sdp="", resp_code=400, + extra_headers=extra_headers, body=body, + resp_inc=include, resp_exc=exclude) + -- cgit v1.2.3