Debian Codegraph @

Xpjproject/tests/pjsua/scripts-recvfrom/203_reg_good_empty_realm.py

raw symbols SCIP
1 import inc_sip as sip
2 import inc_sdp as sdp
3
4 pjsua = "--null-audio --id=sip:CLIENT --registrar sip:127.0.0.1:$PORT " + \
5 "--realm=* --user=username --password=password " + \
6 "--auto-update-nat=0"
7
8 # 401 Response, missing realm value
9 req1 = sip.RecvfromTransaction("Initial request", 401,
10 include=["REGISTER sip"],
11 exclude=[],
12 resp_hdr=['WWW-Authenticate: Digest']
13 )
14
15 # Client should retry, we giving it another 401 with empty realm
16 req2 = sip.RecvfromTransaction("REGISTER retry #1 of 2", 407,
17 include=["REGISTER sip"],
18 exclude=[],
19 resp_hdr=['Proxy-Authenticate: Digest realm=""']
20 )
21
22 # Client should retry
23 req3 = sip.RecvfromTransaction("REGISTER retry #2 of 2", 200,
24 include=[],
25 exclude=[],
26 expect="registration success"
27 )
28
29 recvfrom_cfg = sip.RecvfromCfg("Registration with empty realm",
30 pjsua, [req1, req2, req3])