add osmo_rtp_socket_set_param() and osmo_rtp_socket_log_stats()
diff --git a/include/osmocom/trau/osmo_ortp.h b/include/osmocom/trau/osmo_ortp.h
index 5b350ce..2d32b02 100644
--- a/include/osmocom/trau/osmo_ortp.h
+++ b/include/osmocom/trau/osmo_ortp.h
@@ -21,6 +21,11 @@
 /*! \brief Osmocom pseudo-static paylaod type for Adaptive Multi Rate (AMR) */
 #define RTP_PT_AMR 98
 
+/*! \brief Parameter to osmo_rtp_socket_param_set() */
+enum osmo_rtp_param {
+	OSMO_RTP_P_JITBUF = 1,
+	OSMO_RTP_P_JIT_ADAP,
+};
 
 /*! \brief Flag to indicate the socket is in polling-only mode */
 #define OSMO_RTP_F_POLL		0x0001
@@ -67,5 +72,11 @@
 			       uint32_t *ip, int *port);
 int osmo_rtp_get_bound_addr(struct osmo_rtp_socket *rs,
 			    const char **addr, int *port);
+int osmo_rtp_socket_set_param(struct osmo_rtp_socket *rs,
+			      enum osmo_rtp_param param, int val);
+
+void osmo_rtp_socket_log_stats(struct osmo_rtp_socket *rs,
+				int subsys, int level,
+				const char *pfx);
 
 #endif /* _OSMO_ORTP_H */
diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c
index cac2508..be1d1c0 100644
--- a/src/trau/osmo_ortp.c
+++ b/src/trau/osmo_ortp.c
@@ -23,6 +23,7 @@
  */
 
 #include <stdint.h>
+#include <inttypes.h>
 #include <netdb.h>
 
 #include <osmocom/core/logging.h>
@@ -32,6 +33,7 @@
 #include <osmocom/trau/osmo_ortp.h>
 
 #include <ortp/ortp.h>
+#include <ortp/rtp.h>
 
 
 static PayloadType *payload_type_efr;
@@ -248,6 +250,27 @@
 	create_payload_types();
 }
 
+int osmo_rtp_socket_set_param(struct osmo_rtp_socket *rs,
+			      enum osmo_rtp_param param, int val)
+{
+	int rc = 0;
+
+	switch (param) {
+	case OSMO_RTP_P_JITBUF:
+		rtp_session_set_jitter_compensation(rs->sess, val);
+		break;
+#if 0
+	case OSMO_RTP_P_JIT_ADAP:
+		rc = jitter_control_enable_adaptive(rs->sess, val);
+		break;
+#endif
+	default:
+		return -EINVAL;
+	}
+
+	return rc;
+}
+
 /*! \brief Create a new RTP socket
  *  \param[in] talloc_cxt talloc context for this allocation. NULL for
  *  			  dafault context
@@ -466,3 +489,22 @@
 
 	return 0;
 }
+
+
+void osmo_rtp_socket_log_stats(struct osmo_rtp_socket *rs,
+				int subsys, int level,
+				const char *pfx)
+{
+	const rtp_stats_t *stats;
+
+	stats = rtp_session_get_stats(rs->sess);
+	if (!stats)
+		return;
+
+	LOGP(subsys, level, "%sRTP Tx(%"PRIu64" pkts, %"PRIu64" bytes) "
+		"Rx(%"PRIu64" pkts, %"PRIu64" bytes, %"PRIu64" late, "
+		"%"PRIu64" loss, %"PRIu64" qmax)\n",
+		pfx, stats->packet_sent, stats->sent,
+		stats->packet_recv, stats->hw_recv, stats->outoftime,
+		stats->cum_packet_loss, stats->discarded);
+}