202_reg_good_ok_wildcard.py 796 B

12345678910111213141516171819202122
  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. "--username user --realm \"*\" --password passwd --auto-update-nat=0"
  5. req1 = sip.RecvfromTransaction("Initial registration", 401,
  6. include=["REGISTER sip"],
  7. exclude=["Authorization"],
  8. resp_hdr=["WWW-Authenticate: Digest realm=\"python\", nonce=\"1234\""],
  9. expect="SIP/2.0 401"
  10. )
  11. req2 = sip.RecvfromTransaction("Registration retry with auth", 200,
  12. include=["REGISTER sip", "Authorization:",
  13. "realm=\"python\"", "username=\"user\"",
  14. "nonce=\"1234\"", "response="],
  15. expect="registration success"
  16. )
  17. recvfrom_cfg = sip.RecvfromCfg("Successful registration with wildcard realm test",
  18. pjsua, [req1, req2])