Index: /pjproject/trunk/pjsip/include/pjsip/sip_config.h
===================================================================
--- /pjproject/trunk/pjsip/include/pjsip/sip_config.h	(revision 5151)
+++ /pjproject/trunk/pjsip/include/pjsip/sip_config.h	(revision 5152)
@@ -671,4 +671,44 @@
 
 /**
+ * Specify whether TCP transport should skip creating the listener.
+ * Not having a listener means that application will not be able to
+ * function in server mode and accept incoming connections.
+ *
+ * When enabling this setting, if you use PJSUA, it is recommended to set 
+ * pjsua_acc_config.contact_use_src_port to PJ_TRUE.
+ * Warning: If contact_use_src_port is disabled or failed (because it's
+ * unsupported in some platforms or automatically turned off due to
+ * DNS server resolution), Contact header will be generated from
+ * pj_getipinterface()/pj_gethostip(), but the address will not be
+ * able to accept connections. 
+ *
+ * Default is FALSE (listener will be created).
+ */
+#ifndef PJSIP_TCP_TRANSPORT_DONT_CREATE_LISTENER
+#   define PJSIP_TCP_TRANSPORT_DONT_CREATE_LISTENER 0
+#endif
+
+
+/**
+ * Specify whether TLS transport should skip creating the listener.
+ * Not having a listener means that application will not be able to
+ * function in server mode and accept incoming connections.
+ *
+ * When enabling this setting, if you use PJSUA, it is recommended to set 
+ * pjsua_acc_config.contact_use_src_port to PJ_TRUE.
+ * Warning: If contact_use_src_port is disabled or failed (because it's
+ * unsupported in some platforms or automatically turned off due to
+ * DNS server resolution), Contact header will be generated from
+ * pj_getipinterface()/pj_gethostip(), but the address will not be
+ * able to accept connections.
+ *
+ * Default is FALSE (listener will be created).
+ */
+#ifndef PJSIP_TLS_TRANSPORT_DONT_CREATE_LISTENER
+#   define PJSIP_TLS_TRANSPORT_DONT_CREATE_LISTENER 0
+#endif
+
+
+/**
  * Set the interval to send keep-alive packet for TCP transports.
  * If the value is zero, keep-alive will be disabled for TCP.
Index: /pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c	(revision 5151)
+++ /pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c	(revision 5152)
@@ -259,4 +259,5 @@
     pj_sockaddr *listener_addr;
     int addr_len;
+    pj_bool_t has_listener = PJ_FALSE;
     pj_status_t status;
 
@@ -279,5 +280,5 @@
     }
 
-    pool = pjsip_endpt_create_pool(endpt, "tcplis", POOL_LIS_INIT, 
+    pool = pjsip_endpt_create_pool(endpt, "tcptp", POOL_LIS_INIT, 
 				   POOL_LIS_INC);
     PJ_ASSERT_RETURN(pool, PJ_ENOMEM);
@@ -298,5 +299,5 @@
 	      sizeof(cfg->sockopt_params));
 
-    pj_ansi_strcpy(listener->factory.obj_name, "tcplis");
+    pj_ansi_strcpy(listener->factory.obj_name, "tcptp");
     if (listener->factory.type==PJSIP_TRANSPORT_TCP6)
 	pj_ansi_strcat(listener->factory.obj_name, "6");
@@ -307,4 +308,6 @@
 	goto on_error;
 
+#if !(defined(PJSIP_TCP_TRANSPORT_DONT_CREATE_LISTENER) && \
+      PJSIP_TCP_TRANSPORT_DONT_CREATE_LISTENER != 0)
 
     /* Create socket */
@@ -333,4 +336,8 @@
 	status = pj_sock_setsockopt_params(sock, &cfg->sockopt_params);
 
+#else
+    PJ_UNUSED_ARG(addr_len);
+#endif
+
     /* Bind address may be different than factory.local_addr because
      * factory.local_addr will be resolved below.
@@ -341,4 +348,7 @@
     listener_addr = &listener->factory.local_addr;
     pj_sockaddr_cp(listener_addr, &cfg->bind_addr);
+
+#if !(defined(PJSIP_TCP_TRANSPORT_DONT_CREATE_LISTENER) && \
+      PJSIP_TCP_TRANSPORT_DONT_CREATE_LISTENER != 0)
 
     status = pj_sock_bind(sock, listener_addr, 
@@ -352,4 +362,6 @@
     if (status != PJ_SUCCESS)
 	goto on_error;
+
+#endif
 
     /* If published host/IP is specified, then use that address as the
@@ -393,6 +405,9 @@
     pj_ansi_snprintf(listener->factory.obj_name, 
 		     sizeof(listener->factory.obj_name),
-		     "tcplis:%d",  listener->factory.addr_name.port);
-
+		     "tcptp:%d",  listener->factory.addr_name.port);
+
+
+#if !(defined(PJSIP_TCP_TRANSPORT_DONT_CREATE_LISTENER) && \
+      PJSIP_TCP_TRANSPORT_DONT_CREATE_LISTENER != 0)
 
     /* Start listening to the address */
@@ -409,4 +424,6 @@
 	asock_cfg.async_cnt = cfg->async_cnt;
 
