400_inv_answered_with_less_media.py 785 B

12345678910111213141516171819202122232425262728293031
  1. import inc_sip as sip
  2. import inc_sdp as sdp
  3. # Offer with 2 media lines answered with only 1 media line
  4. pjsua = "--null-audio sip:127.0.0.1:$PORT --id=sip:1000@localhost --extra-audio --use-srtp=0"
  5. sdp = \
  6. """
  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. """
  18. req = sip.RecvfromTransaction("Receiving 2 media lines, answer with 1 media line", 200,
  19. include=["m=audio \d+ RTP/AVP", "m=audio \d+ RTP/AVP"],
  20. exclude=[],
  21. resp_hdr=["Content-type: application/sdp"],
  22. resp_body=sdp,
  23. )
  24. recvfrom_cfg = sip.RecvfromCfg("Receiving answer with less media lines",
  25. pjsua, [req])