Index: pjproject/trunk/tests/pjsua/inc_const.py
===================================================================
--- pjproject/trunk/tests/pjsua/inc_const.py	(revision 4176)
+++ pjproject/trunk/tests/pjsua/inc_const.py	(revision 4177)
@@ -22,4 +22,6 @@
 # Call state is CALLING
 STATE_CALLING = "state.*CALLING"
+# Call state is EARLY
+STATE_EARLY = "state.*EARLY"
 # Call state is CONFIRMED
 STATE_CONFIRMED = "state.*CONFIRMED"
Index: pjproject/trunk/tests/pjsua/mod_sipp.py
===================================================================
--- pjproject/trunk/tests/pjsua/mod_sipp.py	(revision 4176)
+++ pjproject/trunk/tests/pjsua/mod_sipp.py	(revision 4177)
@@ -8,4 +8,5 @@
 import subprocess
 from inc_cfg import *
+import inc_const
 
 # SIPp executable path and param
@@ -13,12 +14,17 @@
 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)
@@ -58,5 +64,5 @@
 	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
@@ -132,13 +138,4 @@
 	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):
@@ -159,4 +156,15 @@
 	    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
Index: pjproject/trunk/tests/pjsua/runall.py
===================================================================
--- pjproject/trunk/tests/pjsua/runall.py	(revision 4176)
+++ pjproject/trunk/tests/pjsua/runall.py	(revision 4177)
@@ -56,4 +56,9 @@
     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:
@@ -104,5 +109,5 @@
                         (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):
@@ -163,4 +168,5 @@
 		logname = re.sub("[\\\/]", "_", logname)
 		logname = re.sub("\.py$", ".log", logname)
+		logname = re.sub("\.xml$", ".log", logname)
 		logname = "logs/" + logname
 		shutil.move("output.log", logname)
