aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc/mgcp_internal.h
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2013-11-25 12:53:28 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-11-25 18:07:21 +0100
commit50079a18434836fc6193f7d8ee30aeda6adbf872 (patch)
treecf5244f6d4f3873b00fd5c2b677236f0e377abc8 /openbsc/include/openbsc/mgcp_internal.h
parentec37bb29563c92bf405b732019db4ed3b2cc9477 (diff)
mgcp/rtp: Add counter for invalid RTP timestamp deltas
This patch modifies the patch_and_count() function to check for RTP timestamp inconsistencies. It basically checks, whether dTS/dSeqNo remains constant. If this fails, the corresponding counter is incremented. There are four counter for this: Incoming and outgoing, each for streams from the BTS and the net. Note that this approach presumes, that the per RTP packet duration (in samples) remains the same throughout the entire stream. Changing the number of speech frames per channel and packet will be detected as error. In addition, the VTY command 'show mgcp' is extended by an optional 'stats' to show the counter values, too. Ticket: OW#964 Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/include/openbsc/mgcp_internal.h')
-rw-r--r--openbsc/include/openbsc/mgcp_internal.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/openbsc/include/openbsc/mgcp_internal.h b/openbsc/include/openbsc/mgcp_internal.h
index d5bd3ddc6..8b6a56be8 100644
--- a/openbsc/include/openbsc/mgcp_internal.h
+++ b/openbsc/include/openbsc/mgcp_internal.h
@@ -40,22 +40,30 @@ enum mgcp_trunk_type {
MGCP_TRUNK_E1,
};
+struct mgcp_rtp_stream_state {
+ uint32_t ssrc;
+ uint16_t last_seq;
+ uint32_t last_timestamp;
+ uint32_t err_ts_counter;
+ int32_t last_tsdelta;
+};
+
struct mgcp_rtp_state {
int initialized;
int patch;
uint32_t orig_ssrc;
- uint32_t ssrc;
uint16_t base_seq;
- uint16_t max_seq;
int seq_offset;
int cycles;
- uint32_t last_timestamp;
int32_t timestamp_offset;
uint32_t jitter;
int32_t transit;
+
+ struct mgcp_rtp_stream_state in_stream;
+ struct mgcp_rtp_stream_state out_stream;
};
struct mgcp_rtp_end {