+#endif
+
     /* Create group lock */
     status = pj_grp_lock_create(pool, NULL, &listener->grp_lock);
@@ -422,8 +439,14 @@
     pj_bzero(&listener_cb, sizeof(listener_cb));
     listener_cb.on_accept_complete = &on_accept_complete;
+
+#if !(defined(PJSIP_TCP_TRANSPORT_DONT_CREATE_LISTENER) && \
+      PJSIP_TCP_TRANSPORT_DONT_CREATE_LISTENER != 0)
+
     status = pj_activesock_create(pool, sock, pj_SOCK_STREAM(), &asock_cfg,
 				  pjsip_endpt_get_ioqueue(endpt), 
 				  &listener_cb, listener,
 				  &listener->asock);
+
+#endif
 
     /* Register to transport manager */
@@ -440,14 +463,26 @@
     }
 
+#if !(defined(PJSIP_TCP_TRANSPORT_DONT_CREATE_LISTENER) && \
+      PJSIP_TCP_TRANSPORT_DONT_CREATE_LISTENER != 0)
+
     /* Start pending accept() operations */
     status = pj_activesock_start_accept(listener->asock, pool);
     if (status != PJ_SUCCESS)
 	goto on_error;
-
-    PJ_LOG(4,(listener->factory.obj_name, 
-	     "SIP TCP listener ready for incoming connections at %.*s:%d",
-	     (int)listener->factory.addr_name.host.slen,
-	     listener->factory.addr_name.host.ptr,
-	     listener->factory.addr_name.port));
+	
+    has_listener = PJ_TRUE;
+
+#endif
+
+    if (has_listener) {
+        PJ_LOG(4,(listener->factory.obj_name, 
+	         "SIP TCP listener ready for incoming connections at %.*s:%d",
+	         (int)listener->factory.addr_name.host.slen,
+	         listener->factory.addr_name.host.ptr,
+	         listener->factory.addr_name.port));
+    } else {
+	PJ_LOG(4,(listener->factory.obj_name, "SIP TCP is ready "
+		  "(client only)"));    
+    }
 
     /* Return the pointer to user */
@@ -519,5 +554,5 @@
 	pj_pool_t *pool = listener->factory.pool;
 
-	PJ_LOG(4,(listener->factory.obj_name,  "SIP TCP listener destroyed"));
+	PJ_LOG(4,(listener->factory.obj_name,  "SIP TCP transport destroyed"));
 
 	listener->factory.pool = NULL;
Index: /pjproject/trunk/pjsip/src/pjsip/sip_transport_tls.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsip/sip_transport_tls.c	(revision 5151)
+++ /pjproject/trunk/pjsip/src/pjsip/sip_transport_tls.c	(revision 5152)
@@ -340,5 +340,5 @@
     }
 
-    pool = pjsip_endpt_create_pool(endpt, "tlslis", POOL_LIS_INIT, 
+    pool = pjsip_endpt_create_pool(endpt, "tlstp", POOL_LIS_INIT, 
 				   POOL_LIS_INC);
     PJ_ASSERT_RETURN(pool, PJ_ENOMEM);
@@ -355,5 +355,5 @@
 	pjsip_transport_get_flag_from_type(listener->factory.type);
 
-    pj_ansi_strcpy(listener->factory.obj_name, "tlslis");
+    pj_ansi_strcpy(listener->factory.obj_name, "tlstp");
     if (is_ipv6)
 	pj_ansi_strcat(listener->factory.obj_name, "6");
@@ -420,4 +420,7 @@
 			    &lis_on_destroy);
 
+#if !(defined(PJSIP_TLS_TRANSPORT_DONT_CREATE_LISTENER) && \
+      PJSIP_TLS_TRANSPORT_DONT_CREATE_LISTENER != 0)
+
     ssock_param.grp_lock = listener->grp_lock;
 
@@ -426,4 +429,6 @@
     if (status != PJ_SUCCESS)
 	goto on_error;
+
+#endif
 
     /* Bind address may be different than factory.local_addr because
@@ -439,4 +444,7 @@
 	pj_sockaddr_init(af, &listener->bound_addr, NULL, 0);
     }
+
+#if !(defined(PJSIP_TLS_TRANSPORT_DONT_CREATE_LISTENER) && \
+      PJSIP_TLS_TRANSPORT_DONT_CREATE_LISTENER != 0)
 
     /* Check if certificate/CA list for SSL socket is set */
@@ -481,4 +489,6 @@
     }
 
+#endif
+
     /* If published host/IP is specified, then use that address as the
      * listener advertised address.
@@ -519,5 +529,5 @@
     pj_ansi_snprintf(listener->factory.obj_name, 
 		     sizeof(listener->factory.obj_name),
-		     "tlslis:%d",  listener->factory.addr_name.port);
+		     "tlstp:%d",  listener->factory.addr_name.port);
 
     /* Register to transport manager */
@@ -570,5 +580,5 @@
 	pj_pool_t *pool = listener->factory.pool;
 
-	PJ_LOG(4,(listener->factory.obj_name,  "SIP TLS listener destroyed"));
+	PJ_LOG(4,(listener->factory.obj_name,  "SIP TLS transport destroyed"));
 
 	listener->factory.pool = NULL;
