mgcp: Remember the initial sequence number of the stream

This information is required for calculating the packet loss at the
end of a phone call.
This commit is contained in:
Holger Hans Peter Freyther 2012-09-12 22:59:54 +02:00
parent 952f752ffa
commit 2e8e659586
2 changed files with 2 additions and 0 deletions

View File

@ -46,6 +46,7 @@ struct mgcp_rtp_state {
uint32_t orig_ssrc;
uint32_t ssrc;
int first_seq_no;
uint16_t seq_no;
int seq_offset;
uint32_t last_timestamp;

View File

@ -120,6 +120,7 @@ static void patch_and_count(struct mgcp_endpoint *endp, struct mgcp_rtp_state *s
timestamp = ntohl(rtp_hdr->timestamp);
if (!state->initialized) {
state->first_seq_no = seq;
state->seq_no = seq - 1;
state->ssrc = state->orig_ssrc = rtp_hdr->ssrc;
state->initialized = 1;