401_fmtp_g7221_with_bitrate_32000.py 843 B

12345678910111213141516171819202122232425262728293031323334
  1. import inc_sip as sip
  2. import inc_sdp as sdp
  3. # Answer with codec G722.1 should choose the same bitrate
  4. # which in this test is 32000
  5. sdp = \
  6. """
  7. v=0
  8. o=- 3428650655 3428650655 IN IP4 192.168.1.9
  9. s=pjmedia
  10. c=IN IP4 192.168.1.9
  11. t=0 0
  12. a=X-nat:0
  13. m=audio 4000 RTP/AVP 100 101
  14. a=rtcp:4001 IN IP4 192.168.1.9
  15. a=rtpmap:100 G7221/16000
  16. a=fmtp:100 bitrate=32000
  17. a=sendrecv
  18. a=rtpmap:101 telephone-event/8000
  19. a=fmtp:101 0-15
  20. """
  21. pjsua_args = "--null-audio --auto-answer 200 --add-codec G7221"
  22. extra_headers = ""
  23. include = ["a=rtpmap:[\d]+ G7221/16000", # response must choose G722.1
  24. "fmtp:[\d]+ bitrate=32000" # response must choose the same bitrate
  25. ]
  26. exclude = []
  27. sendto_cfg = sip.SendtoCfg("Answer with G722.1 should choose bitrate 32000", pjsua_args, sdp, 200,
  28. extra_headers=extra_headers,
  29. resp_inc=include, resp_exc=exclude)