Index: pjproject/trunk/tests/pjsua/scripts-sipp/inv_401_retry_after_100.xml
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/inv_401_retry_after_100.xml	(revision 4176)
+++ 	(revision )
@@ -1,106 +1,0 @@
-<?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="Authorization retry after 1xx response test">
-  <!-- Wait for INVITE request -->
-  <recv request="INVITE" crlf="true">
-  </recv>
-
-  <!-- Send 100 Trying -->
-  <send>
-    <![CDATA[
-
-      SIP/2.0 100 Trying
-      [last_Via:]
-      [last_From:]
-      [last_To:]
-      [last_Call-ID:]
-      [last_CSeq:]
-    ]]>
-  </send>
-
-  <!-- Send 180 Ringing (with tag) -->
-  <send>
-    <![CDATA[
-
-      SIP/2.0 180 Ringing
-      [last_Via:]
-      [last_From:]
-      [last_To:];tag=[call_number]
-      [last_Call-ID:]
-      [last_CSeq:]
-    ]]>
-  </send>
-
-  <!-- Send 401 Unauthorized -->
-  <send retrans="500">
-    <![CDATA[
-
-      SIP/2.0 401 Unauthorized
-      [last_Via:]
-      [last_From:]
-      [last_To:];tag=[call_number]
-      [last_Call-ID:]
-      [last_CSeq:]
-      WWW-Authenticate: Digest realm="sipp", nonce="1234"
-      Content-Length: 0
-    ]]>
-  </send>
-
-  <!-- Wait for ACK -->
-  <recv request="ACK"
-        optional="false"
-        rtd="true"
-        crlf="true">
-  </recv>
-
-  <!-- Wait for INVITE retransmission -->
-  <recv request="INVITE" crlf="true">
-  </recv>
-
-  <!-- Send 500 Test Success to terminate the call -->
-  <send retrans="500">
-    <![CDATA[
-
-      SIP/2.0 500 Test Success
-      [last_Via:]
-      [last_From:]
-      [last_To:];tag=[call_number]
-      [last_Call-ID:]
-      [last_CSeq:]
-      Content-Length: 0
-    ]]>
-  </send>
-
-  <!-- Wait for ACK -->
-  <recv request="ACK"
-        optional="false"
-        rtd="true"
-        crlf="true">
-  </recv>
-
-  <!-- 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>
-
Index: pjproject/trunk/tests/pjsua/scripts-sipp/prack_fork.xml
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/prack_fork.xml	(revision 4176)
+++ 	(revision )
@@ -1,151 +1,0 @@
-<?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="Forked INVITE, one of them require PRACK">
-  <recv request="INVITE" crlf="true">
-   <action>
-    <ereg regexp="branch=([0-9a-zA-Z]*)"
-          search_in="msg"
-          assign_to="3"/>
-    <ereg regexp="CSeq: ([0-9a-zA-Z ]*)"
-          search_in="msg"
-          assign_to="4"/>
-   </action>
-  </recv>
-
-  <send>
-    <![CDATA[
-      SIP/2.0 100 Trying
-      [last_Via:]
-      [last_From:]
-      [last_To:];tag=[call_number]
-      [last_Call-ID:]
-      [last_CSeq:]
-    ]]>
-  </send>
-
-  <!-- Call leg 1: 180/Ringing -->
-  <send>
-    <![CDATA[
-      SIP/2.0 180 Ringing
-      [last_Via:]
-      [last_From:]
-      [last_To:];tag=1
-      [last_Call-ID:]
-      [last_CSeq:]
-      Contact: <sip:WRONG_UA@192.168.0.1>
-    ]]>
-  </send>
-
-  <!-- Call leg 2: 180/Ringing with 100rel -->
-  <send retrans="1000">
-    <![CDATA[
-      SIP/2.0 180 Ringing
-      [last_Via:]
-      [last_From:]
-      [last_To:];tag=2
-      [last_Call-ID:]
-      [last_CSeq:]
-      Require: 100rel
-      RSeq: 1
-      Contact: <sip:RIGHT_UA@[local_ip]:[local_port]>
-    ]]>
-  </send>
-
-  <!-- Expect PRACK -->
-  <recv request="PRACK"
-        optional="false"
-        rtd="true"
-        crlf="true">
-  </recv>
-
-  <!-- Send 200/OK to PRACK -->
-  <send>
-    <![CDATA[
-      SIP/2.0 200 OK
-      [last_Via:]
-      [last_From:]
-      [last_To:]
-      [last_Call-ID:]
-      [last_CSeq:]
-    ]]>
-  </send>
-
-  <!-- Send 200/OK to INVITE -->
-  <send retrans="500">
-    <![CDATA[
-      SIP/2.0 200 OK
-      Via: SIP/2.0/UDP 127.0.0.1:5080;received=127.0.0.1;rport=5080;[$3]
-      [last_From:]
-      [last_To:];tag=2
-      [last_Call-ID:]
-      [$4]
-      Contact: <sip:RIGHT_UA@[local_ip]:[local_port]>
-      Content-Type: application/sdp
-
-      v=0
-      o=- 3442013205 3442013205 IN IP4 192.168.0.13
-      s=pjsip
-      c=IN IP4 192.168.0.13
-      t=0 0
-      m=audio 4002 RTP/AVP 0
-      a=rtpmap:0 PCMU/8000
-    ]]>
-  </send>
-
-  <!-- Receive ACK -->
-  <recv request="ACK"
-        optional="false"
-        rtd="true"
-        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"/>
-
-  <!-- definition of the call length repartition table (unit is ms)     -->
-  <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
-
-</scenario>
-
Index: pjproject/trunk/tests/pjsua/scripts-sipp/strict-route.py
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/strict-route.py	(revision 4177)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/strict-route.py	(revision 4177)
@@ -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"]
+ 		 ]
Index: pjproject/trunk/tests/pjsua/scripts-sipp/strict-route.xml
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/strict-route.xml	(revision 4176)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/strict-route.xml	(revision 4177)
@@ -89,12 +89,12 @@
       [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
@@ -112,41 +112,12 @@
       [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
@@ -178,5 +149,5 @@
   <!-- 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"/>
 
 
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uac-inv-multiple-require.xml
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uac-inv-multiple-require.xml	(revision 4176)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uac-inv-multiple-require.xml	(revision 4177)
@@ -37,8 +37,5 @@
   </recv>
 
-  <recv response="180" optional="true">
-  </recv>
-
-  <recv response="200" rtd="true">
+  <recv response="420" rtd="true">
   </recv>
 
@@ -60,25 +57,4 @@
   </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)   -->
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uac-inv-two-media-but-one-disabled-no-rtpmap.py
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uac-inv-two-media-but-one-disabled-no-rtpmap.py	(revision 4177)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uac-inv-two-media-but-one-disabled-no-rtpmap.py	(revision 4177)
@@ -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"]]
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uac-inv-two-media-but-one-disabled-no-rtpmap.xml
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uac-inv-two-media-but-one-disabled-no-rtpmap.xml	(revision 4176)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uac-inv-two-media-but-one-disabled-no-rtpmap.xml	(revision 4177)
@@ -88,6 +88,4 @@
   </recv>
 
-  <pause milliseconds="4000"/>
-
   <!-- definition of the response time repartition table (unit is ms)   -->
   <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uac-inv-without-sdp.py
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uac-inv-without-sdp.py	(revision 4177)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uac-inv-without-sdp.py	(revision 4177)
@@ -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"]
+		 ]
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uac-inv-without-sdp.xml
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uac-inv-without-sdp.xml	(revision 4177)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uac-inv-without-sdp.xml	(revision 4177)
@@ -0,0 +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             -->
+<!--                                                                    -->
+<!--                                                                    -->
+
+<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>
+
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uac-ticket-1148.py
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uac-ticket-1148.py	(revision 4177)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uac-ticket-1148.py	(revision 4177)
@@ -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"]]
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uac-ticket-1148.xml
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uac-ticket-1148.xml	(revision 4176)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uac-ticket-1148.xml	(revision 4177)
@@ -89,6 +89,4 @@
   </recv>
 
