Index: pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
===================================================================
--- pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c	(revision 5307)
+++ pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c	(revision 5308)
@@ -1665,10 +1665,7 @@
 	if (app_config.udp_cfg.port == 0) {
 	    pjsua_transport_info ti;
-	    pj_sockaddr_in *a;
 
 	    pjsua_transport_get_info(transport_id, &ti);
-	    a = (pj_sockaddr_in*)&ti.local_addr;
-
-	    tcp_cfg.port = pj_ntohs(a->sin_port);
+	    tcp_cfg.port = pj_sockaddr_get_port(&ti.local_addr);
 	}
     }
Index: pjproject/trunk/pjsip/include/pjsip/sip_transport.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip/sip_transport.h	(revision 5307)
+++ pjproject/trunk/pjsip/include/pjsip/sip_transport.h	(revision 5308)
@@ -995,4 +995,5 @@
     char		   *type_name;      /**< Type string name.	*/
     unsigned		    flag;	    /**< Transport flag.	*/
+    char		   *info;	    /**< Transport info/description.*/
 
     pj_sockaddr		    local_addr;	    /**< Bound address.		*/
Index: pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c	(revision 5307)
+++ pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c	(revision 5308)
@@ -252,4 +252,6 @@
 					)
 {
+    enum { INFO_LEN = 100 };
+    char local_addr[PJ_INET6_ADDRSTRLEN+10];
     pj_pool_t *pool;
     pj_sock_t sock = PJ_INVALID_SOCKET;
@@ -474,4 +476,17 @@
 
 #endif
+
+    /* Set transport info. */
+    if (listener->factory.info == NULL) {
+	listener->factory.info = (char*) pj_pool_alloc(listener->factory.pool,
+						       INFO_LEN);
+    }
+    pj_sockaddr_print(listener_addr, local_addr, sizeof(local_addr), 3);
+    pj_ansi_snprintf( 
+	listener->factory.info, INFO_LEN, "tcp %s [published as %.*s:%d]",
+	local_addr,
+	(int)listener->factory.addr_name.host.slen,
+	listener->factory.addr_name.host.ptr,
+	listener->factory.addr_name.port);
 
     if (has_listener) {
Index: pjproject/trunk/pjsip/src/pjsip/sip_transport_tls.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_transport_tls.c	(revision 5307)
+++ pjproject/trunk/pjsip/src/pjsip/sip_transport_tls.c	(revision 5308)
@@ -310,4 +310,6 @@
 					        pjsip_tpfactory **p_factory)
 {
+    enum { INFO_LEN = 100 };
+    char local_addr[PJ_INET6_ADDRSTRLEN+10];
     pj_pool_t *pool;
     pj_bool_t is_ipv6;
@@ -546,4 +548,17 @@
 	goto on_error;
     }
+
+    /* Set transport info. */
+    if (listener->factory.info == NULL) {
+	listener->factory.info = (char*) pj_pool_alloc(listener->factory.pool,
+						       INFO_LEN);
+    }
+    pj_sockaddr_print(listener_addr, local_addr, sizeof(local_addr), 3);
+    pj_ansi_snprintf( 
+	listener->factory.info, INFO_LEN, "tls %s [published as %.*s:%d]",
+	local_addr,
+	(int)listener->factory.addr_name.host.slen,
+	listener->factory.addr_name.host.ptr,
+	listener->factory.addr_name.port);
 
     if (has_listener) {
Index: pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c	(revision 5307)
+++ pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c	(revision 5308)
@@ -1945,5 +1945,5 @@
     /* Send raw packet */
     status = pjsip_tpmgr_send_raw(pjsip_endpt_get_tpmgr(pjsua_var.endpt),
-				  PJSIP_TRANSPORT_UDP, &tp_sel,
+				  acc->ka_transport->key.type, &tp_sel,
 				  NULL, acc->cfg.ka_data.ptr, 
 				  acc->cfg.ka_data.slen, 
@@ -2012,5 +2012,6 @@
 	if (/*pjsua_var.stun_srv.ipv4.sin_family == 0 ||*/
 	    acc->cfg.ka_interval == 0 ||
-	    param->rdata->tp_info.transport->key.type != PJSIP_TRANSPORT_UDP)
+	    (param->rdata->tp_info.transport->key.type & PJSIP_TRANSPORT_UDP)!=
+	     PJSIP_TRANSPORT_UDP)
 	{
 	    /* Keep alive is not necessary */
Index: pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c	(revision 5307)
+++ pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c	(revision 5308)
@@ -2448,5 +2448,5 @@
     PJSUA_LOCK();
 
-    if (t->type == PJSIP_TRANSPORT_UDP) {
+    if ((t->type & PJSIP_TRANSPORT_UDP) == PJSIP_TRANSPORT_UDP) {
 
 	pjsip_transport *tp = t->data.tp;
@@ -2469,6 +2469,6 @@
 	status = PJ_SUCCESS;
 
-    } else if (t->type == PJSIP_TRANSPORT_TCP ||
-	       t->type == PJSIP_TRANSPORT_TLS)
+    } else if ((t->type & PJSIP_TRANSPORT_TCP) == PJSIP_TRANSPORT_TCP ||
+	       (t->type & PJSIP_TRANSPORT_TLS) == PJSIP_TRANSPORT_TLS)
     {
 
@@ -2482,8 +2482,6 @@
 	info->id = id;
 	info->type = t->type;
-	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->type_name = pj_str(factory->type_name);
+	info->info = pj_str(factory->info);
 	info->flag = factory->flag;
 	info->addr_len = sizeof(factory->local_addr);
@@ -2535,4 +2533,5 @@
 {
     pj_status_t status;
+    pjsip_transport_type_e tp_type;
 
     /* Make sure id is in range. */
@@ -2542,4 +2541,6 @@
     /* Make sure that transport exists */
     PJ_ASSERT_RETURN(pjsua_var.tpdata[id].data.ptr != NULL, PJ_EINVAL);
+
+    tp_type = pjsua_var.tpdata[id].type & ~PJSIP_TRANSPORT_IPV6;
 
     /* Note: destroy() may not work if there are objects still referencing
@@ -2547,5 +2548,5 @@
      */
     if (force) {
-	switch (pjsua_var.tpdata[id].type) {
+	switch (tp_type) {
 	case PJSIP_TRANSPORT_UDP:
 	    status = pjsip_transport_shutdown(pjsua_var.tpdata[id].data.tp);
@@ -2580,5 +2581,5 @@
 	 * descriptor.
 	 */
-	switch (pjsua_var.tpdata[id].type) {
+	switch (tp_type) {
 	case PJSIP_TRANSPORT_UDP:
 	    return pjsip_transport_shutdown(pjsua_var.tpdata[id].data.tp);
