Debian Codegraph @

Xpjproject/tests/pjsua/scripts-recvfrom/209a_reg_handle_423_ok.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=python --user=username --password=password " + \
6 "--auto-update-nat=0"
7
8 # 423 Response without Min-Expires header
9 req1 = sip.RecvfromTransaction("Initial request", 423,
10 include=["REGISTER sip"],
11 exclude=[],
12 resp_hdr=[]
13 )
14
15 # Client should retry with Expires header containing special value (pjsip specific)
16 req2 = sip.RecvfromTransaction("REGISTER retry after 423 response without Min-Expires header", 423,
17 include=["REGISTER sip", "Expires: 3601"],
18 exclude=[],
19 resp_hdr=["Min-Expires: 3612"]
20 )
21
22 # Client should retry with proper Expires header now
23 req3 = sip.RecvfromTransaction("REGISTER retry after proper 423", 200,
24 include=["Expires: 3612"],
25 exclude=[],
26 expect="registration success"
27 )
28
29 recvfrom_cfg = sip.RecvfromCfg("Reregistration after 423 response",
30 pjsua, [req1, req2, req3])