mgcp: Remove the lost_no from the mgcp statistics
The RFC 3435 specifies a different formula for calculating the lost packages. It involves the number of received packages and the delta of the sequence number.
This commit is contained in:
parent
de1674ab02
commit
2a60a11c48
|
@ -47,7 +47,6 @@ struct mgcp_rtp_state {
|
||||||
uint32_t orig_ssrc;
|
uint32_t orig_ssrc;
|
||||||
uint32_t ssrc;
|
uint32_t ssrc;
|
||||||
uint16_t seq_no;
|
uint16_t seq_no;
|
||||||
int lost_no;
|
|
||||||
int seq_offset;
|
int seq_offset;
|
||||||
uint32_t last_timestamp;
|
uint32_t last_timestamp;
|
||||||
int32_t timestamp_offset;
|
int32_t timestamp_offset;
|
||||||
|
|
|
@ -145,11 +145,7 @@ static void patch_and_count(struct mgcp_endpoint *endp, struct mgcp_rtp_state *s
|
||||||
rtp_hdr->timestamp = htonl(timestamp);
|
rtp_hdr->timestamp = htonl(timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* seq changed, now compare if we have lost something */
|
|
||||||
if (state->seq_no + 1u != seq)
|
|
||||||
state->lost_no = abs(seq - (state->seq_no + 1));
|
|
||||||
state->seq_no = seq;
|
state->seq_no = seq;
|
||||||
|
|
||||||
state->last_timestamp = timestamp;
|
state->last_timestamp = timestamp;
|
||||||
|
|
||||||
if (payload < 0)
|
if (payload < 0)
|
||||||
|
|
|
@ -128,13 +128,12 @@ static void dump_trunk(struct vty *vty, struct mgcp_trunk_config *cfg)
|
||||||
struct mgcp_endpoint *endp = &cfg->endpoints[i];
|
struct mgcp_endpoint *endp = &cfg->endpoints[i];
|
||||||
vty_out(vty,
|
vty_out(vty,
|
||||||
" Endpoint 0x%.2x: CI: %d net: %u/%u bts: %u/%u on %s "
|
" Endpoint 0x%.2x: CI: %d net: %u/%u bts: %u/%u on %s "
|
||||||
"traffic received bts: %u/%u remote: %u/%u transcoder: %u/%u%s",
|
"traffic received bts: %u remote: %u transcoder: %u/%u%s",
|
||||||
i, endp->ci,
|
i, endp->ci,
|
||||||
ntohs(endp->net_end.rtp_port), ntohs(endp->net_end.rtcp_port),
|
ntohs(endp->net_end.rtp_port), ntohs(endp->net_end.rtcp_port),
|
||||||
ntohs(endp->bts_end.rtp_port), ntohs(endp->bts_end.rtcp_port),
|
ntohs(endp->bts_end.rtp_port), ntohs(endp->bts_end.rtcp_port),
|
||||||
inet_ntoa(endp->bts_end.addr),
|
inet_ntoa(endp->bts_end.addr),
|
||||||
endp->bts_end.packets, endp->bts_state.lost_no,
|
endp->bts_end.packets, endp->net_end.packets,
|
||||||
endp->net_end.packets, endp->net_state.lost_no,
|
|
||||||
endp->trans_net.packets, endp->trans_bts.packets,
|
endp->trans_net.packets, endp->trans_bts.packets,
|
||||||
VTY_NEWLINE);
|
VTY_NEWLINE);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue