blob: edfd40f3937911e39969d8df8ab3d5017d57f189 [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=* --user=username --password=password " + \
7 "--auto-update-nat=0"
8
9# 401 Response, missing realm value
10req1 = sip.RecvfromTransaction("Initial request", 401,
11 include=["REGISTER sip"],
12 exclude=[],
13 resp_hdr=['WWW-Authenticate: Digest']
14 )
15
16# Client should retry, we giving it another 401 with empty realm
17req2 = sip.RecvfromTransaction("REGISTER retry #1 of 2", 407,
18 include=["REGISTER sip"],
19 exclude=[],
20 resp_hdr=['Proxy-Authenticate: Digest realm=""']
21 )
22
23# Client should retry
24req3 = sip.RecvfromTransaction("REGISTER retry #2 of 2", 200,
25 include=[],
26 exclude=[],
27 expect="registration success"
28 )
29
30recvfrom_cfg = sip.RecvfromCfg("Registration with empty realm",
31 pjsua, [req1, req2, req3])