Index: /pjproject/trunk/pjlib/include/pj/math.h
===================================================================
--- /pjproject/trunk/pjlib/include/pj/math.h	(revision 2843)
+++ /pjproject/trunk/pjlib/include/pj/math.h	(revision 2844)
@@ -169,5 +169,5 @@
  * @return	    The standard deviation.
  */
-PJ_INLINE(unsigned) pj_math_stat_get_stddev(pj_math_stat *stat)
+PJ_INLINE(unsigned) pj_math_stat_get_stddev(const pj_math_stat *stat)
 {
     if (stat->n == 0) return 0;
Index: /pjproject/trunk/pjmedia/include/pjmedia/jbuf.h
===================================================================
--- /pjproject/trunk/pjmedia/include/pjmedia/jbuf.h	(revision 2843)
+++ /pjproject/trunk/pjmedia/include/pjmedia/jbuf.h	(revision 2844)
@@ -301,5 +301,5 @@
  * @return		PJ_SUCCESS on success.
  */
-PJ_DECL(pj_status_t) pjmedia_jbuf_get_state( pjmedia_jbuf *jb,
+PJ_DECL(pj_status_t) pjmedia_jbuf_get_state( const pjmedia_jbuf *jb,
 					     pjmedia_jb_state *state );
 
Index: /pjproject/trunk/pjmedia/include/pjmedia/session.h
===================================================================
--- /pjproject/trunk/pjmedia/include/pjmedia/session.h	(revision 2843)
+++ /pjproject/trunk/pjmedia/include/pjmedia/session.h	(revision 2844)
@@ -270,4 +270,5 @@
  * Get session statistics. The stream statistic shows various
  * indicators such as packet count, packet lost, jitter, delay, etc.
+ * See also #pjmedia_session_get_stream_stat_jbuf()
  *
  * @param session	The media session.
@@ -300,4 +301,19 @@
 #endif
 
+
+/**
+ * Get current jitter buffer state for the specified stream.
+ * See also #pjmedia_session_get_stream_stat()
+ *
+ * @param session	The media session.
+ * @param index		Stream index.
+ * @param state		Jitter buffer state.
+ *
+ * @return		PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pjmedia_session_get_stream_stat_jbuf(
+					    pjmedia_session *session,
+					    unsigned index,
+					    pjmedia_jb_state *state);
 
 /**
Index: /pjproject/trunk/pjmedia/include/pjmedia/stream.h
===================================================================
--- /pjproject/trunk/pjmedia/include/pjmedia/stream.h	(revision 2843)
+++ /pjproject/trunk/pjmedia/include/pjmedia/stream.h	(revision 2844)
@@ -29,4 +29,5 @@
 #include <pjmedia/codec.h>
 #include <pjmedia/endpoint.h>
+#include <pjmedia/jbuf.h>
 #include <pjmedia/port.h>
 #include <pjmedia/rtcp.h>
@@ -215,5 +216,6 @@
 
 /**
- * Get the stream statistics.
+ * Get the stream statistics. See also
+ * #pjmedia_stream_get_stat_jbuf()
  *
  * @param stream	The media stream.
@@ -237,4 +239,17 @@
 					         pjmedia_rtcp_xr_stat *stat);
 #endif
+
+/**
+ * Get current jitter buffer state. See also
+ * #pjmedia_stream_get_stat()
+ *
+ * @param stream	The media stream.
+ * @param state		Jitter buffer state.
+ *
+ * @return		PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pjmedia_stream_get_stat_jbuf(const pjmedia_stream *stream,
+						  pjmedia_jb_state *state);
+
 
 /**
Index: /pjproject/trunk/pjmedia/src/pjmedia/jbuf.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/jbuf.c	(revision 2843)
+++ /pjproject/trunk/pjmedia/src/pjmedia/jbuf.c	(revision 2844)
@@ -212,5 +212,5 @@
 
 
-static unsigned jb_framelist_size(jb_framelist_t *framelist) 
+static unsigned jb_framelist_size(const jb_framelist_t *framelist) 
 {
     return framelist->size;
@@ -469,10 +469,10 @@
 PJ_DEF(pj_status_t) pjmedia_jbuf_destroy(pjmedia_jbuf *jb)
 {
-    TRACE__((jb->jb_name.ptr, "\n"
-	    "  JB summary:\n"
-	    "    size=%d prefetch=%d\n"
-	    "    delay (min/max/avg/dev)=%d/%d/%d/%d ms\n"
-	    "    burst (min/max/avg/dev)=%d/%d/%d/%d frames\n"
-	    "    lost=%d discard=%d empty=%d\n",
+    TRACE__((jb->jb_name.ptr, ""
+	    "JB summary:"
+	    " size=%d prefetch=%d,"
+	    " delay (min/max/avg/dev)=%d/%d/%d/%d ms,"
+	    " burst (min/max/avg/dev)=%d/%d/%d/%d frames,"
+	    " lost=%d discard=%d empty=%d",
 	    jb->jb_framelist.size, jb->jb_prefetch,
 	    jb->jb_delay.min, jb->jb_delay.max, jb->jb_delay.mean, 
@@ -766,5 +766,5 @@
  * Get jitter buffer state.
  */
-PJ_DEF(pj_status_t) pjmedia_jbuf_get_state( pjmedia_jbuf *jb,
+PJ_DEF(pj_status_t) pjmedia_jbuf_get_state( const pjmedia_jbuf *jb,
 					    pjmedia_jb_state *state )
 {
Index: /pjproject/trunk/pjmedia/src/pjmedia/session.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/session.c	(revision 2843)
+++ /pjproject/trunk/pjmedia/src/pjmedia/session.c	(revision 2844)
@@ -858,4 +858,15 @@
 #endif
 
+PJ_DEF(pj_status_t) pjmedia_session_get_stream_stat_jbuf(
+					    pjmedia_session *session,
+					    unsigned index,
+					    pjmedia_jb_state *state)
+{
+    PJ_ASSERT_RETURN(session && state && index < session->stream_cnt, 
+		     PJ_EINVAL);
+
+    return pjmedia_stream_get_stat_jbuf(session->stream[index], state);
+}
+
 /*
  * Dial DTMF digit to the stream, using RFC 2833 mechanism.
Index: /pjproject/trunk/pjmedia/src/pjmedia/stream.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/stream.c	(revision 2843)
+++ /pjproject/trunk/pjmedia/src/pjmedia/stream.c	(revision 2844)
@@ -328,4 +328,5 @@
 	    if (frame_type != stream->jb_last_frm) {
 		pjmedia_jb_state jb_state;
+		const char *with_plc = "";
 
 		/* Activate PLC to smoothen the missing frame */
@@ -347,4 +348,5 @@
 		    } while (samples_count < samples_required);
 
+		    with_plc = ", plc invoked";
 		} 
 
@@ -352,6 +354,6 @@
 		pjmedia_jbuf_get_state(stream->jb, &jb_state);
 		PJ_LOG(5,(stream->port.info.name.ptr, 
-			  "Jitter buffer empty (prefetch=%d)", 
-			  jb_state.prefetch));
+			  "Jitter buffer empty (prefetch=%d)%s", 
+			  jb_state.prefetch, with_plc));
 
 	    }
@@ -1880,5 +1882,4 @@
 	jb_init = 0;
 
-
     /* Create jitter buffer */
     status = pjmedia_jbuf_create(pool, &stream->port.info.name,
@@ -2171,4 +2172,14 @@
 }
 #endif
+
+/*
+ * Get jitter buffer state.
+ */
+PJ_DEF(pj_status_t) pjmedia_stream_get_stat_jbuf(const pjmedia_stream *stream,
+						 pjmedia_jb_state *state)
+{
+    PJ_ASSERT_RETURN(stream && state, PJ_EINVAL);
+    return pjmedia_jbuf_get_state(stream->jb, state);
+}
 
 /*
