diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-09-12 11:38:37 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-11-12 10:42:05 +0100 |
commit | 952f752ffa848cfac4beba5ab641cb1cd81753b2 (patch) | |
tree | 7be3b8acb2523a0e751ad994a372be0996895987 /openbsc/src/libmgcp | |
parent | 2a60a11c48e8677fc6c75174a5a0d4db1da97d0a (diff) |
mgcp: Count the received octets as of the MGCP specification
Count the received octets. This is encouraged by the MGCP specification.
Use a 32bit counter that is good enough for more than 12 hours of a EFR
call. This limit is good enough for the current configuration.
Diffstat (limited to 'openbsc/src/libmgcp')
-rw-r--r-- | openbsc/src/libmgcp/mgcp_network.c | 2 | ||||
-rw-r--r-- | openbsc/src/libmgcp/mgcp_protocol.c | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/openbsc/src/libmgcp/mgcp_network.c b/openbsc/src/libmgcp/mgcp_network.c index b15d6f711..214226481 100644 --- a/openbsc/src/libmgcp/mgcp_network.c +++ b/openbsc/src/libmgcp/mgcp_network.c @@ -296,6 +296,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) @@ -374,6 +375,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 ac7dea19a..719a4c743 100644 --- a/openbsc/src/libmgcp/mgcp_protocol.c +++ b/openbsc/src/libmgcp/mgcp_protocol.c @@ -897,6 +897,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; |