blob: 46e172854f5fc474d6212c132500663f605c2441 [file] [log] [blame]
Tristan Matthews0a329cc2013-07-17 13:20:14 -04001# $Id$
2import inc_sip as sip
3import inc_sdp as sdp
4
5pjsua = "--null-audio --id=sip:CLIENT --registrar sip:127.0.0.1:$PORT " + \
6 "--realm=python --user=username --password=password " + \
7 "--auto-update-nat=0"
8
9req1 = sip.RecvfromTransaction("Initial request", 401,
10 include=["REGISTER sip"],
11 exclude=["Authorization"],
12 resp_hdr=["WWW-Authenticate: Digest realm=\"python\", nonce=\"1\""]
13 )
14
15req2 = sip.RecvfromTransaction("REGISTER first retry", 401,
16 include=["REGISTER sip", "Authorization", "nonce=\"1\""],
17 exclude=["Authorization:[\\s\\S]+Authorization:"],
18 resp_hdr=["WWW-Authenticate: Digest realm=\"python\", nonce=\"2\", stale=true"]
19 )
20
21
22req3 = sip.RecvfromTransaction("REGISTER retry with new nonce", 200,
23 include=["REGISTER sip", "Authorization", "nonce=\"2\""],
24 exclude=["Authorization:[\\s\\S]+Authorization:"],
25 expect="registration success"
26 )
27
28recvfrom_cfg = sip.RecvfromCfg("Authentication okay after retry with new nonce",
29 pjsua, [req1, req2, req3])