diff options
Diffstat (limited to 'tests/pjsua/scripts-recvfrom')
-rw-r--r-- | tests/pjsua/scripts-recvfrom/300_timer_good.py | 17 | ||||
-rw-r--r-- | tests/pjsua/scripts-recvfrom/301_timer_good_retry_after_422.py | 28 |
2 files changed, 45 insertions, 0 deletions
diff --git a/tests/pjsua/scripts-recvfrom/300_timer_good.py b/tests/pjsua/scripts-recvfrom/300_timer_good.py new file mode 100644 index 00000000..75dd1bd8 --- /dev/null +++ b/tests/pjsua/scripts-recvfrom/300_timer_good.py @@ -0,0 +1,17 @@ +# $Id$ +import inc_sip as sip +import inc_sdp as sdp + +# INVITE session using session timer + +pjsua = "--null-audio sip:127.0.0.1:$PORT --use-timer --timer-min-se 100 --timer-se 2000" + +req = sip.RecvfromTransaction("INVITE with session timer", 200, + include=["Session-Expires:\s*2000", "Min-SE:\s*100"], + exclude=[], + resp_hdr=["Session-Expires: 1000;refresher=uac"] + ) + +recvfrom_cfg = sip.RecvfromCfg("INVITE session using session timer", + pjsua, [req]) + diff --git a/tests/pjsua/scripts-recvfrom/301_timer_good_retry_after_422.py b/tests/pjsua/scripts-recvfrom/301_timer_good_retry_after_422.py new file mode 100644 index 00000000..c3bbac7e --- /dev/null +++ b/tests/pjsua/scripts-recvfrom/301_timer_good_retry_after_422.py @@ -0,0 +1,28 @@ +# $Id$ +import inc_sip as sip +import inc_sdp as sdp + +# Session timers retry after 422 + + +pjsua = "--null-audio sip:127.0.0.1:$PORT --timer-min-se 100 --timer-se 1000" + +# First INVITE with timer rejected with 422 +req1 = sip.RecvfromTransaction("INVITE with SE too small", 422, + include=["Session-Expires:\s*1000"], + exclude=[], + resp_hdr=["Min-SE: 2000"], + expect="ACK sip" + ) + +# New INVITE with SE >= Min-SE +req2 = sip.RecvfromTransaction("Retrying with acceptable SE", 200, + include=["Session-Expires:\s*2000", "Min-SE:\s*2000"], + exclude=[], + resp_hdr=["Session-Expires: 2000;refresher=uac"] + ) + + +recvfrom_cfg = sip.RecvfromCfg("Session timers retry after 422", + pjsua, [req1, req2]) + |