ortp: Log IP and port when logging RTP stats.
This allows us to match osmo-bts logs with logs of the other side (e.g. with
FreeSWITCH).
Change-Id: I5db92dab240779123c356af120adf3a3ef3838f1
diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c
index d505a7f..a7834c4 100644
--- a/src/trau/osmo_ortp.c
+++ b/src/trau/osmo_ortp.c
@@ -534,6 +534,8 @@
const char *pfx)
{
char jitter_stats_str[1024] = "";
+ const char *addr = NULL;
+ int port = 0;
#if HAVE_ORTP_021
const jitter_stats_t *jitter;
@@ -554,10 +556,15 @@
return;
}
- LOGP(subsys, level, "%sRTP Tx(%"PRIu64" pkts, %"PRIu64" bytes) "
+ if (osmo_rtp_get_bound_addr(rs, &addr, &port) != 0) {
+ LOGP(subsys, level, "Failed to obtain RTP socket IP and port!");
+ return;
+ }
+
+ LOGP(subsys, level, "%sRTP IP %s port %d Tx(%"PRIu64" pkts, %"PRIu64" bytes) "
"Rx(%"PRIu64" pkts, %"PRIu64" bytes, %"PRIu64" late, "
"%"PRIu64" loss, %"PRIu64" qmax)%s\n",
- pfx, stats->packet_sent, stats->sent,
+ pfx, addr, port, stats->packet_sent, stats->sent,
stats->packet_recv, stats->hw_recv, stats->outoftime,
stats->cum_packet_loss, stats->discarded,
jitter_stats_str);