aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc/mgcp_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/include/openbsc/mgcp_internal.h')
-rw-r--r--openbsc/include/openbsc/mgcp_internal.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/mgcp_internal.h b/openbsc/include/openbsc/mgcp_internal.h
index a9d51494b..dc00112d3 100644
--- a/openbsc/include/openbsc/mgcp_internal.h
+++ b/openbsc/include/openbsc/mgcp_internal.h
@@ -23,8 +23,14 @@
#ifndef OPENBSC_MGCP_DATA_H
#define OPENBSC_MGCP_DATA_H
+#include <osmocom/core/msgb.h>
#include <osmocom/core/select.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+
+#include <stdint.h>
+
#define CI_UNUSED 0
enum mgcp_connection_mode {
@@ -53,6 +59,18 @@ struct mgcp_rtp_state {
int32_t timestamp_offset;
};
+/**
+ * I hold the state of the RTP compression.
+ */
+struct mgcp_rtp_compr_state {
+ uint32_t generated_ssrc;
+ uint32_t timestamp;
+ uint16_t sequence;
+
+ /* on wire it is 8bit, so we can see overruns here */
+ int16_t last_ts;
+};
+
struct mgcp_rtp_end {
/* statistics */
unsigned int packets;
@@ -122,6 +140,11 @@ struct mgcp_endpoint {
/* tap for the endpoint */
struct mgcp_rtp_tap taps[MGCP_TAP_COUNT];
+
+ /* compression for this endpoint */
+ int compr_enabled;
+ struct mgcp_rtp_compr_state compr_loc_state;
+ struct mgcp_rtp_compr_state compr_rem_state;
};
#define ENDPOINT_NUMBER(endp) abs(endp - endp->tcfg->endpoints)
@@ -150,5 +173,10 @@ static inline int endp_back_channel(int endpoint)
struct mgcp_trunk_config *mgcp_trunk_alloc(struct mgcp_config *cfg, int index);
struct mgcp_trunk_config *mgcp_trunk_num(struct mgcp_config *cfg, int index);
+int rtp_compress(struct mgcp_rtp_compr_state *state, struct msgb *msg,
+ int endpoint, struct llist_head *rtp_packets);
+struct llist_head rtp_decompress(struct mgcp_rtp_compr_state *state, void *ctx,
+ struct msgb *msg);
+
#endif