Index: pjproject/trunk/pjsip-apps/src/test-pjsua/run.py
===================================================================
--- pjproject/trunk/pjsip-apps/src/test-pjsua/run.py	(revision 2027)
+++ pjproject/trunk/pjsip-apps/src/test-pjsua/run.py	(revision 2028)
@@ -1,13 +1,45 @@
-# $Id:$
+# $Id$
 import sys
 import imp
 import re
+import os
 import subprocess
+import random
 import time
 
 import inc_const as const
 
-# Defaults
-G_EXE="..\\..\\bin\\pjsua_vc6d.exe"
+# Get the pjsua executable name
+if sys.platform.find("win32")!=-1:
+    e = "../../bin/pjsua_vc6d.exe"
+    st1 = os.stat(e)
+    if st1 != None:
+	G_EXE = e
+    e = "../../bin/pjsua_vc6d.exe"
+    st2 = os.stat(e)
+    if st2 != None and st2.st_mtime > st1.st_mtime:
+	G_EXE = e
+	st1 = st2
+    if G_EXE=="":
+	print "Unable to find valid pjsua. Please build pjsip first"
+	sys.exit(1)
+    G_INUNIX = False
+else:
+    f = open("../../../build.mak", "r")
+    while True:
+	line = f.readline()
+	if not line:
+	    break
+	if line.find("TARGET_NAME")!=-1:
+	    print line
+	    G_EXE="../../bin/pjsua-" + line.split(":= ")[1]
+	    break
+    if G_EXE=="":
+	print "Unable to find ../../../build.mak. Please build pjsip first"
+	sys.exit(1)
+    G_INUNIX = True
+
+
+G_EXE = G_EXE.rstrip("\n\r \t")
 
 ###################################
@@ -36,5 +68,5 @@
 		fullcmd = G_EXE + " " + inst_param.arg + " --stdout-refresh=5 --stdout-refresh-text=" + const.STDOUT_REFRESH
 		self.trace("Popen " + fullcmd)
-		self.proc = subprocess.Popen(fullcmd, bufsize=0, stdin=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=True)
+		self.proc = subprocess.Popen(fullcmd, shell=G_INUNIX, bufsize=0, stdin=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=True)
 	def send(self, cmd):
 		self.trace("send " + cmd)
@@ -109,4 +141,7 @@
 script = imp.load_source("script", sys.argv[1])  
 
+# Init random seed
+random.seed()
+
 # Validate
 if script.test == None:
@@ -120,4 +155,6 @@
 # Instantiate pjsuas
 print "====== Running " + script.test.title + " ======"
+print "Using " + G_EXE + " as pjsua executable"
+
 for inst_param in script.test.inst_params:
 	try:
Index: pjproject/trunk/pjsip-apps/src/test-pjsua/runall.py
===================================================================
--- pjproject/trunk/pjsip-apps/src/test-pjsua/runall.py	(revision 2027)
+++ pjproject/trunk/pjsip-apps/src/test-pjsua/runall.py	(revision 2028)
@@ -2,4 +2,8 @@
 import os
 import sys
+
+# Usage:
+#  runall.py [test-to-resume]
+
 
 # Initialize test list
@@ -29,6 +33,23 @@
     tests = [t for t in tests if t.find(pat)==-1]
 
+# Resume test?
+resume_script=""
+if len(sys.argv) > 1:
+    if sys.argv[1][0]=='-' or sys.argv[1][0]=='/':
+        print "Usage:"
+	print "  runall.py [RESUME]"
+	print "where"
+	print "  RESUME is string/substring to specify where to resume tests."
+	print "  If this argument is omited, tests will start from the beginning."
+	sys.exit(0)
+    resume_script=sys.argv[1]
+
+
 # Now run the tests
 for t in tests:
+	if resume_script!="" and t.find(resume_script)==-1:
+	    print "Skipping " + t +".."
+	    continue
+	resume_script=""
 	cmdline = "python run.py " + t
 	print "Running " + cmdline
Index: pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-call/200_tcp.py
===================================================================
--- pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-call/200_tcp.py	(revision 2027)
+++ pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-call/200_tcp.py	(revision 2028)
@@ -7,5 +7,5 @@
 		"TCP transport",
 		[
-			InstanceParam("callee", "--null-audio --no-udp", uri_param=";transport=tcp --max-calls=1"),
+			InstanceParam("callee", "--null-audio --no-udp --max-calls=1", uri_param=";transport=tcp"),
 			InstanceParam("caller", "--null-audio --no-udp --max-calls=1")
 		]
Index: pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-pres/200_publish.py
===================================================================
--- pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-pres/200_publish.py	(revision 2027)
+++ pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-pres/200_publish.py	(revision 2028)
@@ -1,3 +1,3 @@
-# $Id:$
+# $Id$
 #
 from inc_cfg import *
@@ -9,10 +9,10 @@
 			InstanceParam(	"ua1", 
 					"--null-audio"+
-						" --id=<sip:test1@pjsip.org>"+
+						" --id=\"<sip:test1@pjsip.org>\""+
 						" --registrar=sip:sip.pjsip.org" +
 						" --username=test1" +
 						" --password=test1" +
 						" --realm=*" +
-						" --proxy=sip:sip.pjsip.org;lr" +
+						" --proxy=\"sip:sip.pjsip.org;lr\"" +
 						" --publish",
 					uri="<sip:test1@pjsip.org>",
@@ -21,10 +21,10 @@
 			InstanceParam(	"ua2", 
 					"--null-audio"+
-						" --id=<sip:test2@pjsip.org>"+
+						" --id=\"<sip:test2@pjsip.org>\""+
 						" --registrar=sip:sip.pjsip.org" +
 						" --username=test2" +
 						" --password=test2" +
 						" --realm=*" +
-						" --proxy=sip:sip.pjsip.org;lr" +
+						" --proxy=\"sip:sip.pjsip.org;lr\"" +
 						" --publish",
 					uri="<sip:test2@pjsip.org>",
Index: pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-run/100_simple.py
===================================================================
--- pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-run/100_simple.py	(revision 2027)
+++ pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-run/100_simple.py	(revision 2028)
@@ -1,3 +1,3 @@
-# $Id:$
+# $Id$
 #
 # Just about the simple pjsua command line parameter, which should
@@ -8,5 +8,5 @@
 		"Basic run", 
 		[
-			InstanceParam("pjsua", "--null-audio --local-port 0 --rtp-port 0")
+			InstanceParam("pjsua", "--null-audio --rtp-port 0")
 		]
 		)
Index: pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-run/200_register.py
===================================================================
--- pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-run/200_register.py	(revision 2027)
+++ pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-run/200_register.py	(revision 2028)
@@ -1,3 +1,3 @@
-# $Id:$
+# $Id$
 #
 from inc_cfg import *
@@ -9,5 +9,5 @@
 			InstanceParam(	"client", 
 					"--null-audio"+
-						" --id=<sip:test1@pjsip.org>"+
+						" --id=\"<sip:test1@pjsip.org>\""+
 						" --registrar=sip:sip.pjsip.org" +
 						" --username=test1" +