-  <pause milliseconds="4000"/>
-
   <!-- definition of the response time repartition table (unit is ms)   -->
   <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-180-multiple-fmts-support-update.xml
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-180-multiple-fmts-support-update.xml	(revision 4176)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-180-multiple-fmts-support-update.xml	(revision 4177)
@@ -156,8 +156,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"/>
-
+  <recv response="200">
+  </recv>
 
   <!-- definition of the response time repartition table (unit is ms)   -->
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-180-multiple-fmts.xml
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-180-multiple-fmts.xml	(revision 4176)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-180-multiple-fmts.xml	(revision 4177)
@@ -158,7 +158,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"/>
+  <recv response="200">
+  </recv>
 
 
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-200-multiple-fmts-support-update.xml
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-200-multiple-fmts-support-update.xml	(revision 4176)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-200-multiple-fmts-support-update.xml	(revision 4177)
@@ -125,7 +125,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"/>
+  <recv response="200">
+  </recv>
 
 
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-200-multiple-fmts.xml
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-200-multiple-fmts.xml	(revision 4176)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-200-multiple-fmts.xml	(revision 4177)
@@ -126,8 +126,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"/>
-
+  <recv response="200">
+  </recv>
 
   <!-- definition of the response time repartition table (unit is ms)   -->
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-200-reinvite-without-sdp.py
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-200-reinvite-without-sdp.py	(revision 4177)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-200-reinvite-without-sdp.py	(revision 4177)
@@ -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"]]
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-200-reinvite-without-sdp.xml
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-200-reinvite-without-sdp.xml	(revision 4176)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-200-reinvite-without-sdp.xml	(revision 4177)
@@ -76,8 +76,4 @@
   </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)   -->
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-200-update-without-sdp.py
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-200-update-without-sdp.py	(revision 4177)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-200-update-without-sdp.py	(revision 4177)
@@ -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"]]
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-200-update-without-sdp.xml
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-200-update-without-sdp.xml	(revision 4176)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uas-answer-200-update-without-sdp.xml	(revision 4177)
@@ -73,8 +73,4 @@
   </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)   -->
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uas-auth.py
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uas-auth.py	(revision 4177)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uas-auth.py	(revision 4177)
@@ -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 = []
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uas-auth.xml
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uas-auth.xml	(revision 4176)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uas-auth.xml	(revision 4177)
@@ -55,7 +55,4 @@
 
 
-  <pause milliseconds="1000"/>
-
-
   <!-- definition of the response time repartition table (unit is ms)   -->
   <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uas-cancel-no-final.py
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uas-cancel-no-final.py	(revision 4177)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uas-cancel-no-final.py	(revision 4177)
@@ -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"]]
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uas-forked-200.xml
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uas-forked-200.xml	(revision 4176)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uas-forked-200.xml	(revision 4177)
@@ -118,19 +118,4 @@
   </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)   -->
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uas-inv_401_retry_after_100.xml
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uas-inv_401_retry_after_100.xml	(revision 4177)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uas-inv_401_retry_after_100.xml	(revision 4177)
@@ -0,0 +1,106 @@
+<?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="Authorization retry after 1xx response test">
+  <!-- Wait for INVITE request -->
+  <recv request="INVITE" crlf="true">
+  </recv>
+
+  <!-- Send 100 Trying -->
+  <send>
+    <![CDATA[
+
+      SIP/2.0 100 Trying
+      [last_Via:]
+      [last_From:]
+      [last_To:]
+      [last_Call-ID:]
+      [last_CSeq:]
+    ]]>
+  </send>
+
+  <!-- Send 180 Ringing (with tag) -->
+  <send>
+    <![CDATA[
+
+      SIP/2.0 180 Ringing
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+    ]]>
+  </send>
+
+  <!-- Send 401 Unauthorized -->
+  <send retrans="500">
+    <![CDATA[
+
+      SIP/2.0 401 Unauthorized
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      WWW-Authenticate: Digest realm="sipp", nonce="1234"
+      Content-Length: 0
+    ]]>
+  </send>
+
+  <!-- Wait for ACK -->
+  <recv request="ACK"
+        optional="false"
+        rtd="true"
+        crlf="true">
+  </recv>
+
+  <!-- Wait for INVITE retransmission -->
+  <recv request="INVITE" crlf="true">
+  </recv>
+
+  <!-- Send 500 Test Success to terminate the call -->
+  <send retrans="500">
+    <![CDATA[
+
+      SIP/2.0 500 Test Success
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Content-Length: 0
+    ]]>
+  </send>
+
+  <!-- Wait for ACK -->
+  <recv request="ACK"
+        optional="false"
+        rtd="true"
+        crlf="true">
+  </recv>
+
+  <!-- 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>
+
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uas-invite.xml
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uas-invite.xml	(revision 4176)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uas-invite.xml	(revision 4177)
@@ -47,5 +47,5 @@
       [last_Call-ID:]
       [last_CSeq:]
