summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2012-06-26 02:28:59 +0000
committerNanang Izzuddin <nanang@teluu.com>2012-06-26 02:28:59 +0000
commitfe6325e5fb8839a3a8624941a3c898e2d13edd4a (patch)
treee5e2b5d8727841ebf0cc10f6cd2ae4393fe684aa /tests
parent54b19e744f300b122ecaa80ec4a07f2cb9ef1b7f (diff)
Close #1523:
- updated scenarios to work with mod_sipp.py (adding config .py file, etc) - integrated mod_sipp.py to runall.py - removed uas.xml, as it is similar to recvfrom\100_simple.py (REGISTER+resp 200) - renamed scenarios (to allow running these SIPp scenarios without .py file): - prack_fork.xml -> uas-prack_fork.xml - inv_401_retry_after_100.xml -> uas-inv_401_retry_after_100.xml git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4177 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'tests')
-rw-r--r--tests/pjsua/inc_const.py2
-rw-r--r--tests/pjsua/mod_sipp.py32
-rw-r--r--tests/pjsua/runall.py8
-rw-r--r--tests/pjsua/scripts-sipp/strict-route.py9
-rw-r--r--tests/pjsua/scripts-sipp/strict-route.xml47
-rw-r--r--tests/pjsua/scripts-sipp/uac-inv-multiple-require.xml26
-rw-r--r--tests/pjsua/scripts-sipp/uac-inv-two-media-but-one-disabled-no-rtpmap.py7
-rw-r--r--tests/pjsua/scripts-sipp/uac-inv-two-media-but-one-disabled-no-rtpmap.xml2
-rw-r--r--tests/pjsua/scripts-sipp/uac-inv-without-sdp.py11
-rw-r--r--tests/pjsua/scripts-sipp/uac-inv-without-sdp.xml (renamed from tests/pjsua/scripts-sipp/uas.xml)177
-rw-r--r--tests/pjsua/scripts-sipp/uac-ticket-1148.py7
-rw-r--r--tests/pjsua/scripts-sipp/uac-ticket-1148.xml2
-rw-r--r--tests/pjsua/scripts-sipp/uas-answer-180-multiple-fmts-support-update.xml6
-rw-r--r--tests/pjsua/scripts-sipp/uas-answer-180-multiple-fmts.xml5
-rw-r--r--tests/pjsua/scripts-sipp/uas-answer-200-multiple-fmts-support-update.xml5
-rw-r--r--tests/pjsua/scripts-sipp/uas-answer-200-multiple-fmts.xml6
-rw-r--r--tests/pjsua/scripts-sipp/uas-answer-200-reinvite-without-sdp.py7
-rw-r--r--tests/pjsua/scripts-sipp/uas-answer-200-reinvite-without-sdp.xml4
-rw-r--r--tests/pjsua/scripts-sipp/uas-answer-200-update-without-sdp.py7
-rw-r--r--tests/pjsua/scripts-sipp/uas-answer-200-update-without-sdp.xml4
-rw-r--r--tests/pjsua/scripts-sipp/uas-auth.py7
-rw-r--r--tests/pjsua/scripts-sipp/uas-auth.xml3
-rw-r--r--tests/pjsua/scripts-sipp/uas-cancel-no-final.py7
-rw-r--r--tests/pjsua/scripts-sipp/uas-forked-200.xml15
-rw-r--r--tests/pjsua/scripts-sipp/uas-inv_401_retry_after_100.xml (renamed from tests/pjsua/scripts-sipp/inv_401_retry_after_100.xml)0
-rw-r--r--tests/pjsua/scripts-sipp/uas-invite.xml6
-rw-r--r--tests/pjsua/scripts-sipp/uas-mwi-0.py7
-rw-r--r--tests/pjsua/scripts-sipp/uas-mwi-0.xml7
-rw-r--r--tests/pjsua/scripts-sipp/uas-mwi.py7
-rw-r--r--tests/pjsua/scripts-sipp/uas-mwi.xml9
-rw-r--r--tests/pjsua/scripts-sipp/uas-prack_fork.xml (renamed from tests/pjsua/scripts-sipp/prack_fork.xml)22
-rw-r--r--tests/pjsua/scripts-sipp/uas-reinv-glare.py7
-rw-r--r--tests/pjsua/scripts-sipp/uas-subscribe-late-notify.py11
-rw-r--r--tests/pjsua/scripts-sipp/uas-subscribe-late-notify.xml2
-rw-r--r--tests/pjsua/scripts-sipp/uas-subscribe-multipart-notify.py11
-rw-r--r--tests/pjsua/scripts-sipp/uas-subscribe-multipart-notify.xml2
-rw-r--r--tests/pjsua/scripts-sipp/uas-subscribe-notify-terminate.py10
-rw-r--r--tests/pjsua/scripts-sipp/uas-subscribe-refresh-481.py11
-rw-r--r--tests/pjsua/scripts-sipp/uas-subscribe-refresh-481.xml9
-rw-r--r--tests/pjsua/scripts-sipp/uas-subscribe-terminated-retry.py11
40 files changed, 299 insertions, 239 deletions
diff --git a/tests/pjsua/inc_const.py b/tests/pjsua/inc_const.py
index b8b761e1..c54c0c49 100644
--- a/tests/pjsua/inc_const.py
+++ b/tests/pjsua/inc_const.py
@@ -21,6 +21,8 @@ EVENT_INCOMING_CALL = "Press .* answer"
# Call state is CALLING
STATE_CALLING = "state.*CALLING"
+# Call state is EARLY
+STATE_EARLY = "state.*EARLY"
# Call state is CONFIRMED
STATE_CONFIRMED = "state.*CONFIRMED"
# Call state is DISCONNECTED
diff --git a/tests/pjsua/mod_sipp.py b/tests/pjsua/mod_sipp.py
index 1c7e6320..a42767d3 100644
--- a/tests/pjsua/mod_sipp.py
+++ b/tests/pjsua/mod_sipp.py
@@ -7,20 +7,26 @@ import os
import re
import subprocess
from inc_cfg import *
+import inc_const
# SIPp executable path and param
#SIPP_PATH = '"C:\\Program Files (x86)\\Sipp_3.2\\sipp.exe"'
SIPP_PATH = 'sipp'
SIPP_PARAM = "-i 127.0.0.1 -p 6000 -m 1 127.0.0.1"
-SIPP_TIMEOUT = 10
+SIPP_TIMEOUT = 60
# On BG mode, SIPp doesn't require special terminal
# On non-BG mode, on win, it needs env var: "TERMINFO=c:\cygwin\usr\share\terminfo"
SIPP_BG_MODE = True
-PJSUA_DEF_PARAM = "--null-audio --max-calls=1 --no-tcp"
+# Will be updated based on configuration file (a .py file whose the same name as SIPp XML file)
PJSUA_INST_PARAM = []
PJSUA_EXPECTS = []
+# Default PJSUA param if configuration file (the corresponding .py file) is not available:
+# - no-tcp as SIPp is on UDP only
+# - id, username, and realm: to allow PJSUA sending re-INVITE with auth after receiving 401/407 response
+PJSUA_DEF_PARAM = "--null-audio --max-calls=1 --no-tcp --id=sip:a@localhost --username=a --realm=*"
+
# Get SIPp scenario (XML file)
SIPP_SCEN_XML = ""
if ARGS[1].endswith('.xml'):
@@ -57,7 +63,7 @@ def start_sipp():
if SIPP_BG_MODE:
sipp_param = sipp_param + " -bg"
if SIPP_TIMEOUT:
- sipp_param = sipp_param + " -timeout "+str(SIPP_TIMEOUT)+"s -timeout_error"
+ sipp_param = sipp_param + " -timeout "+str(SIPP_TIMEOUT)+"s -timeout_error" + " -deadcall_wait "+str(SIPP_TIMEOUT)+"s"
fullcmd = os.path.normpath(SIPP_PATH) + " " + sipp_param
print "Running SIPP: " + fullcmd
if SIPP_BG_MODE:
@@ -131,15 +137,6 @@ def exec_pjsua_expects(t, sipp):
for ua_idx in range(len(PJSUA_INST_PARAM)):
ua.append(t.process[ua_idx])
- # If there is no PJSUA EXPECT scenario, must keep polling PJSUA stdout
- # otherwise PJSUA process may stuck (due to stdout pipe buffer full?)
- # Ideally the poll should be done contiunously until SIPp process is
- # terminated.
- if len(PJSUA_EXPECTS)==0:
- import inc_const
- ua[0].expect(inc_const.STDOUT_REFRESH, raise_on_error = False)
- return ""
-
ua_err_st = ""
while len(PJSUA_EXPECTS):
expect = PJSUA_EXPECTS.pop(0)
@@ -159,6 +156,17 @@ def exec_pjsua_expects(t, sipp):
ua_err_st = "Unknown error"
break;
+ # Need to poll here for handling these cases:
+ # - If there is no PJSUA EXPECT scenario, we must keep polling the stdout,
+ # otherwise PJSUA process may stuck (due to stdout pipe buffer full?).
+ # - last PJSUA_EXPECT contains a pjsua command that needs time to
+ # finish, for example "v" (re-INVITE), the SIPp XML scenario may expect
+ # that re-INVITE transaction to be completed and without stdout poll
+ # PJSUA process may stuck.
+ # Ideally the poll should be done contiunously until SIPp process is
+ # terminated.
+ ua[0].expect(inc_const.STDOUT_REFRESH, raise_on_error = False)
+
return ua_err_st
diff --git a/tests/pjsua/runall.py b/tests/pjsua/runall.py
index 5dbfaf18..046a0cb6 100644
--- a/tests/pjsua/runall.py
+++ b/tests/pjsua/runall.py
@@ -55,6 +55,11 @@ for f in os.listdir("scripts-pesq"):
for f in os.listdir("scripts-recvfrom"):
tests.append("mod_recvfrom.py scripts-recvfrom/" + f)
+# Add sipp tests
+for f in os.listdir("scripts-sipp"):
+ if f.endswith(".xml"):
+ tests.append("mod_sipp.py scripts-sipp/" + f)
+
# Filter-out excluded tests
for pat in excluded_tests:
tests = [t for t in tests if t.find(pat)==-1]
@@ -103,7 +108,7 @@ while len(sys.argv):
for t in tests:
(mod,param) = t.split(None,2)
tname = mod[4:mod.find(".py")] + "_" + \
- param[param.find("/")+1:param.find(".py")]
+ param[param.find("/")+1:param.rfind(".")]
c = ""
if len(sys.argv):
c = " ".join(sys.argv) + " "
@@ -162,6 +167,7 @@ for t in tests:
logname = re.search(".*\s+(.*)", t).group(1)
logname = re.sub("[\\\/]", "_", logname)
logname = re.sub("\.py$", ".log", logname)
+ logname = re.sub("\.xml$", ".log", logname)
logname = "logs/" + logname
shutil.move("output.log", logname)
print "Please see '" + logname + "' for the test log."
diff --git a/tests/pjsua/scripts-sipp/strict-route.py b/tests/pjsua/scripts-sipp/strict-route.py
new file mode 100644
index 00000000..1c9908f4
--- /dev/null
+++ b/tests/pjsua/scripts-sipp/strict-route.py
@@ -0,0 +1,9 @@
+# $Id$
+#
+import inc_const as const
+
+PJSUA = ["--null-audio --max-calls=1 --id=sip:pjsua@localhost --username=pjsua --realm=* sip:sipp@localhost:6000"]
+
+PJSUA_EXPECTS = [[0, "ACK sip:proxy@.* SIP/2\.0", ""],
+ [0, const.STATE_CONFIRMED, "h"]
+ ]
diff --git a/tests/pjsua/scripts-sipp/strict-route.xml b/tests/pjsua/scripts-sipp/strict-route.xml
index a855209f..0ed6935f 100644
--- a/tests/pjsua/scripts-sipp/strict-route.xml
+++ b/tests/pjsua/scripts-sipp/strict-route.xml
@@ -88,14 +88,14 @@
[last_To:];tag=[call_number]
[last_Call-ID:]
[last_CSeq:]
- Contact: <sip:target@192.168.0.13>
- Record-route: <sip:proxy@192.168.0.13>
+ Contact: <sip:target@[local_ip]>
+ Record-route: <sip:proxy@[local_ip]:[local_port]>
Content-Type: application/sdp
v=0
- o=- 3442013205 3442013205 IN IP4 192.168.0.13
+ o=- 3442013205 3442013205 IN IP4 [local_ip]
s=pjsip
- c=IN IP4 192.168.0.13
+ c=IN IP4 [local_ip]
t=0 0
m=audio 4002 RTP/AVP 0
a=rtpmap:0 PCMU/8000
@@ -111,43 +111,14 @@
[last_To:];tag=[call_number]
[last_Call-ID:]
[last_CSeq:]
- Contact: <sip:target@192.168.0.13>
- Record-route: <sip:proxy@192.168.0.13;maddr=192.168.0.13>
+ Contact: <sip:target@[local_ip]>
+ Record-route: <sip:proxy@[local_ip]:[local_port];maddr=[local_ip]>
Content-Type: application/sdp
v=0
- o=- 3442013205 3442013205 IN IP4 192.168.0.13
+ o=- 3442013205 3442013205 IN IP4 [local_ip]
s=pjsip
- c=IN IP4 192.168.0.13
- t=0 0
- m=audio 4002 RTP/AVP 0
- a=rtpmap:0 PCMU/8000
- ]]>
- </send>
-
- <recv request="ACK"
- optional="false"
- rtd="true"
- crlf="true">
- </recv>
-
- <send>
- <![CDATA[
-
- SIP/2.0 200 OK
- [last_Via:]
- [last_From:]
- [last_To:];tag=[call_number]
- [last_Call-ID:]
- [last_CSeq:]
- Contact: <sip:target@192.168.0.13>
- Record-route: <sip:proxy@192.168.0.13;maddr=192.168.0.13>
- Content-Type: application/sdp
-
- v=0
- o=- 3442013205 3442013205 IN IP4 192.168.0.13
- s=pjsip
- c=IN IP4 192.168.0.13
+ c=IN IP4 [local_ip]
t=0 0
m=audio 4002 RTP/AVP 0
a=rtpmap:0 PCMU/8000
@@ -177,7 +148,7 @@
<!-- Keep the call open for a while in case the 200 is lost to be -->
<!-- able to retransmit it if we receive the BYE again. -->
- <pause milliseconds="4000"/>
+ <pause milliseconds="1000"/>
<!-- definition of the response time repartition table (unit is ms) -->
diff --git a/tests/pjsua/scripts-sipp/uac-inv-multiple-require.xml b/tests/pjsua/scripts-sipp/uac-inv-multiple-require.xml
index b0790f6e..384be82f 100644
--- a/tests/pjsua/scripts-sipp/uac-inv-multiple-require.xml
+++ b/tests/pjsua/scripts-sipp/uac-inv-multiple-require.xml
@@ -36,10 +36,7 @@
optional="true">
</recv>
- <recv response="180" optional="true">
- </recv>
-
- <recv response="200" rtd="true">
+ <recv response="420" rtd="true">
</recv>
<send>
@@ -59,27 +56,6 @@
]]>
</send>
- <pause/>
-
- <send retrans="500">
- <![CDATA[
-
- BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
- Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=z9hG4bK-1
- From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number]
- To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
- Call-ID: [call_id]
- CSeq: 2 BYE
- Contact: sip:sipp@[local_ip]:[local_port]
- Max-Forwards: 70
- Subject: Performance Test
- Content-Length: 0
-
- ]]>
- </send>
-
- <recv response="200" crlf="true">
- </recv>
<!-- definition of the response time repartition table (unit is ms) -->
<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
diff --git a/tests/pjsua/scripts-sipp/uac-inv-two-media-but-one-disabled-no-rtpmap.py b/tests/pjsua/scripts-sipp/uac-inv-two-media-but-one-disabled-no-rtpmap.py
new file mode 100644
index 00000000..7a457ad0
--- /dev/null
+++ b/tests/pjsua/scripts-sipp/uac-inv-two-media-but-one-disabled-no-rtpmap.py
@@ -0,0 +1,7 @@
+# $Id$
+#
+import inc_const as const
+
+PJSUA = ["--null-audio --max-calls=1 --auto-answer=200"]
+
+PJSUA_EXPECTS = [[0, const.STATE_CONFIRMED, "v"]]
diff --git a/tests/pjsua/scripts-sipp/uac-inv-two-media-but-one-disabled-no-rtpmap.xml b/tests/pjsua/scripts-sipp/uac-inv-two-media-but-one-disabled-no-rtpmap.xml
index e2b5b60f..0770fe92 100644
--- a/tests/pjsua/scripts-sipp/uac-inv-two-media-but-one-disabled-no-rtpmap.xml
+++ b/tests/pjsua/scripts-sipp/uac-inv-two-media-but-one-disabled-no-rtpmap.xml
@@ -87,8 +87,6 @@
<recv request="ACK" crlf="true">
</recv>
- <pause milliseconds="4000"/>
-
<!-- definition of the response time repartition table (unit is ms) -->
<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
diff --git a/tests/pjsua/scripts-sipp/uac-inv-without-sdp.py b/tests/pjsua/scripts-sipp/uac-inv-without-sdp.py
new file mode 100644
index 00000000..a822bf04
--- /dev/null
+++ b/tests/pjsua/scripts-sipp/uac-inv-without-sdp.py
@@ -0,0 +1,11 @@
+# $Id$
+#
+import inc_const as const
+
+PJSUA = ["--null-audio --max-calls=1"]
+
+PJSUA_EXPECTS = [[0, const.EVENT_INCOMING_CALL, "a"],
+ [0, "", "200"],
+ [0, const.MEDIA_ACTIVE, ""],
+ [0, const.STATE_CONFIRMED, "h"]
+ ]
diff --git a/tests/pjsua/scripts-sipp/uas.xml b/tests/pjsua/scripts-sipp/uac-inv-without-sdp.xml
index a6d4854f..929c83a0 100644
--- a/tests/pjsua/scripts-sipp/uas.xml
+++ b/tests/pjsua/scripts-sipp/uac-inv-without-sdp.xml
@@ -1,67 +1,110 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE scenario SYSTEM "sipp.dtd">
-
-<!-- This program is free software; you can redistribute it and/or -->
-<!-- modify it under the terms of the GNU General Public License as -->
-<!-- published by the Free Software Foundation; either version 2 of the -->
-<!-- License, or (at your option) any later version. -->
-<!-- -->
-<!-- This program is distributed in the hope that it will be useful, -->
-<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
-<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
-<!-- GNU General Public License for more details. -->
-<!-- -->
-<!-- You should have received a copy of the GNU General Public License -->
-<!-- along with this program; if not, write to the -->
-<!-- Free Software Foundation, Inc., -->
-<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -->
-<!-- -->
-<!-- Sipp default 'uas' scenario. -->
-<!-- -->
-
-<scenario name="Basic UAS responder">
- <!-- By adding rrs="true" (Record Route Sets), the route sets -->
- <!-- are saved and used for following messages sent. Useful to test -->
- <!-- against stateful SIP proxies/B2BUAs. -->
- <recv request="REGISTER" crlf="true">
- </recv>
-
- <!-- The '[last_*]' keyword is replaced automatically by the -->
- <!-- specified header if it was present in the last message received -->
- <!-- (except if it was a retransmission). If the header was not -->
- <!-- present or if no message has been received, the '[last_*]' -->
- <!-- keyword is discarded, and all bytes until the end of the line -->
- <!-- are also discarded. -->
- <!-- -->
- <!-- If the specified header was present several times in the -->
- <!-- message, all occurences are concatenated (CRLF seperated) -->
- <!-- to be used in place of the '[last_*]' keyword. -->
-
- <send retrans="500">
- <![CDATA[
-
- SIP/2.0 200 OK
- [last_Via:]
- [last_From:]
- [last_To:]
- [last_Call-ID:]
- [last_CSeq:]
- [last_Contact:]
- Expires: 300
- Content-Length: 0
- ]]>
- </send>
-
- <!-- Keep the call open for a while in case the 200 is lost to be -->
- <!-- able to retransmit it if we receive the BYE again. -->
- <pause milliseconds="4000"/>
-
-
- <!-- definition of the response time repartition table (unit is ms) -->
- <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
-
- <!-- definition of the call length repartition table (unit is ms) -->
- <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
-
-</scenario>
-
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<!-- This program is free software; you can redistribute it and/or -->
+<!-- modify it under the terms of the GNU General Public License as -->
+<!-- published by the Free Software Foundation; either version 2 of the -->
+<!-- License, or (at your option) any later version. -->
+<!-- -->
+<!-- This program is distributed in the hope that it will be useful, -->
+<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
+<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
+<!-- GNU General Public License for more details. -->
+<!-- -->
+<!-- You should have received a copy of the GNU General Public License -->
+<!-- along with this program; if not, write to the -->
+<!-- Free Software Foundation, Inc., -->
+<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -->
+<!-- -->
+<!-- -->
+
+<scenario name="UAC sending initial INVITE without SDP (#1526)">
+ <send retrans="500">
+ <![CDATA[
+
+ INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+ From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number]
+ To: sut <sip:[service]@[remote_ip]:[remote_port]>
+ Call-ID: [call_id]
+ CSeq: 1 INVITE
+ Contact: sip:sipp@[local_ip]:[local_port]
+ Max-Forwards: 70
+ Subject: Performance Test
+ Content-Type: application/sdp
+ Content-Length: [len]
+
+ ]]>
+ </send>
+
+ <recv response="100" optional="true">
+ </recv>
+
+ <recv response="180" optional="true">
+ </recv>
+
+ <recv response="200" rtd="true">
+ </recv>
+
+ <send>
+ <![CDATA[
+
+ ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+ From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number]
+ To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
+ Call-ID: [call_id]
+ CSeq: 1 ACK
+ Contact: sip:sipp@[local_ip]:[local_port]
+ Max-Forwards: 70
+ Subject: Performance Test
+ Content-Type: application/sdp
+ Content-Length: [len]
+
+v=0
+o=BroadWorks 1378618 0 IN IP4 192.168.2.25
+s=-
+c=IN IP4 192.168.2.25
+t=0 0
+m=audio 4020 RTP/AVP 0 101
+c=IN IP4 192.168.2.25
+a=rtpmap:101 telephone-event/8000
+a=fmtp:101 0-15
+m=video 4022 RTP/AVP 97
+c=IN IP4 192.168.2.25
+b=TIAS:512000
+a=rtpmap:97 H264/90000
+a=fmtp:97 profile-level-id=42900b
+a=orient:portrait
+a=rtcp-fb:* nack pli
+
+ ]]>
+ </send>
+
+<!-- Assertion occured here before r4175 (see ticket #1526) -->
+
+ <recv request="BYE" crlf="true">
+ </recv>
+
+ <send>
+ <![CDATA[
+
+ SIP/2.0 200 OK
+ [last_Via:]
+ [last_From:]
+ [last_To:]
+ [last_Call-ID:]
+ [last_CSeq:]
+ [last_Contact:]
+ Content-Length: 0
+ ]]>
+ </send>
+
+ <!-- definition of the response time repartition table (unit is ms) -->
+ <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
+
+ <!-- definition of the call length repartition table (unit is ms) -->
+ <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
+
+</scenario>
+
diff --git a/tests/pjsua/scripts-sipp/uac-ticket-1148.py b/tests/pjsua/scripts-sipp/uac-ticket-1148.py
new file mode 100644
index 00000000..7a457ad0
--- /dev/null
+++ b/tests/pjsua/scripts-sipp/uac-ticket-1148.py
@@ -0,0 +1,7 @@
+# $Id$
+#
+import inc_const as const
+
+PJSUA = ["--null-audio --max-calls=1 --auto-answer=200"]
+
+PJSUA_EXPECTS = [[0, const.STATE_CONFIRMED, "v"]]
diff --git a/tests/pjsua/scripts-sipp/uac-ticket-1148.xml b/tests/pjsua/scripts-sipp/uac-ticket-1148.xml
index b617b37a..2a2ec8be 100644
--- a/tests/pjsua/scripts-sipp/uac-ticket-1148.xml
+++ b/tests/pjsua/scripts-sipp/uac-ticket-1148.xml
@@ -88,8 +88,6 @@
<recv request="ACK" crlf="true">
</recv>
- <pause milliseconds="4000"/>
-
<!-- definition of the response time repartition table (unit is ms) -->
<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
diff --git a/tests/pjsua/scripts-sipp/uas-answer-180-multiple-fmts-support-update.xml b/tests/pjsua/scripts-sipp/uas-answer-180-multiple-fmts-support-update.xml
index e75e7c76..80162722 100644
--- a/tests/pjsua/scripts-sipp/uas-answer-180-multiple-fmts-support-update.xml
+++ b/tests/pjsua/scripts-sipp/uas-answer-180-multiple-fmts-support-update.xml
@@ -155,10 +155,8 @@
]]>
</send>
- <!-- Keep the call open for a while in case the 200 is lost to be -->
- <!-- able to retransmit it if we receive the BYE again. -->
- <pause milliseconds="4000"/>
-
+ <recv response="200">
+ </recv>
<!-- definition of the response time repartition table (unit is ms) -->
<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
diff --git a/tests/pjsua/scripts-sipp/uas-answer-180-multiple-fmts.xml b/tests/pjsua/scripts-sipp/uas-answer-180-multiple-fmts.xml
index bc27c9df..5ff1f996 100644
--- a/tests/pjsua/scripts-sipp/uas-answer-180-multiple-fmts.xml
+++ b/tests/pjsua/scripts-sipp/uas-answer-180-multiple-fmts.xml
@@ -157,9 +157,8 @@
]]>
</send>
- <!-- Keep the call open for a while in case the 200 is lost to be -->
- <!-- able to retransmit it if we receive the BYE again. -->
- <pause milliseconds="4000"/>
+ <recv response="200">
+ </recv>
<!-- definition of the response time repartition table (unit is ms) -->
diff --git a/tests/pjsua/scripts-sipp/uas-answer-200-multiple-fmts-support-update.xml b/tests/pjsua/scripts-sipp/uas-answer-200-multiple-fmts-support-update.xml
index 5d576003..86053814 100644
--- a/tests/pjsua/scripts-sipp/uas-answer-200-multiple-fmts-support-update.xml
+++ b/tests/pjsua/scripts-sipp/uas-answer-200-multiple-fmts-support-update.xml
@@ -124,9 +124,8 @@
]]>
</send>
- <!-- Keep the call open for a while in case the 200 is lost to be -->
- <!-- able to retransmit it if we receive the BYE again. -->
- <pause milliseconds="4000"/>
+ <recv response="200">
+ </recv>
<!-- definition of the response time repartition table (unit is ms) -->
diff --git a/tests/pjsua/scripts-sipp/uas-answer-200-multiple-fmts.xml b/tests/pjsua/scripts-sipp/uas-answer-200-multiple-fmts.xml
index 4e4170d2..9fee67be 100644
--- a/tests/pjsua/scripts-sipp/uas-answer-200-multiple-fmts.xml
+++ b/tests/pjsua/scripts-sipp/uas-answer-200-multiple-fmts.xml
@@ -125,10 +125,8 @@
]]>
</send>
- <!-- Keep the call open for a while in case the 200 is lost to be -->
- <!-- able to retransmit it if we receive the BYE again. -->
- <pause milliseconds="4000"/>
-
+ <recv response="200">
+ </recv>
<!-- definition of the response time repartition table (unit is ms) -->
<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
diff --git a/tests/pjsua/scripts-sipp/uas-answer-200-reinvite-without-sdp.py b/tests/pjsua/scripts-sipp/uas-answer-200-reinvite-without-sdp.py
new file mode 100644
index 00000000..7f1de45d
--- /dev/null
+++ b/tests/pjsua/scripts-sipp/uas-answer-200-reinvite-without-sdp.py
@@ -0,0 +1,7 @@
+# $Id$
+#
+import inc_const as const
+
+PJSUA = ["--null-audio --max-calls=1 sip:localhost:6000"]
+
+PJSUA_EXPECTS = [[0, const.STATE_CONFIRMED, "v"]]
diff --git a/tests/pjsua/scripts-sipp/uas-answer-200-reinvite-without-sdp.xml b/tests/pjsua/scripts-sipp/uas-answer-200-reinvite-without-sdp.xml
index 7634545f..f51c4212 100644
--- a/tests/pjsua/scripts-sipp/uas-answer-200-reinvite-without-sdp.xml
+++ b/tests/pjsua/scripts-sipp/uas-answer-200-reinvite-without-sdp.xml
@@ -75,10 +75,6 @@
<recv request="ACK" crlf="true">
</recv>
- <!-- Keep the call open for a while in case the 200 is lost to be -->
- <!-- able to retransmit it if we receive the BYE again. -->
- <pause milliseconds="4000"/>
-
<!-- definition of the response time repartition table (unit is ms) -->
<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
diff --git a/tests/pjsua/scripts-sipp/uas-answer-200-update-without-sdp.py b/tests/pjsua/scripts-sipp/uas-answer-200-update-without-sdp.py
new file mode 100644
index 00000000..8699d0b2
--- /dev/null
+++ b/tests/pjsua/scripts-sipp/uas-answer-200-update-without-sdp.py
@@ -0,0 +1,7 @@
+# $Id$
+#
+import inc_const as const
+
+PJSUA = ["--null-audio --max-calls=1 sip:localhost:6000"]
+
+PJSUA_EXPECTS = [[0, const.STATE_CONFIRMED, "U"]]
diff --git a/tests/pjsua/scripts-sipp/uas-answer-200-update-without-sdp.xml b/tests/pjsua/scripts-sipp/uas-answer-200-update-without-sdp.xml
index 646e1f4f..e561db1d 100644
--- a/tests/pjsua/scripts-sipp/uas-answer-200-update-without-sdp.xml
+++ b/tests/pjsua/scripts-sipp/uas-answer-200-update-without-sdp.xml
@@ -72,10 +72,6 @@
]]>
</send>
- <!-- Keep the call open for a while in case the 200 is lost to be -->
- <!-- able to retransmit it if we receive the BYE again. -->
- <pause milliseconds="4000"/>
-
<!-- definition of the response time repartition table (unit is ms) -->
<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
diff --git a/tests/pjsua/scripts-sipp/uas-auth.py b/tests/pjsua/scripts-sipp/uas-auth.py
new file mode 100644
index 00000000..38a88eb5
--- /dev/null
+++ b/tests/pjsua/scripts-sipp/uas-auth.py
@@ -0,0 +1,7 @@
+# $Id$
+#
+import inc_const as const
+
+PJSUA = ["--null-audio --max-calls=1 --id=sip:a@localhost --username=a --realm=* --registrar=sip:localhost:6000"]
+
+PJSUA_EXPECTS = []
diff --git a/tests/pjsua/scripts-sipp/uas-auth.xml b/tests/pjsua/scripts-sipp/uas-auth.xml
index 71da30f2..96be0b9c 100644
--- a/tests/pjsua/scripts-sipp/uas-auth.xml
+++ b/tests/pjsua/scripts-sipp/uas-auth.xml
@@ -54,9 +54,6 @@
</send>
- <pause milliseconds="1000"/>
-
-
<!-- definition of the response time repartition table (unit is ms) -->
<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
diff --git a/tests/pjsua/scripts-sipp/uas-cancel-no-final.py b/tests/pjsua/scripts-sipp/uas-cancel-no-final.py
new file mode 100644
index 00000000..4d100a14
--- /dev/null
+++ b/tests/pjsua/scripts-sipp/uas-cancel-no-final.py
@@ -0,0 +1,7 @@
+# $Id$
+#
+import inc_const as const
+
+PJSUA = ["--null-audio --max-calls=1 sip:localhost:6000"]
+
+PJSUA_EXPECTS = [[0, const.STATE_EARLY, "h"]]
diff --git a/tests/pjsua/scripts-sipp/uas-forked-200.xml b/tests/pjsua/scripts-sipp/uas-forked-200.xml
index 229f7d89..3878ad4a 100644
--- a/tests/pjsua/scripts-sipp/uas-forked-200.xml
+++ b/tests/pjsua/scripts-sipp/uas-forked-200.xml
@@ -117,21 +117,6 @@
crlf="true">
</recv>
- <!-- Receive BYE -->
- <recv request="BYE" crlf="true">
- </recv>
-
- <!-- Send 200/OK to BYE -->
- <send>
- <![CDATA[
- SIP/2.0 200 OK
- [last_Via:]
- [last_From:]
- [last_To:]
- [last_Call-ID:]
- [last_CSeq:]
- ]]>
- </send>
<!-- definition of the response time repartition table (unit is ms) -->
<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
diff --git a/tests/pjsua/scripts-sipp/inv_401_retry_after_100.xml b/tests/pjsua/scripts-sipp/uas-inv_401_retry_after_100.xml
index 6debd134..6debd134 100644
--- a/tests/pjsua/scripts-sipp/inv_401_retry_after_100.xml
+++ b/tests/pjsua/scripts-sipp/uas-inv_401_retry_after_100.xml
diff --git a/tests/pjsua/scripts-sipp/uas-invite.xml b/tests/pjsua/scripts-sipp/uas-invite.xml
index 040f14ba..1f928e7c 100644
--- a/tests/pjsua/scripts-sipp/uas-invite.xml
+++ b/tests/pjsua/scripts-sipp/uas-invite.xml
@@ -46,7 +46,7 @@
[last_To:];tag=[call_number]
[last_Call-ID:]
[last_CSeq:]
- Contact: <sip:192.168.0.15>
+ Contact: <sip:sipp@[local_ip]:[local_port]>
Content-Type: application/sdp
v=0
@@ -66,10 +66,6 @@
<recv request="ACK" crlf="true">
</recv>
- <!-- Keep the call open for a while in case the 200 is lost to be -->
- <!-- able to retransmit it if we receive the BYE again. -->
- <pause milliseconds="4000"/>
-
<!-- definition of the response time repartition table (unit is ms) -->
<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
diff --git a/tests/pjsua/scripts-sipp/uas-mwi-0.py b/tests/pjsua/scripts-sipp/uas-mwi-0.py
new file mode 100644
index 00000000..722e0b3f
--- /dev/null
+++ b/tests/pjsua/scripts-sipp/uas-mwi-0.py
@@ -0,0 +1,7 @@
+# $Id$
+#
+import inc_const as const
+
+PJSUA = ["--null-audio --max-calls=1 --id sip:pjsua@localhost:6000 --mwi"]
+
+PJSUA_EXPECTS = []
diff --git a/tests/pjsua/scripts-sipp/uas-mwi-0.xml b/tests/pjsua/scripts-sipp/uas-mwi-0.xml
index 58f2bd48..6697c17e 100644
--- a/tests/pjsua/scripts-sipp/uas-mwi-0.xml
+++ b/tests/pjsua/scripts-sipp/uas-mwi-0.xml
@@ -16,13 +16,6 @@
<!-- Free Software Foundation, Inc., -->
<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -->
<!-- -->
-<!-- Late NOTIFY scenario: -->
-<!-- - UAC sends SUBSCRIBE, we reply with 200 -->
-<!-- - we send NOTIFY, expect 200 -->
-<!-- - UAC sends SUBSCRIBE, we ignore -->
-<!-- - we send NOTIFY -->
-<!-- See http://trac.pjsip.org/repos/ticket/911 -->
-<!-- -->
<scenario name="MWI server with immediate final notify">
<recv request="SUBSCRIBE" crlf="true">
diff --git a/tests/pjsua/scripts-sipp/uas-mwi.py b/tests/pjsua/scripts-sipp/uas-mwi.py
new file mode 100644
index 00000000..722e0b3f
--- /dev/null
+++ b/tests/pjsua/scripts-sipp/uas-mwi.py
@@ -0,0 +1,7 @@
+# $Id$
+#
+import inc_const as const
+
+PJSUA = ["--null-audio --max-calls=1 --id sip:pjsua@localhost:6000 --mwi"]
+
+PJSUA_EXPECTS = []
diff --git a/tests/pjsua/scripts-sipp/uas-mwi.xml b/tests/pjsua/scripts-sipp/uas-mwi.xml
index 00e70371..ed811956 100644
--- a/tests/pjsua/scripts-sipp/uas-mwi.xml
+++ b/tests/pjsua/scripts-sipp/uas-mwi.xml
@@ -16,13 +16,6 @@
<!-- Free Software Foundation, Inc., -->
<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -->
<!-- -->
-<!-- Late NOTIFY scenario: -->
-<!-- - UAC sends SUBSCRIBE, we reply with 200 -->
-<!-- - we send NOTIFY, expect 200 -->
-<!-- - UAC sends SUBSCRIBE, we ignore -->
-<!-- - we send NOTIFY -->
-<!-- See http://trac.pjsip.org/repos/ticket/911 -->
-<!-- -->
<scenario name="MWI server">
<recv request="SUBSCRIBE" crlf="true">
@@ -74,7 +67,7 @@
<recv response="200">
</recv>
- <pause milliseconds="10000"/>
+ <pause milliseconds="2000"/>
<!-- terminate subscription -->
diff --git a/tests/pjsua/scripts-sipp/prack_fork.xml b/tests/pjsua/scripts-sipp/uas-prack_fork.xml
index 6caf3220..ae1c6054 100644
--- a/tests/pjsua/scripts-sipp/prack_fork.xml
+++ b/tests/pjsua/scripts-sipp/uas-prack_fork.xml
@@ -118,28 +118,6 @@
crlf="true">
</recv>
- <!-- Receive BYE -->
- <recv request="BYE" crlf="true">
- </recv>
-
- <!-- Send 200/OK to BYE -->
- <send>
- <![CDATA[
- SIP/2.0 200 OK
- [last_Via:]
- [last_From:]
- [last_To:]
- [last_Call-ID:]
- [last_CSeq:]
- ]]>
- </send>
-
-
-
- <!-- Keep the call open for a while in case the 200 is lost to be -->
- <!-- able to retransmit it if we receive the BYE again. -->
- <pause milliseconds="4000"/>
-
<!-- definition of the response time repartition table (unit is ms) -->
<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
diff --git a/tests/pjsua/scripts-sipp/uas-reinv-glare.py b/tests/pjsua/scripts-sipp/uas-reinv-glare.py
new file mode 100644
index 00000000..8699d0b2
--- /dev/null
+++ b/tests/pjsua/scripts-sipp/uas-reinv-glare.py
@@ -0,0 +1,7 @@
+# $Id$
+#
+import inc_const as const
+
+PJSUA = ["--null-audio --max-calls=1 sip:localhost:6000"]
+
+PJSUA_EXPECTS = [[0, const.STATE_CONFIRMED, "U"]]
diff --git a/tests/pjsua/scripts-sipp/uas-subscribe-late-notify.py b/tests/pjsua/scripts-sipp/uas-subscribe-late-notify.py
new file mode 100644
index 00000000..c69332ea
--- /dev/null
+++ b/tests/pjsua/scripts-sipp/uas-subscribe-late-notify.py
@@ -0,0 +1,11 @@
+# $Id$
+#
+import inc_const as const
+
+PJSUA = ["--null-audio --max-calls=1 --id sip:pjsua@localhost:6000 --add-buddy sip:sipp@localhost:6000"]
+
+PJSUA_EXPECTS = [[0, "", "s"],
+ [0, "Subscribe presence of:", "1"],
+ [0, "subscription state is ACTIVE", ""],
+ [0, "subscription state is TERMINATED", ""]
+ ]
diff --git a/tests/pjsua/scripts-sipp/uas-subscribe-late-notify.xml b/tests/pjsua/scripts-sipp/uas-subscribe-late-notify.xml
index 918a382d..7bf06648 100644
--- a/tests/pjsua/scripts-sipp/uas-subscribe-late-notify.xml
+++ b/tests/pjsua/scripts-sipp/uas-subscribe-late-notify.xml
@@ -74,7 +74,7 @@
Contact: sip:sipp@[local_ip]:[local_port]
Max-Forwards: 70
Event: presence
- Subscription-State: active;expires=50
+ Subscription-State: active;expires=10
Content-Type: application/pidf+xml
<?xml version="1.0" encoding="UTF-8"?>
diff --git a/tests/pjsua/scripts-sipp/uas-subscribe-multipart-notify.py b/tests/pjsua/scripts-sipp/uas-subscribe-multipart-notify.py
new file mode 100644
index 00000000..c792bdda
--- /dev/null
+++ b/tests/pjsua/scripts-sipp/uas-subscribe-multipart-notify.py
@@ -0,0 +1,11 @@
+# $Id$
+#
+import inc_const as const
+
+PJSUA = ["--null-audio --max-calls=1 --id sip:pjsua@localhost:6000 --add-buddy sip:sipp@localhost:6000"]
+
+PJSUA_EXPECTS = [[0, "", "s"],
+ [0, "Subscribe presence of:", "1"],
+ [0, "sip:sipp@localhost:6000 .* Online", ""],
+ [0, "subscription state is TERMINATED", ""]
+ ]
diff --git a/tests/pjsua/scripts-sipp/uas-subscribe-multipart-notify.xml b/tests/pjsua/scripts-sipp/uas-subscribe-multipart-notify.xml
index 7cfdef27..e2e1f9b1 100644
--- a/tests/pjsua/scripts-sipp/uas-subscribe-multipart-notify.xml
+++ b/tests/pjsua/scripts-sipp/uas-subscribe-multipart-notify.xml
@@ -55,7 +55,7 @@
Contact: sip:sipp@[local_ip]:[local_port]
Max-Forwards: 70
Event: presence
- Subscription-State: active;expires=50
+ Subscription-State: active;expires=10
Content-Type: multipart/mixed;boundary=abcd
--abcd
diff --git a/tests/pjsua/scripts-sipp/uas-subscribe-notify-terminate.py b/tests/pjsua/scripts-sipp/uas-subscribe-notify-terminate.py
new file mode 100644
index 00000000..66c09f55
--- /dev/null
+++ b/tests/pjsua/scripts-sipp/uas-subscribe-notify-terminate.py
@@ -0,0 +1,10 @@
+# $Id$
+#
+import inc_const as const
+
+PJSUA = ["--null-audio --max-calls=1 --id sip:pjsua@localhost:6000 --add-buddy sip:sipp@localhost:6000"]
+
+PJSUA_EXPECTS = [[0, "", "s"],
+ [0, "Subscribe presence of:", "1"],
+ [0, "subscription state is TERMINATED", ""]
+ ]
diff --git a/tests/pjsua/scripts-sipp/uas-subscribe-refresh-481.py b/tests/pjsua/scripts-sipp/uas-subscribe-refresh-481.py
new file mode 100644
index 00000000..c792bdda
--- /dev/null
+++ b/tests/pjsua/scripts-sipp/uas-subscribe-refresh-481.py
@@ -0,0 +1,11 @@
+# $Id$
+#
+import inc_const as const
+
+PJSUA = ["--null-audio --max-calls=1 --id sip:pjsua@localhost:6000 --add-buddy sip:sipp@localhost:6000"]
+
+PJSUA_EXPECTS = [[0, "", "s"],
+ [0, "Subscribe presence of:", "1"],
+ [0, "sip:sipp@localhost:6000 .* Online", ""],
+ [0, "subscription state is TERMINATED", ""]
+ ]
diff --git a/tests/pjsua/scripts-sipp/uas-subscribe-refresh-481.xml b/tests/pjsua/scripts-sipp/uas-subscribe-refresh-481.xml
index 5f116501..0cb26829 100644
--- a/tests/pjsua/scripts-sipp/uas-subscribe-refresh-481.xml
+++ b/tests/pjsua/scripts-sipp/uas-subscribe-refresh-481.xml
@@ -16,13 +16,6 @@
<!-- Free Software Foundation, Inc., -->
<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -->
<!-- -->
-<!-- Late NOTIFY scenario: -->
-<!-- - UAC sends SUBSCRIBE, we reply with 200 -->
-<!-- - we send NOTIFY, expect 200 -->
-<!-- - UAC sends SUBSCRIBE, we ignore -->
-<!-- - we send NOTIFY -->
-<!-- See http://trac.pjsip.org/repos/ticket/911 -->
-<!-- -->
<scenario name="SUBSCRIBE tests">
<!-- Establish subscription -->
@@ -60,7 +53,7 @@
Contact: sip:sipp@[local_ip]:[local_port]
Max-Forwards: 70
Event: presence
- Subscription-State: active;expires=50
+ Subscription-State: active;expires=10
Content-Type: application/pidf+xml
<?xml version="1.0" encoding="UTF-8"?>
diff --git a/tests/pjsua/scripts-sipp/uas-subscribe-terminated-retry.py b/tests/pjsua/scripts-sipp/uas-subscribe-terminated-retry.py
new file mode 100644
index 00000000..404603c0
--- /dev/null
+++ b/tests/pjsua/scripts-sipp/uas-subscribe-terminated-retry.py
@@ -0,0 +1,11 @@
+# $Id$
+#
+import inc_const as const
+
+PJSUA = ["--null-audio --max-calls=1 --id sip:pjsua@localhost:6000 --add-buddy sip:sipp@localhost:6000"]
+
+PJSUA_EXPECTS = [[0, "", "s"],
+ [0, "Subscribe presence of:", "1"],
+ [0, "Presence subscription .* is TERMINATED", ""],
+ [0, "Resubscribing .* in 5000 ms", ""]
+ ]