diff options
Diffstat (limited to 'tests/pjsua/scripts-recvfrom')
3 files changed, 76 insertions, 0 deletions
diff --git a/tests/pjsua/scripts-recvfrom/209a_reg_handle_423_ok.py b/tests/pjsua/scripts-recvfrom/209a_reg_handle_423_ok.py new file mode 100644 index 00000000..16ec214c --- /dev/null +++ b/tests/pjsua/scripts-recvfrom/209a_reg_handle_423_ok.py @@ -0,0 +1,31 @@ +# $Id$ +import inc_sip as sip +import inc_sdp as sdp + +pjsua = "--null-audio --id=sip:CLIENT --registrar sip:127.0.0.1:$PORT " + \ + "--realm=python --user=username --password=password " + \ + "--auto-update-nat=0" + +# 423 Response without Min-Expires header +req1 = sip.RecvfromTransaction("Initial request", 423, + include=["REGISTER sip"], + exclude=[], + resp_hdr=[] + ) + +# Client should retry with Expires header containing special value (pjsip specific) +req2 = sip.RecvfromTransaction("REGISTER retry after 423 response without Min-Expires header", 423, + include=["REGISTER sip", "Expires: 3601"], + exclude=[], + resp_hdr=["Min-Expires: 3612"] + ) + +# Client should retry with proper Expires header now +req3 = sip.RecvfromTransaction("REGISTER retry after proper 423", 200, + include=["Expires: 3612"], + exclude=[], + expect="registration success" + ) + +recvfrom_cfg = sip.RecvfromCfg("Reregistration after 423 response", + pjsua, [req1, req2, req3]) diff --git a/tests/pjsua/scripts-recvfrom/209b_reg_handle_423_bad_min_expires1.py b/tests/pjsua/scripts-recvfrom/209b_reg_handle_423_bad_min_expires1.py new file mode 100644 index 00000000..83a4074c --- /dev/null +++ b/tests/pjsua/scripts-recvfrom/209b_reg_handle_423_bad_min_expires1.py @@ -0,0 +1,20 @@ +# $Id$ +import inc_sip as sip +import inc_sdp as sdp + +pjsua = "--null-audio --id=sip:CLIENT --registrar sip:127.0.0.1:$PORT " + \ + "--realm=python --user=username --password=password " + \ + "--auto-update-nat=0 --reg-timeout 300" + +# 423 Response with Min-Expires header that is lower than what the client +# had requested +req1 = sip.RecvfromTransaction("Initial request", 423, + include=["REGISTER sip"], + exclude=[], + resp_hdr=["Min-Expires: 250"], + expect="invalid Min-Expires" + + ) + +recvfrom_cfg = sip.RecvfromCfg("Invalid 423 response to REGISTER", + pjsua, [req1]) diff --git a/tests/pjsua/scripts-recvfrom/209c_reg_handle_423_bad_min_expires2.py b/tests/pjsua/scripts-recvfrom/209c_reg_handle_423_bad_min_expires2.py new file mode 100644 index 00000000..378ea283 --- /dev/null +++ b/tests/pjsua/scripts-recvfrom/209c_reg_handle_423_bad_min_expires2.py @@ -0,0 +1,25 @@ +# $Id$ +import inc_sip as sip +import inc_sdp as sdp + +pjsua = "--null-audio --id=sip:CLIENT --registrar sip:127.0.0.1:$PORT " + \ + "--realm=python --user=username --password=password " + \ + "--auto-update-nat=0 --reg-timeout 300" + +# 423 without Min-Expires. PJSIP would retry with Expires: 3601 +req1 = sip.RecvfromTransaction("Initial request", 423, + include=["REGISTER sip"], + exclude=[], + resp_hdr=[] + ) + +# Another 423, still without Min-Expires +req2 = sip.RecvfromTransaction("Retry with guessed Expires header", 423, + include=["REGISTER sip", "Expires: 3601"], + exclude=[], + resp_hdr=[], + expect="without Min-Expires header is invalid" + ) + +recvfrom_cfg = sip.RecvfromCfg("Invalid 423 response to REGISTER", + pjsua, [req1, req2]) |