diff options
author | Benny Prijono <bennylp@teluu.com> | 2010-02-23 11:03:07 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2010-02-23 11:03:07 +0000 |
commit | df622f00fa10e2cbcde9df6169ad628fe3e72226 (patch) | |
tree | 880d29fbe8e66d583d17768cf169068d1b89071f /tests/pjsua/scripts-recvfrom/209a_reg_handle_423_ok.py | |
parent | bc8de1cca14dc2a09c570af759f6782aa9802158 (diff) |
Ticket #1031: Automatically handle 423 (Interval Too Brief) response in SIP registration (thanks Tomáš Valenta for the suggestion)
- implemented in sip_reg.c instead of in PJSUA-LIB, so that the functionality can be reused by non-PJSUA-LIB applications
- also added several Python test scripts
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3105 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'tests/pjsua/scripts-recvfrom/209a_reg_handle_423_ok.py')
-rw-r--r-- | tests/pjsua/scripts-recvfrom/209a_reg_handle_423_ok.py | 31 |
1 files changed, 31 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]) |