-      Contact: <sip:192.168.0.15>
+      Contact: <sip:sipp@[local_ip]:[local_port]>
       Content-Type: application/sdp
 
@@ -67,8 +67,4 @@
   </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)   -->
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uas-mwi-0.py
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uas-mwi-0.py	(revision 4177)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uas-mwi-0.py	(revision 4177)
@@ -0,0 +1,7 @@
+# $Id$
+#
+import inc_const as const
+
+PJSUA = ["--null-audio --max-calls=1 --id sip:pjsua@localhost:6000 --mwi"]
+
+PJSUA_EXPECTS = []
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uas-mwi-0.xml
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uas-mwi-0.xml	(revision 4176)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uas-mwi-0.xml	(revision 4177)
@@ -16,11 +16,4 @@
 <!-- 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                         -->
 <!--                                                                    -->
 
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uas-mwi.py
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uas-mwi.py	(revision 4177)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uas-mwi.py	(revision 4177)
@@ -0,0 +1,7 @@
+# $Id$
+#
+import inc_const as const
+
+PJSUA = ["--null-audio --max-calls=1 --id sip:pjsua@localhost:6000 --mwi"]
+
+PJSUA_EXPECTS = []
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uas-mwi.xml
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uas-mwi.xml	(revision 4176)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uas-mwi.xml	(revision 4177)
@@ -16,11 +16,4 @@
 <!-- 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                         -->
 <!--                                                                    -->
 
@@ -75,5 +68,5 @@
    </recv>
 
