Index: pjproject/trunk/pjmedia/include/pjmedia/config.h
===================================================================
--- pjproject/trunk/pjmedia/include/pjmedia/config.h	(revision 1859)
+++ pjproject/trunk/pjmedia/include/pjmedia/config.h	(revision 1860)
@@ -526,4 +526,25 @@
 
 /**
+ * Transport info (pjmedia_transport_info) contains a socket info and list
+ * of transport specific info, since transports can be chained together 
+ * (for example, SRTP transport uses UDP transport as the underlying 
+ * transport). This constant specifies maximum number of transport specific
+ * infos that can be held in a transport info.
+ */
+#ifndef PJMEDIA_TRANSPORT_SPECIFIC_INFO_MAXCNT
+#   define PJMEDIA_TRANSPORT_SPECIFIC_INFO_MAXCNT   4
+#endif
+
+
+/**
+ * Maximum size in bytes of storage buffer of a transport specific info.
+ */
+#ifndef PJMEDIA_TRANSPORT_SPECIFIC_INFO_MAXSIZE
+#   define PJMEDIA_TRANSPORT_SPECIFIC_INFO_MAXSIZE  (12*sizeof(long))
+#endif
+
+
+
+/**
  * @}
  */
Index: pjproject/trunk/pjmedia/include/pjmedia/transport.h
===================================================================
--- pjproject/trunk/pjmedia/include/pjmedia/transport.h	(revision 1859)
+++ pjproject/trunk/pjmedia/include/pjmedia/transport.h	(revision 1860)
@@ -208,8 +208,14 @@
 #include <pjmedia/sdp.h>
 
+
 /**
  * Forward declaration for media transport.
  */
 typedef struct pjmedia_transport pjmedia_transport;
+
+/**
+ * Forward declaration for media transport info.
+ */
+typedef struct pjmedia_transport_info pjmedia_transport_info;
 
 /**
@@ -229,4 +235,5 @@
 } pjmedia_tranport_media_option;
 
+
 /**
  * This structure describes the operations for the stream transport.
@@ -240,5 +247,5 @@
      */
     pj_status_t (*get_info)(pjmedia_transport *tp,
-			    pjmedia_sock_info *info);
+			    pjmedia_transport_info *info);
 
     /**
@@ -369,5 +376,12 @@
 
     /** Media transport using ICE */
-    PJMEDIA_TRANSPORT_TYPE_ICE
+    PJMEDIA_TRANSPORT_TYPE_ICE,
+
+    /** 
+     * Media transport SRTP, this transport is actually security adapter to be
+     * stacked with other transport to enable encryption on the underlying
+     * transport.
+     */
+    PJMEDIA_TRANSPORT_TYPE_SRTP
 
 } pjmedia_transport_type;
@@ -389,4 +403,54 @@
     /** Transport's "virtual" function table. */
     pjmedia_transport_op    *op;
+};
+
+/**
+ * This structure describes buffer storage of transport specific info.
+ * The actual transport specific info contents will be defined by transport
+ * implementation. Note that some transport implementations do not need to
+ * provide specific info, since the general socket info is enough.
+ */
+typedef struct pjmedia_transport_specific_info
+{
+    /**
+     * Specify media transport type.
+     */
+    pjmedia_transport_type   type;
+
+    /**
+     * Specify storage buffer size of transport specific info.
+     */
+    int			     cbsize;
+
+    /**
+     * Storage buffer of transport specific info.
+     */
+    char		     buffer[PJMEDIA_TRANSPORT_SPECIFIC_INFO_MAXSIZE];
+
+} pjmedia_transport_specific_info;
+
+
+/**
+ * This structure describes transport informations, including general 
+ * socket information and specific information of single transport or 
+ * stacked transports (e.g: SRTP stacked on top of UDP)
+ */
+struct pjmedia_transport_info
+{
+    /**
+     * General socket info.
+     */
+    pjmedia_sock_info sock_info;
+
+    /**
+     * Specifies number of transport specific info included.
+     */
+    int specific_info_cnt;
+
+    /**
+     * Buffer storage of transport specific info.
+     */
+    pjmedia_transport_specific_info spc_info[PJMEDIA_TRANSPORT_SPECIFIC_INFO_MAXCNT];
+
 };
 
