blob: d37add173a59d029b78fd2d8e8fc90f7d5bef77f [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 "--username user@ims-domain --realm python --password passwd --use-ims --auto-update-nat=0"
7
8req1 = sip.RecvfromTransaction("Initial registration", 401,
9 include=["REGISTER sip", "Authorization",
10 "username=\"user@ims-domain\"",
11 "realm=\"python\""],
12 resp_hdr=["WWW-Authenticate: Digest realm=\"python\", nonce=\"1234\""],
13 expect="SIP/2.0 401"
14 )
15
16req2 = sip.RecvfromTransaction("Registration retry with auth", 200,
17 include=["REGISTER sip", "Authorization:",
18 "realm=\"python\"", "username=\"user@ims-domain\"",
19 "nonce=\"1234\"", "response="],
20 # Must not have double Authorization header:
21 exclude=["Authorization:[\\s\\S]+Authorization:"],
22 expect="registration success"
23 )
24
25recvfrom_cfg = sip.RecvfromCfg("Successful IMS registration test",
26 pjsua, [req1, req2])