Index: pjproject/trunk/pjsip-apps/src/test-pjsua/inc_cfg.py
===================================================================
--- pjproject/trunk/pjsip-apps/src/test-pjsua/inc_cfg.py	(revision 2065)
+++ pjproject/trunk/pjsip-apps/src/test-pjsua/inc_cfg.py	(revision 2066)
@@ -80,6 +80,6 @@
 			title, 		# Test title
 			inst_params, 	# InstanceParam's as list
+			func=None,
 			skip=False,
-			func=None,
 			post_func=None,
 			user_data=None):
Index: pjproject/trunk/pjsip-apps/src/test-pjsua/inc_sip.py
===================================================================
--- pjproject/trunk/pjsip-apps/src/test-pjsua/inc_sip.py	(revision 2065)
+++ pjproject/trunk/pjsip-apps/src/test-pjsua/inc_sip.py	(revision 2066)
@@ -1,3 +1,3 @@
-# $Id:$
+# $Id$
 #
 from socket import *
@@ -208,4 +208,6 @@
 	# Initial SDP
 	sdp = ""
+	# Extra headers to add to request
+	extra_headers = ""
 	# Expected code
 	resp_code = 0
@@ -217,5 +219,7 @@
 	resp_exclude = []
 	# Constructor
-	def __init__(self, name, pjsua_args, sdp, resp_code, resp_inc=[], resp_exc=[], use_tcp=False):
+	def __init__(self, name, pjsua_args, sdp, resp_code, 
+		     resp_inc=[], resp_exc=[], use_tcp=False,
+		     extra_headers=""):
 		self.sdp = sdp
 		self.resp_code = resp_code
@@ -223,4 +227,5 @@
 		self.resp_exclude = resp_exc
 		self.use_tcp = use_tcp
+		self.extra_headers = extra_headers
 		self.inst_param = cfg.InstanceParam("pjsua", pjsua_args)
 
Index: pjproject/trunk/pjsip-apps/src/test-pjsua/mod_sendto.py
===================================================================
--- pjproject/trunk/pjsip-apps/src/test-pjsua/mod_sendto.py	(revision 2065)
+++ pjproject/trunk/pjsip-apps/src/test-pjsua/mod_sendto.py	(revision 2066)
@@ -1,3 +1,3 @@
-# $Id:$
+# $Id$
 import imp
 import sys
@@ -19,5 +19,5 @@
 	cfg = cfg_file.sendto_cfg
 	
-	req = dlg.create_invite(cfg.sdp)
+	req = dlg.create_invite(cfg.sdp, cfg.extra_headers)
 	resp = dlg.send_request_wait(req, 10)
 	if resp=="":
