206_reg_good_efailedcredential.py 818 B

12345678910111213141516171819202122232425
  1. import inc_sip as sip
  2. import inc_sdp as sdp
  3. # Authentication failure test with same nonce
  4. pjsua = "--null-audio --id=sip:CLIENT --registrar sip:127.0.0.1:$PORT " + \
  5. "--realm=python --user=username --password=password"
  6. req1 = sip.RecvfromTransaction("Initial request", 401,
  7. include=["REGISTER sip"],
  8. exclude=["Authorization"],
  9. resp_hdr=["WWW-Authenticate: Digest realm=\"python\", nonce=\"1\""]
  10. )
  11. req2 = sip.RecvfromTransaction("REGISTER retry", 401,
  12. include=["REGISTER sip", "Authorization", "nonce=\"1\""],
  13. exclude=["Authorization:[\\s\\S]+Authorization:"],
  14. resp_hdr=["WWW-Authenticate: Digest realm=\"python\", nonce=\"1\""],
  15. expect="PJSIP_EFAILEDCREDENTIAL"
  16. )
  17. recvfrom_cfg = sip.RecvfromCfg("Authentication failure with same nonce",
  18. pjsua, [req1, req2])