diff options
author | Alexander Chemeris <Alexander.Chemeris@gmail.com> | 2016-12-27 19:55:05 +0100 |
---|---|---|
committer | Alexander Chemeris <Alexander.Chemeris@gmail.com> | 2016-12-27 19:57:09 +0100 |
commit | ab3218def5cb78c83f19fd10098fe3eed90bae79 (patch) | |
tree | 86349337236e04459fa35f9696b32ccb8072d778 | |
parent | bb3129d103454df2e779989f88aaa640a1f93a71 (diff) |
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
-rw-r--r-- | src/trau/osmo_ortp.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c index 8b707ab..8590bfb 100644 --- a/src/trau/osmo_ortp.c +++ b/src/trau/osmo_ortp.c @@ -577,6 +577,8 @@ void osmo_rtp_socket_log_stats(struct osmo_rtp_socket *rs, const char *pfx) { char jitter_stats_str[1024] = ""; + const char *addr = NULL; + int port = 0; #if HAVE_ORTP_021 const jitter_stats_t *jitter; @@ -597,10 +599,15 @@ void osmo_rtp_socket_log_stats(struct osmo_rtp_socket *rs, 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); |