Index: pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/150_err_extension.py
===================================================================
--- pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/150_err_extension.py	(revision 2066)
+++ pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/150_err_extension.py	(revision 2066)
@@ -0,0 +1,27 @@
+# $Id$
+import inc_sip as sip
+import inc_sdp as sdp
+
+sdp = \
+"""
+v=0
+o=- 0 0 IN IP4 127.0.0.1
+s=pjmedia
+c=IN IP4 127.0.0.1
+t=0 0
+m=audio 4000 RTP/AVP 0 101
+a=rtpmap:0 PCMU/8000
+a=sendrecv
+a=rtpmap:101 telephone-event/8000
+a=fmtp:101 0-15
+"""
+
+pjsua_args = "--null-audio --auto-answer 200"
+extra_headers = "Require: xxx-my-extension\n"
+include = ["Unsupported: xxx-my-extension"]
+exclude = []
+sendto_cfg = sip.SendtoCfg("Bad extension", pjsua_args, sdp, 420, 
+			   extra_headers=extra_headers,
+			   resp_inc=include, resp_exc=exclude) 
+			   
+
Index: pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/151_err_sdp_video.py
===================================================================
--- pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/151_err_sdp_video.py	(revision 2066)
+++ pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/151_err_sdp_video.py	(revision 2066)
@@ -0,0 +1,24 @@
+# $Id$
+import inc_sip as sip
+import inc_sdp as sdp
+
+sdp = \
+"""
+v=0
+o=- 0 0 IN IP4 127.0.0.1
+s=pjmedia
+c=IN IP4 127.0.0.1
+t=0 0
+m=video 4000 RTP/AVP 0
+"""
+
+pjsua_args = "--null-audio --auto-answer 200"
+extra_headers = ""
+include = ["Content-Type: application/sdp",	# response must include SDP
+	   "m=audio"]
+exclude = []
+
+sendto_cfg = sip.SendtoCfg("Video not acceptable", pjsua_args, sdp, 488,
+			   extra_headers=extra_headers,
+			   resp_inc=include, resp_exc=exclude) 
+
Index: pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/152_err_sdp_no_media.py
===================================================================
--- pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/152_err_sdp_no_media.py	(revision 2066)
+++ pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/152_err_sdp_no_media.py	(revision 2066)
@@ -0,0 +1,22 @@
+# $Id$
+import inc_sip as sip
+import inc_sdp as sdp
+
+sdp = \
+"""
+v=0
+o=- 0 0 IN IP4 127.0.0.1
+s=pjmedia
+c=IN IP4 127.0.0.1
+t=0 0
+"""
+
+pjsua_args = "--null-audio --auto-answer 200"
+extra_headers = ""
+include = []
+exclude = []
+
+sendto_cfg = sip.SendtoCfg("No media in SDP", pjsua_args, sdp, 400,
+			   extra_headers=extra_headers,
+			   resp_inc=include, resp_exc=exclude) 
+
Index: pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/153_err_sdp_unsupported_codec.py
===================================================================
--- pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/153_err_sdp_unsupported_codec.py	(revision 2066)
+++ pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/153_err_sdp_unsupported_codec.py	(revision 2066)
@@ -0,0 +1,25 @@
+# $Id$
+import inc_sip as sip
+import inc_sdp as sdp
+
+sdp = \
+"""
+v=0
+o=- 0 0 IN IP4 127.0.0.1
+s=pjmedia
+c=IN IP4 127.0.0.1
+t=0 0
+m=video 4000 RTP/AVP 101
+a=rtpmap:101 my-proprietary-codec
+"""
+
+pjsua_args = "--null-audio --auto-answer 200"
+extra_headers = ""
+include = ["Content-Type: application/sdp",	# response must include SDP
+	   "m=audio"]
+exclude = []
+
+sendto_cfg = sip.SendtoCfg("Unsupported codec", pjsua_args, sdp, 488,
+			   extra_headers=extra_headers,
+			   resp_inc=include, resp_exc=exclude) 
+
Index: pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/155_err_sdp_bad_syntax.py
===================================================================
--- pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/155_err_sdp_bad_syntax.py	(revision 2066)
+++ pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/155_err_sdp_bad_syntax.py	(revision 2066)
@@ -0,0 +1,23 @@
+# $Id$
+import inc_sip as sip
+import inc_sdp as sdp
+
+sdp = \
+"""
+v=
+o=
+s=
+c=
+t=
+a=
+"""
+
+pjsua_args = "--null-audio --auto-answer 200"
+extra_headers = ""
+include = [ "Warning: " ]	# better have Warning header
+exclude = []
+
+sendto_cfg = sip.SendtoCfg("Bad SDP syntax", pjsua_args, sdp, 400,
+			   extra_headers=extra_headers,
+			   resp_inc=include, resp_exc=exclude) 
+
Index: pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/156_err_sdp_bad_net_type.py
===================================================================
--- pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/156_err_sdp_bad_net_type.py	(revision 2066)
+++ pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/156_err_sdp_bad_net_type.py	(revision 2066)
@@ -0,0 +1,27 @@
+# $Id$
+import inc_sip as sip
+import inc_sdp as sdp
+
+sdp = \
+"""
+v=0
+o=- 0 0 IN IP4 127.0.0.1
+s=pjmedia
+c=AF IP4 127.0.0.1
+t=0 0
+m=audio 4000 RTP/AVP 0 101
+a=rtpmap:0 PCMU/8000
+a=sendrecv
+a=rtpmap:101 telephone-event/8000
+a=fmtp:101 0-15
+"""
+
+pjsua_args = "--null-audio --auto-answer 200"
+extra_headers = ""
+include = [ "Warning: " ]	# better have Warning header
+exclude = []
+sendto_cfg = sip.SendtoCfg("Bad SDP network type", pjsua_args, sdp, 400, 
+			   extra_headers=extra_headers,
+			   resp_inc=include, resp_exc=exclude) 
+			   
+
Index: pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/157_err_sdp_bad_addr_type.py
===================================================================
--- pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/157_err_sdp_bad_addr_type.py	(revision 2066)
+++ pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/157_err_sdp_bad_addr_type.py	(revision 2066)
@@ -0,0 +1,27 @@
+# $Id$
+import inc_sip as sip
+import inc_sdp as sdp
+
+sdp = \
+"""
+v=0
+o=- 0 0 IN IP4 127.0.0.1
+s=pjmedia
+c=IN IP7 127.0.0.1
+t=0 0
+m=audio 4000 RTP/AVP 0 101
+a=rtpmap:0 PCMU/8000
+a=sendrecv
+a=rtpmap:101 telephone-event/8000
+a=fmtp:101 0-15
+"""
+
+pjsua_args = "--null-audio --auto-answer 200"
+extra_headers = ""
+include = [ "Warning: " ]	# better have Warning header
+exclude = []
+sendto_cfg = sip.SendtoCfg("Bad SDP address type", pjsua_args, sdp, 400, 
+			   extra_headers=extra_headers,
+			   resp_inc=include, resp_exc=exclude) 
+			   
+
Index: pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/158_err_sdp_bad_transport_type.py
===================================================================
--- pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/158_err_sdp_bad_transport_type.py	(revision 2066)
+++ pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/158_err_sdp_bad_transport_type.py	(revision 2066)
@@ -0,0 +1,27 @@
+# $Id$
+import inc_sip as sip
+import inc_sdp as sdp
+
+sdp = \
+"""
+v=0
+o=- 0 0 IN IP4 127.0.0.1
+s=pjmedia
+c=IN IP4 127.0.0.1
+t=0 0
+m=audio 4000 RTP/XAVP 0 101
+a=rtpmap:0 PCMU/8000
+a=sendrecv
+a=rtpmap:101 telephone-event/8000
+a=fmtp:101 0-15
+"""
+
+pjsua_args = "--null-audio --auto-answer 200"
+extra_headers = ""
+include = []
+exclude = []
+sendto_cfg = sip.SendtoCfg("Unsupported transport type", pjsua_args, sdp, 406, 
+			   extra_headers=extra_headers,
+			   resp_inc=include, resp_exc=exclude) 
+			   
+
Index: pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/160_err_duplicate_replaces.py
===================================================================
--- pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/160_err_duplicate_replaces.py	(revision 2066)
+++ pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/160_err_duplicate_replaces.py	(revision 2066)
@@ -0,0 +1,23 @@
+# $Id$
+import inc_sip as sip
+import inc_sdp as sdp
+
+sdp = \
+"""
+v=0
+o=- 0 0 IN IP4 127.0.0.1
+s=pjmedia
+c=IN IP4 127.0.0.1
+t=0 0
+m=audio 4000 RTP/AVP 0
+"""
+
+pjsua_args = "--null-audio --auto-answer 200"
+extra_headers = "Replaces: abcd;from_tag=1\r\nReplaces: efgh;from_tag=2\r\n"
+include = []
+exclude = []
+
+sendto_cfg = sip.SendtoCfg("Duplicate replaces header", pjsua_args, sdp, 400,
+			   extra_headers=extra_headers,
+			   resp_inc=include, resp_exc=exclude) 
+
Index: pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/161_err_replaces_dlg_not_found.py
===================================================================
--- pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/161_err_replaces_dlg_not_found.py	(revision 2066)
+++ pjproject/trunk/pjsip-apps/src/test-pjsua/scripts-sendto/161_err_replaces_dlg_not_found.py	(revision 2066)
@@ -0,0 +1,23 @@
+# $Id$
+import inc_sip as sip
+import inc_sdp as sdp
+
+sdp = \
+"""
+v=0
+o=- 0 0 IN IP4 127.0.0.1
+s=pjmedia
+c=IN IP4 127.0.0.1
+t=0 0
+m=audio 4000 RTP/AVP 0
+"""
+
+pjsua_args = "--null-audio --auto-answer 200"
+extra_headers = "Replaces: abcd;from_tag=1\r\n"
+include = []
+exclude = []
+
+sendto_cfg = sip.SendtoCfg("Replaced dialog not found", pjsua_args, sdp, 481,
+			   extra_headers=extra_headers,
+			   resp_inc=include, resp_exc=exclude) 
+
