209a_reg_handle_423_ok.py 985 B

123456789101112131415161718192021222324252627282930
  1. import inc_sip as sip
  2. import inc_sdp as sdp
  3. pjsua = "--null-audio --id=sip:CLIENT --registrar sip:127.0.0.1:$PORT " + \
  4. "--realm=python --user=username --password=password " + \
  5. "--auto-update-nat=0"
  6. # 423 Response without Min-Expires header
  7. req1 = sip.RecvfromTransaction("Initial request", 423,
  8. include=["REGISTER sip"],
  9. exclude=[],
  10. resp_hdr=[]
  11. )
  12. # Client should retry with Expires header containing special value (pjsip specific)
  13. req2 = sip.RecvfromTransaction("REGISTER retry after 423 response without Min-Expires header", 423,
  14. include=["REGISTER sip", "Expires: 3601"],
  15. exclude=[],
  16. resp_hdr=["Min-Expires: 3612"]
  17. )
  18. # Client should retry with proper Expires header now
  19. req3 = sip.RecvfromTransaction("REGISTER retry after proper 423", 200,
  20. include=["Expires: 3612"],
  21. exclude=[],
  22. expect="registration success"
  23. )
  24. recvfrom_cfg = sip.RecvfromCfg("Reregistration after 423 response",
  25. pjsua, [req1, req2, req3])