aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-03-13 14:24:52 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2014-06-05 12:19:46 +0200
commita0d64ce063fbf60733c6f2949015091aa33a2c9d (patch)
tree418bb62907a3c135017865d6cae592b535b3175a /openbsc/include
parentb492d39177f6df893772ee6c7c37f51caa9f0d64 (diff)
mgcp: Add callbacks for payload processing
This patch adds the callbacks rtp_processing_cb and setup_rtp_processing_cb to mgcp_config to support arbitrary RTP payload processing. Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/include')
-rw-r--r--openbsc/include/openbsc/mgcp.h10
-rw-r--r--openbsc/include/openbsc/mgcp_internal.h9
2 files changed, 19 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h
index 939e7eed1..34eb42955 100644
--- a/openbsc/include/openbsc/mgcp.h
+++ b/openbsc/include/openbsc/mgcp.h
@@ -65,6 +65,7 @@ static inline int rtp_calculate_port(int multiplex, int base)
struct mgcp_endpoint;
struct mgcp_config;
struct mgcp_trunk_config;
+struct mgcp_rtp_end;
#define MGCP_ENDP_CRCX 1
#define MGCP_ENDP_DLCX 2
@@ -86,6 +87,11 @@ typedef int (*mgcp_policy)(struct mgcp_trunk_config *cfg, int endpoint, int stat
typedef int (*mgcp_reset)(struct mgcp_trunk_config *cfg);
typedef int (*mgcp_rqnt)(struct mgcp_endpoint *endp, char tone);
+typedef int (*mgcp_processing)(struct mgcp_rtp_end *dst_end,
+ char *data, int *len, int buf_size);
+typedef int (*mgcp_processing_setup)(struct mgcp_endpoint *endp,
+ struct mgcp_rtp_end *dst_end,
+ struct mgcp_rtp_end *src_end);
#define PORT_ALLOC_STATIC 0
#define PORT_ALLOC_DYNAMIC 1
@@ -156,6 +162,10 @@ struct mgcp_config {
struct in_addr transcoder_in;
int transcoder_remote_base;
+ /* RTP processing */
+ mgcp_processing rtp_processing_cb;
+ mgcp_processing_setup setup_rtp_processing_cb;
+
struct osmo_wqueue gw_fd;
struct mgcp_port_range bts_ports;
diff --git a/openbsc/include/openbsc/mgcp_internal.h b/openbsc/include/openbsc/mgcp_internal.h
index 52bf55843..d2818139e 100644
--- a/openbsc/include/openbsc/mgcp_internal.h
+++ b/openbsc/include/openbsc/mgcp_internal.h
@@ -90,6 +90,7 @@ struct mgcp_rtp_end {
/* RTP patching */
int force_constant_ssrc; /* -1: always, 0: don't, 1: once */
int force_aligned_timing;
+ void *rtp_process_data;
/*
* Each end has a socket...
@@ -205,6 +206,14 @@ 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 *);
+/* payload processing default functions */
+int mgcp_rtp_processing_default(struct mgcp_rtp_end *dst_end,
+ char *data, int *len, int buf_size);
+
+int mgcp_setup_rtp_processing_default(struct mgcp_endpoint *endp,
+ struct mgcp_rtp_end *dst_end,
+ struct mgcp_rtp_end *src_end);
+
enum {
MGCP_DEST_NET = 0,
MGCP_DEST_BTS,