@@ -404,5 +468,5 @@
  */
 PJ_INLINE(pj_status_t) pjmedia_transport_get_info(pjmedia_transport *tp,
-						  pjmedia_sock_info *info)
+						  pjmedia_transport_info *info)
 {
     if (tp->op->get_info)
Index: pjproject/trunk/pjmedia/include/pjmedia/transport_srtp.h
===================================================================
--- pjproject/trunk/pjmedia/include/pjmedia/transport_srtp.h	(revision 1859)
+++ pjproject/trunk/pjmedia/include/pjmedia/transport_srtp.h	(revision 1860)
@@ -161,4 +161,28 @@
 
 /**
+ * This structure specifies SRTP transport specific info. This will fit
+ * into \a buffer field of pjmedia_transport_specific_info.
+ */
+typedef struct pjmedia_srtp_info
+{
+    /**
+     * Specify whether the SRTP transport is active for SRTP session.
+     */
+    pj_bool_t			active;
+
+    /**
+     * Specify the policy used by the SRTP session for receive direction.
+     */
+    pjmedia_srtp_crypto		rx_policy;
+
+    /**
+     * Specify the policy used by the SRTP session for transmit direction.
+     */
+    pjmedia_srtp_crypto		tx_policy;
+
+} pjmedia_srtp_info;
+
+
+/**
  * Initialize SRTP setting with its default values.
  *
Index: pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c	(revision 1859)
+++ pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c	(revision 1860)
@@ -56,5 +56,5 @@
  */
 static pj_status_t transport_get_info (pjmedia_transport *tp,
-				       pjmedia_sock_info *info);
+				       pjmedia_transport_info *info);
 static pj_status_t transport_attach   (pjmedia_transport *tp,
 				       void *user_data,
@@ -674,5 +674,5 @@
 
 static pj_status_t transport_get_info(pjmedia_transport *tp,
-				      pjmedia_sock_info *info)
+				      pjmedia_transport_info *info)
 {
     struct transport_ice *tp_ice = (struct transport_ice*)tp;
@@ -680,12 +680,12 @@
     pj_ice_strans_comp *comp;
 
-    pj_bzero(info, sizeof(*info));
-    info->rtp_sock = info->rtcp_sock = PJ_INVALID_SOCKET;
+    pj_bzero(&info->sock_info, sizeof(info->sock_info));
+    info->sock_info.rtp_sock = info->sock_info.rtcp_sock = PJ_INVALID_SOCKET;
 
     /* Retrieve address of default candidate for component 1 (RTP) */
     comp = ice_st->comp[0];
     pj_assert(comp->default_cand >= 0);
-    info->rtp_sock = comp->sock;
-    pj_memcpy(&info->rtp_addr_name, 
+    info->sock_info.rtp_sock = comp->sock;
+    pj_memcpy(&info->sock_info.rtp_addr_name, 
 	      &comp->cand_list[comp->default_cand].addr,
 	      sizeof(pj_sockaddr_in));
@@ -695,10 +695,11 @@
 	comp = ice_st->comp[1];
 	pj_assert(comp->default_cand >= 0);
-	info->rtp_sock = comp->sock;
-	pj_memcpy(&info->rtcp_addr_name, 
+	info->sock_info.rtp_sock = comp->sock;
+	pj_memcpy(&info->sock_info.rtcp_addr_name, 
 		  &comp->cand_list[comp->default_cand].addr,
 		  sizeof(pj_sockaddr_in));
     }
 
+    info->specific_info_cnt = 0;
 
     return PJ_SUCCESS;
Index: pjproject/trunk/pjmedia/src/pjmedia/transport_srtp.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/transport_srtp.c	(revision 1859)
+++ pjproject/trunk/pjmedia/src/pjmedia/transport_srtp.c	(revision 1860)
@@ -126,5 +126,5 @@
  */
 static pj_status_t transport_get_info (pjmedia_transport *tp,
-				       pjmedia_sock_info *info);
+				       pjmedia_transport_info *info);
 static pj_status_t transport_attach   (pjmedia_transport *tp,
 				       void *user_data,
@@ -552,10 +552,32 @@
 
 static pj_status_t transport_get_info(pjmedia_transport *tp,
-				      pjmedia_sock_info *info)
+				      pjmedia_transport_info *info)
 {
     transport_srtp *srtp = (transport_srtp*) tp;
-
-    /* put SRTP info as well? */
-    return pjmedia_transport_get_info(srtp->real_tp, info);
+    pjmedia_srtp_info srtp_info;
+    int spc_info_idx;
+    pj_status_t status;
+
+    PJ_ASSERT_RETURN(tp && info, PJ_EINVAL);
+    PJ_ASSERT_RETURN(info->specific_info_cnt <
+		     PJMEDIA_TRANSPORT_SPECIFIC_INFO_MAXCNT, PJ_ETOOMANY);
+    PJ_ASSERT_RETURN(sizeof(pjmedia_srtp_info) <=
+		     PJMEDIA_TRANSPORT_SPECIFIC_INFO_MAXSIZE, PJ_ENOMEM);
+
+    status = pjmedia_transport_get_info(srtp->real_tp, info);
+    if (status != PJ_SUCCESS)
+	return status;
+
+    srtp_info.active = srtp->session_inited;
+    srtp_info.rx_policy = srtp->rx_policy;
+    srtp_info.tx_policy = srtp->tx_policy;
+
+    spc_info_idx = info->specific_info_cnt++;
+    info->spc_info[spc_info_idx].type = PJMEDIA_TRANSPORT_TYPE_SRTP;
+    info->spc_info[spc_info_idx].cbsize = sizeof(srtp_info);
+    pj_memcpy(&info->spc_info[spc_info_idx].buffer, &srtp_info, 
+	      sizeof(srtp_info));
+
+    return PJ_SUCCESS;
 }
 
Index: pjproject/trunk/pjmedia/src/pjmedia/transport_udp.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/transport_udp.c	(revision 1859)
+++ pjproject/trunk/pjmedia/src/pjmedia/transport_udp.c	(revision 1860)
@@ -102,5 +102,5 @@
  */
 static pj_status_t transport_get_info (pjmedia_transport *tp,
-				       pjmedia_sock_info *info);
+				       pjmedia_transport_info *info);
 static pj_status_t transport_attach   (pjmedia_transport *tp,
 				       void *user_data,
@@ -585,13 +585,14 @@
 /* Called to get the transport info */
 static pj_status_t transport_get_info(pjmedia_transport *tp,
-				      pjmedia_sock_info *info)
+				      pjmedia_transport_info *info)
 {
     struct transport_udp *udp = (struct transport_udp*)tp;
     PJ_ASSERT_RETURN(tp && info, PJ_EINVAL);
 
-    info->rtp_sock = udp->rtp_sock;
-    info->rtp_addr_name = udp->rtp_addr_name;
-    info->rtcp_sock = udp->rtcp_sock;
-    info->rtcp_addr_name = udp->rtcp_addr_name;
+    info->sock_info.rtp_sock = udp->rtp_sock;
+    info->sock_info.rtp_addr_name = udp->rtp_addr_name;
+    info->sock_info.rtcp_sock = udp->rtcp_sock;
+    info->sock_info.rtcp_addr_name = udp->rtcp_addr_name;
+    info->specific_info_cnt = 0;
 
     return PJ_SUCCESS;
Index: pjproject/trunk/pjsip-apps/src/samples/simpleua.c
===================================================================
--- pjproject/trunk/pjsip-apps/src/samples/simpleua.c	(revision 1859)
+++ pjproject/trunk/pjsip-apps/src/samples/simpleua.c	(revision 1860)
@@ -82,5 +82,5 @@
 
 static pjmedia_endpt	    *g_med_endpt;   /* Media endpoint.		*/
-static pjmedia_sock_info     g_med_skinfo;  /* Socket info for media	*/
+static pjmedia_transport_info g_med_tpinfo; /* Socket info for media	*/
 static pjmedia_transport    *g_med_transport;/* Media stream transport	*/
 
@@ -302,5 +302,5 @@
      * the SDP).
      */
-    pjmedia_transport_get_info(g_med_transport, &g_med_skinfo);
+    pjmedia_transport_get_info(g_med_transport, &g_med_tpinfo);
 
 
@@ -365,5 +365,6 @@
 					   dlg->pool,	    /* pool.		*/
 					   1,		    /* # of streams	*/
-					   &g_med_skinfo,   /* RTP sock info	*/
+					   &g_med_tpinfo.sock_info,   
+							    /* RTP sock info	*/
 					   &local_sdp);	    /* the SDP result	*/
 	PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1);
@@ -572,5 +573,5 @@
 
     status = pjmedia_endpt_create_sdp( g_med_endpt, rdata->tp_info.pool, 1,
-				       &g_med_skinfo, 
+				       &g_med_tpinfo.sock_info, 
 				       &local_sdp);
     PJ_ASSERT_RETURN(status == PJ_SUCCESS, PJ_TRUE);
Index: pjproject/trunk/pjsip-apps/src/samples/siprtp.c
===================================================================
--- pjproject/trunk/pjsip-apps/src/samples/siprtp.c	(revision 1859)
+++ pjproject/trunk/pjsip-apps/src/samples/siprtp.c	(revision 1860)
@@ -1006,5 +1006,5 @@
     pjmedia_sdp_media *m;
     pjmedia_sdp_attr *attr;
