Index: /pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
===================================================================
--- /pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c	(revision 3118)
+++ /pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c	(revision 3119)
@@ -2805,5 +2805,5 @@
     case PJSIP_TP_STATE_CONNECTED:
 	{
-	    PJ_LOG(3,(THIS_FILE, "SIP transport %s is connected to %s", 
+	    PJ_LOG(3,(THIS_FILE, "SIP %s transport is connected to %s",
 		     tp->type_name, host_port));
 	}
@@ -2814,5 +2814,5 @@
 	    char buf[100];
 
-	    snprintf(buf, sizeof(buf), "SIP transport %s is disconnected from %s",
+	    snprintf(buf, sizeof(buf), "SIP %s transport is disconnected from %s",
 		     tp->type_name, host_port);
 	    pjsua_perror(THIS_FILE, buf, info->status);
Index: /pjproject/trunk/pjsip/include/pjsip/sip_transport.h
===================================================================
--- /pjproject/trunk/pjsip/include/pjsip/sip_transport.h	(revision 3118)
+++ /pjproject/trunk/pjsip/include/pjsip/sip_transport.h	(revision 3119)
@@ -1313,5 +1313,5 @@
  */
 PJ_DECL(pj_status_t) pjsip_tpmgr_set_status_cb(pjsip_tpmgr *mgr,
-					       pjsip_tp_state_callback *cb);
+					       pjsip_tp_state_callback cb);
 
 
@@ -1323,5 +1323,5 @@
  * @return	    The transport state callback or NULL if it is not set.
  */
-PJ_DECL(pjsip_tp_state_callback*) pjsip_tpmgr_get_status_cb(
+PJ_DECL(pjsip_tp_state_callback) pjsip_tpmgr_get_status_cb(
 					       const pjsip_tpmgr *mgr);
 
Index: /pjproject/trunk/pjsip/include/pjsua-lib/pjsua_internal.h
===================================================================
--- /pjproject/trunk/pjsip/include/pjsua-lib/pjsua_internal.h	(revision 3118)
+++ /pjproject/trunk/pjsip/include/pjsua-lib/pjsua_internal.h	(revision 3119)
@@ -253,4 +253,5 @@
     pjsip_module	 mod;	    /**< pjsua's PJSIP module.		*/
     pjsua_transport_data tpdata[8]; /**< Array of transports.		*/
+    pjsip_tp_state_callback old_tp_cb; /**< Old transport callback.	*/
 
     /* Threading: */
Index: /pjproject/trunk/pjsip/src/pjsip/sip_transport.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsip/sip_transport.c	(revision 3118)
+++ /pjproject/trunk/pjsip/src/pjsip/sip_transport.c	(revision 3119)
@@ -90,5 +90,5 @@
     void           (*on_rx_msg)(pjsip_endpoint*, pj_status_t, pjsip_rx_data*);
     pj_status_t	   (*on_tx_msg)(pjsip_endpoint*, pjsip_tx_data*);
-    pjsip_tp_state_callback *tp_state_cb;
+    pjsip_tp_state_callback tp_state_cb;
     void *tp_state_user_data;
 };
@@ -1739,5 +1739,5 @@
 
 PJ_DEF(pj_status_t) pjsip_tpmgr_set_status_cb(pjsip_tpmgr *mgr,
-					      pjsip_tp_state_callback *cb)
+					      pjsip_tp_state_callback cb)
 {
     PJ_ASSERT_RETURN(mgr, PJ_EINVAL);
@@ -1748,5 +1748,5 @@
 }
 
-PJ_DEF(pjsip_tp_state_callback*) pjsip_tpmgr_get_status_cb(
+PJ_DEF(pjsip_tp_state_callback) pjsip_tpmgr_get_status_cb(
 					      const pjsip_tpmgr *mgr)
 {
Index: /pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c	(revision 3118)
+++ /pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c	(revision 3119)
@@ -170,5 +170,5 @@
 static void tcp_init_shutdown(struct tcp_transport *tcp, pj_status_t status)
 {
-    pjsip_tp_state_callback *state_cb;
+    pjsip_tp_state_callback state_cb;
 
     if (tcp->close_reason == PJ_SUCCESS)
@@ -953,5 +953,5 @@
     struct tcp_transport *tcp;
     char addr[PJ_INET6_ADDRSTRLEN+10];
-    pjsip_tp_state_callback *state_cb;
+    pjsip_tp_state_callback state_cb;
     pj_status_t status;
 
@@ -1263,6 +1263,5 @@
     pj_sockaddr_in addr;
     int addrlen;
-
-    pjsip_tp_state_callback *state_cb;
+    pjsip_tp_state_callback state_cb;
 
     tcp = (struct tcp_transport*) pj_activesock_get_user_data(asock);
Index: /pjproject/trunk/pjsip/src/pjsip/sip_transport_tls.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsip/sip_transport_tls.c	(revision 3118)
+++ /pjproject/trunk/pjsip/src/pjsip/sip_transport_tls.c	(revision 3119)
@@ -177,5 +177,5 @@
 static void tls_init_shutdown(struct tls_transport *tls, pj_status_t status)
 {
-    pjsip_tp_state_callback *state_cb;
+    pjsip_tp_state_callback state_cb;
 
     if (tls->close_reason == PJ_SUCCESS)
@@ -978,5 +978,5 @@
     pj_ssl_sock_info ssl_info;
     char addr[PJ_INET6_ADDRSTRLEN+10];
-    pjsip_tp_state_callback *state_cb;
+    pjsip_tp_state_callback state_cb;
     pj_bool_t is_shutdown;
     pj_status_t status;
@@ -1338,5 +1338,5 @@
     pj_ssl_sock_info ssl_info;
     pj_sockaddr_in addr, *tp_addr;
-    pjsip_tp_state_callback *state_cb;
+    pjsip_tp_state_callback state_cb;
     pj_bool_t is_shutdown;
 
Index: /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c	(revision 3118)
+++ /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c	(revision 3119)
@@ -1526,4 +1526,17 @@
 }
 
+/* Callback to receive transport state notifications */
+static void on_tp_state_callback(pjsip_transport *tp,
+				 pjsip_transport_state state,
+				 const pjsip_transport_state_info *info)
+{
+    if (pjsua_var.ua_cfg.cb.on_transport_state) {
+	(*pjsua_var.ua_cfg.cb.on_transport_state)(tp, state, info);
+    }
+    if (pjsua_var.old_tp_cb) {
+	(*pjsua_var.old_tp_cb)(tp, state, info);
+    }
+}
+
 /*
  * Create and initialize SIP socket (and possibly resolve public
@@ -1867,6 +1880,14 @@
     /* Set transport state callback */
     if (pjsua_var.ua_cfg.cb.on_transport_state) {
-	pjsip_tpmgr_set_status_cb(pjsip_endpt_get_tpmgr(pjsua_var.endpt),
-				  &pjsua_var.ua_cfg.cb.on_transport_state);
+	pjsip_tp_state_callback tpcb;
+	pjsip_tpmgr *tpmgr;
+
+	tpmgr = pjsip_endpt_get_tpmgr(pjsua_var.endpt);
+	tpcb = pjsip_tpmgr_get_status_cb(tpmgr);
+
+	if (tpcb != &on_tp_state_callback) {
+	    pjsua_var.old_tp_cb = tpcb;
+	    pjsip_tpmgr_set_status_cb(tpmgr, &on_tp_state_callback);
+	}
     }
 
