251_multipart_ok_simple.py 731 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import inc_sip as sip
  2. import inc_sdp as sdp
  3. body = \
  4. """
  5. --12345
  6. Content-Type: application/sdp
  7. v=0
  8. o=- 0 0 IN IP4 127.0.0.1
  9. s=pjmedia
  10. c=IN IP4 127.0.0.1
  11. t=0 0
  12. m=audio 4000 RTP/AVP 0 101
  13. a=rtpmap:0 PCMU/8000
  14. a=sendrecv
  15. a=rtpmap:101 telephone-event/8000
  16. a=fmtp:101 0-15
  17. --12345
  18. Content-Type: text/plain
  19. Hi there this is definitely not SDP
  20. --12345--
  21. """
  22. args = "--null-audio --auto-answer 200 --max-calls 1"
  23. extra_headers = "Content-Type: multipart/mixed; boundary=12345"
  24. include = ["v=0", "m=audio"]
  25. exclude = []
  26. sendto_cfg = sip.SendtoCfg( "Valid multipart/mixed body containing SDP",
  27. pjsua_args=args, sdp="", resp_code=200,
  28. extra_headers=extra_headers, body=body,
  29. resp_inc=include, resp_exc=exclude)