Index: /pjproject/branches/1.x/pjmedia/include/pjmedia/session.h
===================================================================
--- /pjproject/branches/1.x/pjmedia/include/pjmedia/session.h	(revision 3570)
+++ /pjproject/branches/1.x/pjmedia/include/pjmedia/session.h	(revision 3571)
@@ -233,4 +233,24 @@
 
 /**
+ * Send RTCP SDES for the session.
+ *
+ * @param session	The media session.
+ *
+ * @return		PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) 
+pjmedia_session_send_rtcp_sdes( const pjmedia_session *session );
+
+/**
+ * Send RTCP BYE for the session.
+ *
+ * @param session	The media session.
+ *
+ * @return		PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) 
+pjmedia_session_send_rtcp_bye( const pjmedia_session *session );
+
+/**
  * Enumerate media streams in the session.
  *
Index: /pjproject/branches/1.x/pjmedia/include/pjmedia/stream.h
===================================================================
--- /pjproject/branches/1.x/pjmedia/include/pjmedia/stream.h	(revision 3570)
+++ /pjproject/branches/1.x/pjmedia/include/pjmedia/stream.h	(revision 3571)
@@ -134,4 +134,7 @@
 					 is enabled?			    */
 #endif
+    pj_bool_t           rtcp_sdes_bye_disabled; 
+                                    /**< Disable automatic sending of RTCP
+                                         SDES and BYE.                      */
 };
 
@@ -373,4 +376,24 @@
 
 /**
+ * Send RTCP SDES for the media stream.
+ *
+ * @param stream	The media stream.
+ *
+ * @return		PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) 
+pjmedia_stream_send_rtcp_sdes( pjmedia_stream *stream );
+
+/**
+ * Send RTCP BYE for the media stream.
+ *
+ * @param stream	The media stream.
+ *
+ * @return		PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t)
+pjmedia_stream_send_rtcp_bye( pjmedia_stream *stream );
+
+/**
  * @}
  */
Index: /pjproject/branches/1.x/pjmedia/src/pjmedia/session.c
===================================================================
--- /pjproject/branches/1.x/pjmedia/src/pjmedia/session.c	(revision 3570)
+++ /pjproject/branches/1.x/pjmedia/src/pjmedia/session.c	(revision 3571)
@@ -814,4 +814,38 @@
 
 /**
+ * Send RTCP SDES for the session.
+ */
+PJ_DEF(pj_status_t) 
+pjmedia_session_send_rtcp_sdes( const pjmedia_session *session )
+{
+    unsigned i;
+
+    PJ_ASSERT_RETURN(session, PJ_EINVAL);
+
+    for (i=0; i<session->stream_cnt; ++i) {
+	pjmedia_stream_send_rtcp_sdes(session->stream[i]);
+    }
+
+    return PJ_SUCCESS;
+}
+
+/**
+ * Send RTCP BYE for the session.
+ */
+PJ_DEF(pj_status_t) 
+pjmedia_session_send_rtcp_bye( const pjmedia_session *session )
+{
+    unsigned i;
+
+    PJ_ASSERT_RETURN(session, PJ_EINVAL);
+
+    for (i=0; i<session->stream_cnt; ++i) {
+	pjmedia_stream_send_rtcp_bye(session->stream[i]);
+    }
+
+    return PJ_SUCCESS;
+}
+
+/**
  * Enumerate media stream in the session.
  */
Index: /pjproject/branches/1.x/pjmedia/src/pjmedia/stream.c
===================================================================
--- /pjproject/branches/1.x/pjmedia/src/pjmedia/stream.c	(revision 3570)
+++ /pjproject/branches/1.x/pjmedia/src/pjmedia/stream.c	(revision 3571)
@@ -144,4 +144,5 @@
     pj_uint32_t		     rtcp_interval; /**< Interval, in timestamp.    */
     pj_bool_t		     initial_rr;    /**< Initial RTCP RR sent	    */
+    pj_bool_t                rtcp_sdes_bye_disabled;/**< Send RTCP SDES/BYE?*/
 
     /* RFC 2833 DTMF transmission queue: */
@@ -1827,17 +1828,22 @@
 	/* Build RR or SR */
 	pjmedia_rtcp_build_rtcp(&stream->rtcp, &sr_rr_pkt, &len);
-	pkt = (pj_uint8_t*) stream->enc->out_pkt;
-	pj_memcpy(pkt, sr_rr_pkt, len);
-	pkt += len;
-
-	/* Append SDES */
-	len = create_rtcp_sdes(stream, (pj_uint8_t*)pkt, 
-			       stream->enc->out_pkt_size - len);
-	if (len > 0) {
-	    pkt += len;
-	    len = ((pj_uint8_t*)pkt) - ((pj_uint8_t*)stream->enc->out_pkt);
-	    pjmedia_transport_send_rtcp(stream->transport, 
-					stream->enc->out_pkt, len);
-	}
+
+        if (!stream->rtcp_sdes_bye_disabled) {
+            pkt = (pj_uint8_t*) stream->enc->out_pkt;
+            pj_memcpy(pkt, sr_rr_pkt, len);
+            pkt += len;
+
+            /* Append SDES */
+            len = create_rtcp_sdes(stream, (pj_uint8_t*)pkt, 
+                                   stream->enc->out_pkt_size - len);
+            if (len > 0) {
+                pkt += len;
+                len = ((pj_uint8_t*)pkt) - ((pj_uint8_t*)stream->enc->out_pkt);
+                pjmedia_transport_send_rtcp(stream->transport, 
+                                            stream->enc->out_pkt, len);
+            }
+        } else {
+            pjmedia_transport_send_rtcp(stream->transport, ss_rr_pkt, len);
+        }
 
 	stream->initial_rr = PJ_TRUE;
