Index: pjproject/trunk/pjmedia/src/pjmedia/conf_switch.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/conf_switch.c	(revision 4121)
+++ pjproject/trunk/pjmedia/src/pjmedia/conf_switch.c	(revision 4122)
@@ -547,5 +547,5 @@
     if (src_afd->channel_count != dst_afd->channel_count) {
 	pj_mutex_unlock(conf->mutex);
-	return PJMEDIA_ENCCLOCKRATE;
+	return PJMEDIA_ENCCHANNEL;
     }
 
Index: pjproject/trunk/pjmedia/src/pjmedia/wav_player.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/wav_player.c	(revision 4121)
+++ pjproject/trunk/pjmedia/src/pjmedia/wav_player.c	(revision 4122)
@@ -158,4 +158,5 @@
                     pj_memset(fport->eofpos, val, size_left);
                 }
+		size_left = 0;
             }
 
Index: pjproject/trunk/pjsip-apps/src/python/setup-vc.py
===================================================================
--- pjproject/trunk/pjsip-apps/src/python/setup-vc.py	(revision 4121)
+++ pjproject/trunk/pjsip-apps/src/python/setup-vc.py	(revision 4122)
@@ -25,14 +25,40 @@
 # Find version
 pj_version=""
-f = open('../../../pjlib/src/pj/config.c', 'r')
+pj_version_major=""
+pj_version_minor=""
+pj_version_rev=""
+pj_version_suffix=""
+f = open('../../../version.mak', 'r')
 for line in f:
-    if line.find("PJ_VERSION") != -1:
-        pj_version = line.split("=")[1].strip('";\r\n ')
-        break
+    if line.find("export PJ_VERSION_MAJOR") != -1:
+    	tokens=line.split("=")
+	if len(tokens)>1:
+		pj_version_major= tokens[1].strip()
+    elif line.find("export PJ_VERSION_MINOR") != -1:
+    	tokens=line.split("=")
+	if len(tokens)>1:
+		pj_version_minor= line.split("=")[1].strip()
+    elif line.find("export PJ_VERSION_REV") != -1:
+    	tokens=line.split("=")
+	if len(tokens)>1:
+		pj_version_rev= line.split("=")[1].strip()
+    elif line.find("export PJ_VERSION_SUFFIX") != -1:
+    	tokens=line.split("=")
+	if len(tokens)>1:
+		pj_version_suffix= line.split("=")[1].strip()
+
 f.close()
-if pj_version=="":
-    print 'Unable to get PJ_pj_version'
+if not pj_version_major:
+    print 'Unable to get PJ_VERSION_MAJOR'
     sys.exit(1)
+
+pj_version = pj_version_major + "." + pj_version_minor
+if pj_version_rev:
+	pj_version += "." + pj_version_rev
+if pj_version_suffix:
+	pj_version += "-" + pj_version_suffix
+
 #print 'PJ_VERSION = "'+ pj_version + '"'
+
 
 # Check that extension has been built
Index: pjproject/trunk/pjsip-apps/src/python/setup.py
===================================================================
--- pjproject/trunk/pjsip-apps/src/python/setup.py	(revision 4121)
+++ pjproject/trunk/pjsip-apps/src/python/setup.py	(revision 4122)
@@ -26,13 +26,38 @@
 # find pjsip version
 pj_version=""
-f = open('../../../pjlib/src/pj/config.c', 'r')
+pj_version_major=""
+pj_version_minor=""
+pj_version_rev=""
+pj_version_suffix=""
+f = open('../../../version.mak', 'r')
 for line in f:
-    if line.find("PJ_VERSION") != -1:
-	pj_version= line.split(" = ")[1].strip('";\r\n')
-	break
+    if line.find("export PJ_VERSION_MAJOR") != -1:
+    	tokens=line.split("=")
+	if len(tokens)>1:
+		pj_version_major= tokens[1].strip()
+    elif line.find("export PJ_VERSION_MINOR") != -1:
+    	tokens=line.split("=")
+	if len(tokens)>1:
+		pj_version_minor= line.split("=")[1].strip()
+    elif line.find("export PJ_VERSION_REV") != -1:
+    	tokens=line.split("=")
+	if len(tokens)>1:
+		pj_version_rev= line.split("=")[1].strip()
+    elif line.find("export PJ_VERSION_SUFFIX") != -1:
+    	tokens=line.split("=")
+	if len(tokens)>1:
+		pj_version_suffix= line.split("=")[1].strip()
+
 f.close()
-if pj_version=="":
-    print 'Unable to get PJ_VERSION'
+if not pj_version_major:
+    print 'Unable to get PJ_VERSION_MAJOR'
     sys.exit(1)
+
+pj_version = pj_version_major + "." + pj_version_minor
+if pj_version_rev:
+	pj_version += "." + pj_version_rev
+if pj_version_suffix:
+	pj_version += "-" + pj_version_suffix
+
 #print 'PJ_VERSION = "'+ pj_version + '"'
 
Index: pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c	(revision 4121)
+++ pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c	(revision 4122)
@@ -2195,5 +2195,5 @@
     PJSUA_LOCK();
 
-    if (pjsua_var.tpdata[id].type == PJSIP_TRANSPORT_UDP) {
+    if (t->type == PJSIP_TRANSPORT_UDP) {
 
 	pjsip_transport *tp = t->data.tp;
@@ -2216,5 +2216,7 @@
 	status = PJ_SUCCESS;
 
-    } else if (pjsua_var.tpdata[id].type == PJSIP_TRANSPORT_TCP) {
+    } else if (t->type == PJSIP_TRANSPORT_TCP ||
+	       t->type == PJSIP_TRANSPORT_TLS)
+    {
 
 	pjsip_tpfactory *factory = t->data.factory;
@@ -2227,6 +2229,8 @@
 	info->id = id;
 	info->type = t->type;
-	info->type_name = pj_str("TCP");
-	info->info = pj_str("TCP transport");
+	info->type_name = (t->type==PJSIP_TRANSPORT_TCP)? pj_str("TCP"):
+							  pj_str("TLS");
+	info->info = (t->type==PJSIP_TRANSPORT_TCP)? pj_str("TCP transport"):
+						     pj_str("TLS transport");
 	info->flag = factory->flag;
 	info->addr_len = sizeof(factory->local_addr);
Index: pjproject/trunk/version.mak
===================================================================
--- pjproject/trunk/version.mak	(revision 4121)
+++ pjproject/trunk/version.mak	(revision 4122)
@@ -1,2 +1,3 @@
+# Don't change the "export PJ_VERSION_xxx" style, they are parsed by setup.py
 export PJ_VERSION_MAJOR  := 2
 export PJ_VERSION_MINOR  := 0
