320_srtp_with_unknown_media_2.py 716 B

123456789101112131415161718192021222324252627
  1. import inc_sip as sip
  2. import inc_sdp as sdp
  3. sdp = \
  4. """
  5. v=0
  6. o=- 0 0 IN IP4 127.0.0.1
  7. s=-
  8. c=IN IP4 127.0.0.1
  9. t=0 0
  10. m=xapplicationx 4000 RTP/AVP 100
  11. a=rtpmap:100 myapp/80000
  12. m=audio 5000 RTP/AVP 0
  13. a=crypto:1 aes_cm_128_hmac_sha1_80 inline:WnD7c1ksDGs+dIefCEo8omPg4uO8DYIinNGL5yxQ
  14. """
  15. pjsua_args = "--null-audio --auto-answer 200 --use-srtp 1 --srtp-secure 0"
  16. extra_headers = ""
  17. include = ["Content-Type: application/sdp", # response must include SDP
  18. "m=xapplicationx 0 RTP/AVP[\\s\\S]+m=audio [1-9]+[0-9]* RTP/AVP[\\s\\S]+a=crypto"
  19. ]
  20. exclude = []
  21. sendto_cfg = sip.SendtoCfg("Unknown media and SRTP audio", pjsua_args, sdp, 200,
  22. extra_headers=extra_headers,
  23. resp_inc=include, resp_exc=exclude)