@@ -1955,5 +1961,5 @@
     pjmedia_stream *stream;
     pj_str_t name;
-    unsigned jb_init, jb_max, jb_min_pre, jb_max_pre, len;
+    unsigned jb_init, jb_max, jb_min_pre, jb_max_pre;
     char *p;
     pj_status_t status;
@@ -1993,4 +1999,5 @@
     stream->rtcp_interval = (PJMEDIA_RTCP_INTERVAL-500 + (pj_rand()%1000)) *
 			    info->fmt.clock_rate / 1000;
+    stream->rtcp_sdes_bye_disabled = info->rtcp_sdes_bye_disabled;
 
     stream->tx_event_pt = info->tx_event_pt ? info->tx_event_pt : -1;
@@ -2306,9 +2313,6 @@
 
     /* Send RTCP SDES */
-    len = create_rtcp_sdes(stream, (pj_uint8_t*)stream->enc->out_pkt, 
-			   stream->enc->out_pkt_size);
-    if (len != 0) {
-	pjmedia_transport_send_rtcp(stream->transport, 
-				    stream->enc->out_pkt, len);
+    if (!stream->rtcp_sdes_bye_disabled) {
+        pjmedia_stream_send_rtcp_sdes(stream);
     }
 
@@ -2365,5 +2369,4 @@
 PJ_DEF(pj_status_t) pjmedia_stream_destroy( pjmedia_stream *stream )
 {
-    unsigned len;
     PJ_ASSERT_RETURN(stream != NULL, PJ_EINVAL);
 
@@ -2407,11 +2410,6 @@
 
     /* Send RTCP BYE */
-    if (stream->enc && stream->transport) {
-	len = create_rtcp_bye(stream, (pj_uint8_t*)stream->enc->out_pkt,
-			      stream->enc->out_pkt_size);
-	if (len != 0) {
-	    pjmedia_transport_send_rtcp(stream->transport, 
-					stream->enc->out_pkt, len);
-	}
+    if (!stream->rtcp_sdes_bye_disabled) {
+        pjmedia_stream_send_rtcp_bye(stream);
     }
 
@@ -2761,2 +2759,43 @@
 }
 
+/*
+ * Send RTCP SDES.
+ */
+PJ_DEF(pj_status_t)
+pjmedia_stream_send_rtcp_sdes( pjmedia_stream *stream )
+{
+    unsigned len;
+
+    PJ_ASSERT_RETURN(stream, PJ_EINVAL);
+
+    len = create_rtcp_sdes(stream, (pj_uint8_t*)stream->enc->out_pkt,
+                           stream->enc->out_pkt_size);
+    if (len != 0) {
+        return pjmedia_transport_send_rtcp(stream->transport, 
+                                           stream->enc->out_pkt, len);
+    }
+
+    return PJ_SUCCESS;
+}
+
+/*
+ * Send RTCP BYE.
+ */
+PJ_DEF(pj_status_t)
+pjmedia_stream_send_rtcp_bye( pjmedia_stream *stream )
+{
+    PJ_ASSERT_RETURN(stream, PJ_EINVAL);
+
+    if (stream->enc && stream->transport) {
+        unsigned len;
+
+        len = create_rtcp_bye(stream, (pj_uint8_t*)stream->enc->out_pkt,
+                              stream->enc->out_pkt_size);
+        if (len != 0) {
+            return pjmedia_transport_send_rtcp(stream->transport, 
+                                               stream->enc->out_pkt, len);
+        }
+    }
+
+    return PJ_SUCCESS;
+}
Index: /pjproject/branches/1.x/pjsip/src/pjsua-lib/pjsua_media.c
===================================================================
--- /pjproject/branches/1.x/pjsip/src/pjsua-lib/pjsua_media.c	(revision 3570)
+++ /pjproject/branches/1.x/pjsip/src/pjsua-lib/pjsua_media.c	(revision 3571)
@@ -1531,4 +1531,7 @@
     pjsua_call *call = &pjsua_var.calls[call_id];
 
+    if (call->session)
+        pjmedia_session_send_rtcp_bye(call->session);
+
     stop_media_session(call_id);
 
@@ -1574,4 +1577,5 @@
 				       const pjmedia_sdp_session *remote_sdp)
 {
+    unsigned i;
     int prev_media_st = 0;
     pjsua_call *call = &pjsua_var.calls[call_id];
@@ -1598,4 +1602,8 @@
     if (status != PJ_SUCCESS)
 	return status;
+
+    for (i = 0; i < sess_info.stream_cnt; ++i) {
+        sess_info.stream_info[i].rtcp_sdes_bye_disabled = PJ_TRUE;
+    }
 
     /* Update audio index from the negotiated SDP */
@@ -1717,4 +1725,7 @@
 	    return status;
 	}
+
+        if (prev_media_st == PJSUA_CALL_MEDIA_NONE)
+            pjmedia_session_send_rtcp_sdes(call->session);
 
 	/* If DTMF callback is installed by application, install our
