mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-10-23 08:12:01 +00:00
mgcp: Send the jitter statistics at the end of the call
This commit is contained in:
@@ -155,6 +155,7 @@ struct mgcp_trunk_config *mgcp_trunk_num(struct mgcp_config *cfg, int index);
|
||||
|
||||
void mgcp_state_calc_loss(struct mgcp_rtp_state *s, struct mgcp_rtp_end *,
|
||||
uint32_t *expected, int *loss);
|
||||
uint32_t mgcp_state_calc_jitter(struct mgcp_rtp_state *);
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -677,3 +677,10 @@ void mgcp_state_calc_loss(struct mgcp_rtp_state *state,
|
||||
*loss = INT_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t mgcp_state_calc_jitter(struct mgcp_rtp_state *state)
|
||||
{
|
||||
if (!state->initialized)
|
||||
return 0;
|
||||
return state->jitter >> 4;
|
||||
}
|
||||
|
@@ -1121,14 +1121,15 @@ int mgcp_reset_transcoder(struct mgcp_config *cfg)
|
||||
|
||||
void mgcp_format_stats(struct mgcp_endpoint *endp, char *msg, size_t size)
|
||||
{
|
||||
uint32_t expected;
|
||||
uint32_t expected, jitter;
|
||||
int ploss;
|
||||
mgcp_state_calc_loss(&endp->net_state, &endp->net_end,
|
||||
&expected, &ploss);
|
||||
jitter = mgcp_state_calc_jitter(&endp->net_state);
|
||||
|
||||
snprintf(msg, size, "\r\nP: PS=%u, OS=%u, PR=%u, OR=%u, PL=%d",
|
||||
snprintf(msg, size, "\r\nP: PS=%u, OS=%u, PR=%u, OR=%u, PL=%d, JI=%d",
|
||||
endp->bts_end.packets, endp->bts_end.octets,
|
||||
endp->net_end.packets, endp->net_end.octets,
|
||||
ploss);
|
||||
ploss, jitter);
|
||||
msg[size - 1] = '\0';
|
||||
}
|
||||
|
@@ -72,7 +72,7 @@
|
||||
"C: 2\r\n"
|
||||
|
||||
#define DLCX_RET "250 7 OK\r\n" \
|
||||
"P: PS=0, OS=0, PR=0, OR=0, PL=0\r\n"
|
||||
"P: PS=0, OS=0, PR=0, OR=0, PL=0, JI=0\r\n"
|
||||
|
||||
|
||||
struct mgcp_test {
|
||||
|
Reference in New Issue
Block a user