-    pjmedia_sock_info tpinfo;
+    pjmedia_transport_info tpinfo;
     struct media_stream *audio = &call->media[0];
 
@@ -1048,5 +1048,5 @@
     /* Standard media info: */
     m->desc.media = pj_str("audio");
-    m->desc.port = pj_ntohs(tpinfo.rtp_addr_name.ipv4.sin_port);
+    m->desc.port = pj_ntohs(tpinfo.sock_info.rtp_addr_name.ipv4.sin_port);
     m->desc.port_count = 1;
     m->desc.transport = pj_str("RTP/AVP");
Index: pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c	(revision 1859)
+++ pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c	(revision 1860)
@@ -2201,4 +2201,5 @@
     pj_status_t status;
     int len;
+    pjmedia_transport_info tp_info;
 
     PJ_ASSERT_RETURN(call_id>=0 && call_id<(int)pjsua_var.ua_cfg.max_calls,
@@ -2257,4 +2258,29 @@
 	*p++ = '\n';
 	*p = '\0';
+    }
+
+    /* Get SRTP status */
+    pjmedia_transport_get_info(call->med_tp, &tp_info);
+    if (tp_info.specific_info_cnt > 0) {
+	int i;
+	for (i = 0; i < tp_info.specific_info_cnt; ++i) {
+	    if (tp_info.spc_info[i].type == PJMEDIA_TRANSPORT_TYPE_SRTP) 
+	    {
+		pjmedia_srtp_info *srtp_info = 
+			    (pjmedia_srtp_info*) tp_info.spc_info[i].buffer;
+
+		len = pj_ansi_snprintf(p, end-p, 
+				       "%s  SRTP status: %s Crypto-suite: %s",
+				       indent,
+				       (srtp_info->active?"Active":"Not active"),
+				       srtp_info->tx_policy.name.ptr);
+		if (len > 0 && len < end-p) {
+		    p += len;
+		    *p++ = '\n';
+		    *p = '\0';
+		}
+		break;
+	    }
+	}
     }
 
