Index: /pjproject/trunk/pjmedia/include/pjmedia/stream.h
===================================================================
--- /pjproject/trunk/pjmedia/include/pjmedia/stream.h	(revision 5478)
+++ /pjproject/trunk/pjmedia/include/pjmedia/stream.h	(revision 5479)
@@ -34,4 +34,5 @@
 #include <pjmedia/transport.h>
 #include <pjmedia/vid_codec.h>
+#include <pjmedia/stream_common.h>
 #include <pj/sock.h>
 
@@ -431,4 +432,23 @@
 pjmedia_stream_send_rtcp_bye( pjmedia_stream *stream );
 
+
+/**
+ * Get the RTP session information of the media stream. This function can be 
+ * useful for app with custom media transport to inject/filter some 
+ * outgoing/incoming proprietary packets into normal audio RTP traffics.
+ * This will return the original pointer to the internal states of the stream, 
+ * and generally it is not advisable for app to modify them.
+ *
+ * @param stream	The media stream.
+ *
+ * @param session_info	The stream session info.
+ *
+ * @return		PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t)
+pjmedia_stream_get_rtp_session_info(pjmedia_stream *stream,
+			           pjmedia_stream_rtp_sess_info *session_info);
+
+
 /**
  * @}
Index: /pjproject/trunk/pjmedia/include/pjmedia/stream_common.h
===================================================================
--- /pjproject/trunk/pjmedia/include/pjmedia/stream_common.h	(revision 5478)
+++ /pjproject/trunk/pjmedia/include/pjmedia/stream_common.h	(revision 5479)
@@ -28,7 +28,33 @@
 #include <pjmedia/codec.h>
 #include <pjmedia/sdp.h>
+#include <pjmedia/rtp.h>
+#include <pjmedia/rtcp.h>
 
 
 PJ_BEGIN_DECL
+
+/**
+ * This structure describes rtp/rtcp session information of the media stream.
+ */
+typedef struct pjmedia_stream_rtp_sess_info
+{
+    /**
+     * The decode RTP session.
+     */
+    const pjmedia_rtp_session *rx_rtp;
+
+    /**
+     * The encode RTP session.
+     */
+    const pjmedia_rtp_session *tx_rtp;
+
+    /**
+     * The decode RTCP session.
+     */
+    const pjmedia_rtcp_session *rtcp;
+
+} pjmedia_stream_rtp_sess_info;
+
+
 
 /**
Index: /pjproject/trunk/pjmedia/include/pjmedia/vid_stream.h
===================================================================
--- /pjproject/trunk/pjmedia/include/pjmedia/vid_stream.h	(revision 5478)
+++ /pjproject/trunk/pjmedia/include/pjmedia/vid_stream.h	(revision 5479)
@@ -32,4 +32,5 @@
 #include <pjmedia/transport.h>
 #include <pjmedia/vid_codec.h>
+#include <pjmedia/stream_common.h>
 #include <pj/sock.h>
 
@@ -446,4 +447,21 @@
 						pjmedia_vid_stream *stream);
 
+/**
+ * Get the RTP session information of the video media stream. This function 
+ * can be useful for app with custom media transport to inject/filter some 
+ * outgoing/incoming proprietary packets into normal video RTP traffics.
+ * This will return the original pointer to the internal states of the stream,
+ * and generally it is not advisable for app to modify them.
+ * 
+ * @param stream	The video media stream.
+ *
+ * @param session_info	The stream session info.
+ *
+ * @return		PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t)
+pjmedia_vid_stream_get_rtp_session_info(pjmedia_vid_stream *stream,
+				   pjmedia_stream_rtp_sess_info *session_info);
+
 
 /**
Index: /pjproject/trunk/pjmedia/src/pjmedia/stream.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/stream.c	(revision 5478)
+++ /pjproject/trunk/pjmedia/src/pjmedia/stream.c	(revision 5479)
@@ -23,5 +23,4 @@
 #include <pjmedia/rtcp.h>
 #include <pjmedia/jbuf.h>
-#include <pjmedia/stream_common.h>
 #include <pj/array.h>
 #include <pj/assert.h>
@@ -2924,2 +2923,16 @@
     return PJ_SUCCESS;
 }
+
+
+/**
+ * Get RTP session information from stream.
+ */
+PJ_DEF(pj_status_t)
+pjmedia_stream_get_rtp_session_info(pjmedia_stream *stream,
+				    pjmedia_stream_rtp_sess_info *session_info)
+{
+    session_info->rx_rtp = &stream->dec->rtp;
+    session_info->tx_rtp = &stream->enc->rtp;
+    session_info->rtcp = &stream->rtcp;
+    return PJ_SUCCESS;
+}
Index: /pjproject/trunk/pjmedia/src/pjmedia/vid_stream.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/vid_stream.c	(revision 5478)
+++ /pjproject/trunk/pjmedia/src/pjmedia/vid_stream.c	(revision 5479)
@@ -23,5 +23,4 @@
 #include <pjmedia/rtcp.h>
 #include <pjmedia/jbuf.h>
-#include <pjmedia/stream_common.h>
 #include <pj/array.h>
 #include <pj/assert.h>
@@ -2064,3 +2063,17 @@
 
 
+/**
+ * Get RTP session information from video stream.
+ */
+PJ_DEF(pj_status_t)
+pjmedia_vid_stream_get_rtp_session_info(pjmedia_vid_stream *stream,
+				    pjmedia_stream_rtp_sess_info *session_info)
+{
+    session_info->rx_rtp = &stream->dec->rtp;
+    session_info->tx_rtp = &stream->enc->rtp;
+    session_info->rtcp = &stream->rtcp;
+    return PJ_SUCCESS;
+}
+
+
 #endif /* PJMEDIA_HAS_VIDEO */
