252_multipart_ok_clutter.py 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import inc_sip as sip
  2. import inc_sdp as sdp
  3. body = \
  4. """
  5. This is the preamble. It is to be ignored, though it
  6. is a handy place for composition agents to include an
  7. explanatory note to non-MIME conformant readers.
  8. --123:45
  9. Content-Type: text/plain
  10. The first part is definitely not SDP
  11. --123:45
  12. This is implicitly typed plain US-ASCII text.
  13. It does NOT end with a linebreak.
  14. --123:45
  15. Content-Type: application/sdp
  16. v=0
  17. o=- 0 0 IN IP4 127.0.0.1
  18. s=pjmedia
  19. c=IN IP4 127.0.0.1
  20. t=0 0
  21. m=audio 4000 RTP/AVP 0 101
  22. a=rtpmap:0 PCMU/8000
  23. a=sendrecv
  24. a=rtpmap:101 telephone-event/8000
  25. a=fmtp:101 0-15
  26. --123:45--
  27. This is the epilogue. It is also to be ignored.
  28. """
  29. args = "--null-audio --auto-answer 200 --max-calls 1"
  30. extra_headers = "Content-Type: multipart/mixed; boundary=\"123:45\""
  31. include = ["v=0", "m=audio"]
  32. exclude = []
  33. sendto_cfg = sip.SendtoCfg( "Valid but cluttered multipart/mixed body containing SDP",
  34. pjsua_args=args, sdp="", resp_code=200,
  35. extra_headers=extra_headers, body=body,
  36. resp_inc=include, resp_exc=exclude)