@@ -2443,9 +2469,9 @@
     {
 	pjmedia_sdp_session *local_sdp;
-	pjmedia_sock_info si;
-
-	call->med_tp->op->get_info(call->med_tp, &si);
+	pjmedia_transport_info ti;
+
+	pjmedia_transport_get_info(call->med_tp, &ti);
 	status = pjmedia_endpt_create_sdp(pjsua_var.med_endpt, tdata->pool, 
-					  1, &si, &local_sdp);
+					  1, &ti.sock_info, &local_sdp);
 	if (status == PJ_SUCCESS) {
 	    pjsip_create_sdp_body(tdata->pool, local_sdp,
@@ -2552,13 +2578,13 @@
     pjmedia_sdp_conn *conn;
     pjmedia_sdp_attr *attr;
-    pjmedia_sock_info skinfo;
+    pjmedia_transport_info tp_info;
     pjmedia_sdp_session *sdp;
 
     /* Get media socket info */
-    pjmedia_transport_get_info(call->med_tp, &skinfo);
+    pjmedia_transport_get_info(call->med_tp, &tp_info);
 
     /* Create new offer */
     status = pjmedia_endpt_create_sdp(pjsua_var.med_endpt, pjsua_var.pool, 1,
-				      &skinfo, &sdp);
+				      &tp_info.sock_info, &sdp);
     if (status != PJ_SUCCESS) {
 	pjsua_perror(THIS_FILE, "Unable to create local SDP", status);
Index: pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c	(revision 1859)
+++ pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c	(revision 1860)
@@ -261,5 +261,5 @@
     pjsip_tx_data *tdata;
     pjsip_response_addr res_addr;
-    pjmedia_sock_info skinfo;
+    pjmedia_transport_info tpinfo;
     pjmedia_sdp_session *sdp;
     const pjsip_hdr *cap_hdr;
@@ -321,9 +321,9 @@
 
     /* Get media socket info */
-    pjmedia_transport_get_info(pjsua_var.calls[0].med_tp, &skinfo);
+    pjmedia_transport_get_info(pjsua_var.calls[0].med_tp, &tpinfo);
 
     /* Add SDP body, using call0's RTP address */
     status = pjmedia_endpt_create_sdp(pjsua_var.med_endpt, tdata->pool, 1,
-				      &skinfo, &sdp);
+				      &tpinfo.sock_info, &sdp);
     if (status == PJ_SUCCESS) {
 	pjsip_create_sdp_body(tdata->pool, sdp, &tdata->msg->body);
@@ -2061,15 +2061,15 @@
     for (i=0; i<pjsua_var.ua_cfg.max_calls; ++i) {
 	pjsua_call *call = &pjsua_var.calls[i];
-	pjmedia_sock_info skinfo;
+	pjmedia_transport_info tpinfo;
 	char addr_buf[80];
 
-	/* MSVC complains about skinfo not being initialized */
-	pj_bzero(&skinfo, sizeof(skinfo));
-
-	pjmedia_transport_get_info(call->med_tp, &skinfo);
+	/* MSVC complains about tpinfo not being initialized */
+	pj_bzero(&tpinfo, sizeof(tpinfo));
+
+	pjmedia_transport_get_info(call->med_tp, &tpinfo);
 
 	PJ_LOG(3,(THIS_FILE, " %s: %s",
 		  (pjsua_var.media_cfg.enable_ice ? "ICE" : "UDP"),
-		  pj_sockaddr_print(&skinfo.rtp_addr_name, addr_buf,
+		  pj_sockaddr_print(&tpinfo.sock_info.rtp_addr_name, addr_buf,
 				    sizeof(addr_buf), 3)));
     }
Index: pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c	(revision 1859)
+++ pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c	(revision 1860)
@@ -815,5 +815,5 @@
     enum { MAX_MEDIA = 1, MEDIA_IDX = 0 };
     pjmedia_sdp_session *sdp;
-    pjmedia_sock_info skinfo;
+    pjmedia_transport_info tpinfo;
     pjsua_call *call = &pjsua_var.calls[call_id];
     pj_status_t status;
@@ -827,9 +827,9 @@
 
     /* Get media socket info */
-    pjmedia_transport_get_info(call->med_tp, &skinfo);
+    pjmedia_transport_get_info(call->med_tp, &tpinfo);
 
     /* Create SDP */
     status = pjmedia_endpt_create_sdp(pjsua_var.med_endpt, pool, MAX_MEDIA,
-				      &skinfo, &sdp);
+				      &tpinfo.sock_info, &sdp);
     if (status != PJ_SUCCESS) {
 	if (sip_status_code) *sip_status_code = 500;