-  <pause milliseconds="10000"/> 
+  <pause milliseconds="2000"/> 
 
 
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uas-prack_fork.xml
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uas-prack_fork.xml	(revision 4177)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uas-prack_fork.xml	(revision 4177)
@@ -0,0 +1,129 @@
+<?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="Forked INVITE, one of them require PRACK">
+  <recv request="INVITE" crlf="true">
+   <action>
+    <ereg regexp="branch=([0-9a-zA-Z]*)"
+          search_in="msg"
+          assign_to="3"/>
+    <ereg regexp="CSeq: ([0-9a-zA-Z ]*)"
+          search_in="msg"
+          assign_to="4"/>
+   </action>
+  </recv>
+
+  <send>
+    <![CDATA[
+      SIP/2.0 100 Trying
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+    ]]>
+  </send>
+
+  <!-- Call leg 1: 180/Ringing -->
+  <send>
+    <![CDATA[
+      SIP/2.0 180 Ringing
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=1
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:WRONG_UA@192.168.0.1>
+    ]]>
+  </send>
+
+  <!-- Call leg 2: 180/Ringing with 100rel -->
+  <send retrans="1000">
+    <![CDATA[
+      SIP/2.0 180 Ringing
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=2
+      [last_Call-ID:]
+      [last_CSeq:]
+      Require: 100rel
+      RSeq: 1
+      Contact: <sip:RIGHT_UA@[local_ip]:[local_port]>
+    ]]>
+  </send>
+
+  <!-- Expect PRACK -->
+  <recv request="PRACK"
+        optional="false"
+        rtd="true"
+        crlf="true">
+  </recv>
+
+  <!-- Send 200/OK to PRACK -->
+  <send>
+    <![CDATA[
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:]
+      [last_Call-ID:]
+      [last_CSeq:]
+    ]]>
+  </send>
+
+  <!-- Send 200/OK to INVITE -->
+  <send retrans="500">
+    <![CDATA[
+      SIP/2.0 200 OK
+      Via: SIP/2.0/UDP 127.0.0.1:5080;received=127.0.0.1;rport=5080;[$3]
+      [last_From:]
+      [last_To:];tag=2
+      [last_Call-ID:]
+      [$4]
+      Contact: <sip:RIGHT_UA@[local_ip]:[local_port]>
+      Content-Type: application/sdp
+
+      v=0
+      o=- 3442013205 3442013205 IN IP4 192.168.0.13
+      s=pjsip
+      c=IN IP4 192.168.0.13
+      t=0 0
+      m=audio 4002 RTP/AVP 0
+      a=rtpmap:0 PCMU/8000
+    ]]>
+  </send>
+
+  <!-- Receive ACK -->
+  <recv request="ACK"
+        optional="false"
+        rtd="true"
+        crlf="true">
+  </recv>
+
+
+  <!-- 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>
+
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uas-reinv-glare.py
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uas-reinv-glare.py	(revision 4177)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uas-reinv-glare.py	(revision 4177)
@@ -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"]]
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-late-notify.py
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-late-notify.py	(revision 4177)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-late-notify.py	(revision 4177)
@@ -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", ""]
+		 ]
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-late-notify.xml
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-late-notify.xml	(revision 4176)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-late-notify.xml	(revision 4177)
@@ -75,5 +75,5 @@
       Max-Forwards: 70
       Event: presence
-      Subscription-State: active;expires=50
+      Subscription-State: active;expires=10
       Content-Type: application/pidf+xml
 
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-multipart-notify.py
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-multipart-notify.py	(revision 4177)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-multipart-notify.py	(revision 4177)
@@ -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", ""]
+		 ]
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-multipart-notify.xml
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-multipart-notify.xml	(revision 4176)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-multipart-notify.xml	(revision 4177)
@@ -56,5 +56,5 @@
       Max-Forwards: 70
       Event: presence
-      Subscription-State: active;expires=50
+      Subscription-State: active;expires=10
       Content-Type: multipart/mixed;boundary=abcd
 
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-notify-terminate.py
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-notify-terminate.py	(revision 4177)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-notify-terminate.py	(revision 4177)
@@ -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", ""]
+		 ]
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-refresh-481.py
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-refresh-481.py	(revision 4177)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-refresh-481.py	(revision 4177)
@@ -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", ""]
+		 ]
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-refresh-481.xml
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-refresh-481.xml	(revision 4176)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-refresh-481.xml	(revision 4177)
@@ -16,11 +16,4 @@
 <!-- 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                         -->
 <!--                                                                    -->
 
@@ -61,5 +54,5 @@
       Max-Forwards: 70
       Event: presence
-      Subscription-State: active;expires=50
+      Subscription-State: active;expires=10
       Content-Type: application/pidf+xml
 
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-terminated-retry.py
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-terminated-retry.py	(revision 4177)
+++ pjproject/trunk/tests/pjsua/scripts-sipp/uas-subscribe-terminated-retry.py	(revision 4177)
@@ -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", ""]
+		 ]
Index: pjproject/trunk/tests/pjsua/scripts-sipp/uas.xml
===================================================================
--- pjproject/trunk/tests/pjsua/scripts-sipp/uas.xml	(revision 4176)
+++ 	(revision )
@@ -1,67 +1,0 @@
-<?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>
-
