Index: /pjproject/trunk/pjmedia/include/pjmedia/errno.h
===================================================================
--- /pjproject/trunk/pjmedia/include/pjmedia/errno.h	(revision 5844)
+++ /pjproject/trunk/pjmedia/include/pjmedia/errno.h	(revision 5845)
@@ -627,4 +627,9 @@
  */
 #define PJMEDIA_SRTP_ESDPREQSECTP   (PJMEDIA_ERRNO_START+229)    /* 220229 */
+/**
+ * @hideinitializer
+ * SRTP parameters negotiation still in progress.
+ */
+#define PJMEDIA_SRTP_EKEYNOTREADY   (PJMEDIA_ERRNO_START+230)	 /* 220230 */
 
 /**
Index: /pjproject/trunk/pjmedia/src/pjmedia/errno.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/errno.c	(revision 5844)
+++ /pjproject/trunk/pjmedia/src/pjmedia/errno.c	(revision 5845)
@@ -167,4 +167,5 @@
     PJ_BUILD_ERR( PJMEDIA_SRTP_ESDPREQCRYPTO,   "SRTP crypto attribute required" ),
     PJ_BUILD_ERR( PJMEDIA_SRTP_ESDPREQSECTP,    "Secure transport required in SDP media descriptor" ),
+    PJ_BUILD_ERR( PJMEDIA_SRTP_EKEYNOTREADY,    "SRTP parameters negotiation still in progress" ),
     PJ_BUILD_ERR( PJMEDIA_SRTP_DTLS_ENOCRYPTO,  "No matching SRTP crypto-suite after DTLS nego" ),
     PJ_BUILD_ERR( PJMEDIA_SRTP_DTLS_EPEERNOCERT,"No certificate supplied by peer in DTLS nego" ),
Index: /pjproject/trunk/pjmedia/src/pjmedia/stream.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/stream.c	(revision 5844)
+++ /pjproject/trunk/pjmedia/src/pjmedia/stream.c	(revision 5845)
@@ -247,4 +247,6 @@
     pj_uint32_t		     rtp_rx_last_ts;        /**< Last received RTP timestamp*/
     pj_status_t		     rtp_rx_last_err;       /**< Last RTP recv() error */
+    pj_status_t		     rtp_tx_last_err;       /**< Last RTP send() error */
+    pj_status_t		     rtcp_tx_last_err;      /**< Last RTCP send() error */
 
     /* RTCP Feedback */
@@ -1142,4 +1144,16 @@
     /* Send! */
     status = pjmedia_transport_send_rtcp(stream->transport, pkt, len);
+    if (status != PJ_SUCCESS) {
+	if (stream->rtcp_tx_last_err != status) {
+	    PJ_PERROR(4,(stream->port.info.name.ptr, status,
+			 "Error sending RTCP"));
+	    stream->rtcp_tx_last_err = status;
+	}
+    } else {
+	if (stream->rtcp_tx_last_err != PJ_SUCCESS) {
+	    PJ_LOG(4,(stream->port.info.name.ptr, "Sending RTCP resumed"));
+	    stream->rtcp_tx_last_err = PJ_SUCCESS;
+	}
+    }
 
     return status;
@@ -1184,10 +1198,7 @@
 	status = send_rtcp(stream, !stream->rtcp_sdes_bye_disabled, PJ_FALSE,
 			   with_xr, PJ_FALSE);
-	if (status != PJ_SUCCESS) {
-	    PJ_PERROR(4,(stream->port.info.name.ptr, status,
-        		 "Error sending RTCP"));
-	}
-
-	stream->rtcp_last_tx = timestamp;
+	if (status == PJ_SUCCESS) {
+	    stream->rtcp_last_tx = timestamp;
+	}
     }
 }
@@ -1485,7 +1496,15 @@
 					    sizeof(pjmedia_rtp_hdr));
     if (status != PJ_SUCCESS) {
-	PJ_PERROR(4,(stream->port.info.name.ptr, status,
-		     "Error sending RTP"));
+	if (stream->rtp_tx_last_err != status) {
+	    PJ_PERROR(4,(stream->port.info.name.ptr, status,
+			 "Error sending RTP"));
+	    stream->rtp_tx_last_err = status;
+	}
 	return PJ_SUCCESS;
+    } else {
+	if (stream->rtp_tx_last_err != PJ_SUCCESS) {
+	    PJ_LOG(4,(stream->port.info.name.ptr, "Sending RTP resumed"));
+	    stream->rtp_tx_last_err = PJ_SUCCESS;
+	}
     }
 
Index: /pjproject/trunk/pjmedia/src/pjmedia/transport_srtp.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/transport_srtp.c	(revision 5844)
+++ /pjproject/trunk/pjmedia/src/pjmedia/transport_srtp.c	(revision 5845)
@@ -1190,5 +1190,5 @@
     if (!srtp->session_inited) {
 	pj_lock_release(srtp->mutex);
-	return PJ_EINVALIDOP;
+	return PJMEDIA_SRTP_EKEYNOTREADY;
     }
     err = srtp_protect(srtp->srtp_tx_ctx, srtp->rtp_tx_buffer, &len);
@@ -1236,5 +1236,5 @@
     if (!srtp->session_inited) {
 	pj_lock_release(srtp->mutex);
-	return PJ_EINVALIDOP;
+	return PJMEDIA_SRTP_EKEYNOTREADY;
     }
     err = srtp_protect_rtcp(srtp->srtp_tx_ctx, srtp->rtcp_tx_buffer, &len);
