aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openbsc/include/openbsc/mgcp_internal.h1
-rw-r--r--openbsc/src/libmgcp/mgcp_network.c2
-rw-r--r--openbsc/src/libmgcp/mgcp_protocol.c1
3 files changed, 4 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/mgcp_internal.h b/openbsc/include/openbsc/mgcp_internal.h
index f2f6d3f7b..6375be7ab 100644
--- a/openbsc/include/openbsc/mgcp_internal.h
+++ b/openbsc/include/openbsc/mgcp_internal.h
@@ -55,6 +55,7 @@ struct mgcp_rtp_state {
struct mgcp_rtp_end {
/* statistics */
unsigned int packets;
+ unsigned int octets;
struct in_addr addr;
/* in network byte order */
diff --git a/openbsc/src/libmgcp/mgcp_network.c b/openbsc/src/libmgcp/mgcp_network.c
index 167d78c3a..275e47758 100644
--- a/openbsc/src/libmgcp/mgcp_network.c
+++ b/openbsc/src/libmgcp/mgcp_network.c
@@ -289,6 +289,7 @@ static int rtp_data_net(struct osmo_fd *fd, unsigned int what)
proto = fd == &endp->net_end.rtp ? PROTO_RTP : PROTO_RTCP;
endp->net_end.packets += 1;
+ endp->net_end.octets += rc;
forward_data(fd->fd, &endp->taps[MGCP_TAP_NET_IN], buf, rc);
if (endp->is_transcoded)
@@ -369,6 +370,7 @@ static int rtp_data_bts(struct osmo_fd *fd, unsigned int what)
/* do this before the loop handling */
endp->bts_end.packets += 1;
+ endp->bts_end.octets += rc;
forward_data(fd->fd, &endp->taps[MGCP_TAP_BTS_IN], buf, rc);
if (endp->is_transcoded)
diff --git a/openbsc/src/libmgcp/mgcp_protocol.c b/openbsc/src/libmgcp/mgcp_protocol.c
index 99ca415e1..e2669a838 100644
--- a/openbsc/src/libmgcp/mgcp_protocol.c
+++ b/openbsc/src/libmgcp/mgcp_protocol.c
@@ -967,6 +967,7 @@ static void mgcp_rtp_end_reset(struct mgcp_rtp_end *end)
}
end->packets = 0;
+ end->octets = 0;
memset(&end->addr, 0, sizeof(end->addr));
end->rtp_port = end->rtcp_port = 0;
end->payload_type = -1;