blob: 61194bd77cab3bfb3e5f2445c8f7f2993535c0c9 [file] [log] [blame]
Benny Prijono945aeb22008-12-22 18:54:58 +00001# $Id$
Benny Prijonoe9a82242008-07-07 20:14:41 +00002import inc_sip as sip
3import inc_sdp as sdp
4
5pjsua = "--null-audio --id=sip:CLIENT --registrar sip:127.0.0.1:$PORT " + \
6 "--username theuser1 --realm python1 --password passwd --next-cred " + \
7 "--username theuser2 --realm python2 --password passwd " + \
8 "--auto-update-nat=0"
9
10req1 = sip.RecvfromTransaction("Initial registration", 401,
11 include=["REGISTER sip"],
12 resp_hdr=["WWW-Authenticate: Digest realm=\"python1\", nonce=\"1234\"",
13 "WWW-Authenticate: Digest realm=\"python2\", nonce=\"6789\""],
14 expect="SIP/2.0 401"
15 )
16
17req2 = sip.RecvfromTransaction("Registration retry with auth", 200,
18 include=["REGISTER sip",
19 "Authorization:[\\s\\S]+Authorization:", # Must have 2 Auth hdrs
20 "realm=\"python1\"", "realm=\"python2\"",
21 "username=\"theuser1\"", "username=\"theuser2\"",
22 "nonce=\"1234\"", "nonce=\"6789\"",
23 "response="],
24 expect="registration success"
25 )
26
27recvfrom_cfg = sip.RecvfromCfg("Multiple authentication challenges",
28 pjsua, [req1, req2])