aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc/mgcp_internal.h
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@gnumonks.org>2014-02-05 18:56:17 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-05-22 14:39:16 +0200
commitcab6e7528c475d6aee687001a6146e5f20d8f53d (patch)
tree5d172538444f1b503ff3d2a7a09da5c139ad815f /openbsc/include/openbsc/mgcp_internal.h
parent038f97a69fe58d2bcb6cabcb82b3485f7d622ed2 (diff)
mgcp: add voice muxer support
This patch adds the voice muxer. You can use this to batch RTP traffic to reduce bandwidth comsuption. Basically, osmux transforms RTP flows to a compact batch format, that is later on decompacted to its original form. Port UDP/1984 is used for the muxer traffic between osmo-bsc_nat and osmo-bsc_mgcp (in the BSC side). This feature depends on libosmo-netif, which contains the osmux core support. Osmux is requested on-demand via the MGCP CRCX/MDCX messages (using the vendor-specific extension X-Osmux: on) coming from the BSC-NAT, so you can selectively enable osmux per BSC from one the bsc-nat.cfg file, so we have a centralized point to enable/disable osmux. First thing you need to do is to accept requests to use Osmux, this can be done from VTY interface of osmo-bsc_nat and osmo-bsc_mgcp by adding the following line: mgcp ... osmux on osmux batch-factor 4 This just initializes the osmux engine. You still have to specify what BSC uses osmux from osmo-bsc_nat configuration file: ... bsc 1 osmux on bsc 2 ... bsc 3 osmux on In this case, bsc 1 and 3 should use osmux if possible, bsc 2 does not have osmux enabled. Thus, you can selectively enable osmux depending on the BSC, and we have a centralized point for configuration from the bsc-nat to enable osmux on demand, as suggested by Holger. At this moment, this patch contains heavy debug logging for each RTP packet that can be removed later to save cycles. The RTP ssrc/seqnum/timestamp is randomly allocated for each MDCX that is received to configure an endpoint.
Diffstat (limited to 'openbsc/include/openbsc/mgcp_internal.h')
-rw-r--r--openbsc/include/openbsc/mgcp_internal.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/mgcp_internal.h b/openbsc/include/openbsc/mgcp_internal.h
index 9b9716539..8fe9f8182 100644
--- a/openbsc/include/openbsc/mgcp_internal.h
+++ b/openbsc/include/openbsc/mgcp_internal.h
@@ -126,8 +126,12 @@ struct mgcp_lco {
enum mgcp_type {
MGCP_RTP_DEFAULT = 0,
MGCP_RTP_TRANSCODED,
+ MGCP_OSMUX_BSC,
+ MGCP_OSMUX_BSC_NAT,
};
+#include <openbsc/osmux.h>
+
struct mgcp_endpoint {
int allocated;
uint32_t ci;
@@ -163,6 +167,11 @@ struct mgcp_endpoint {
/* tap for the endpoint */
struct mgcp_rtp_tap taps[MGCP_TAP_COUNT];
+
+ /* osmux is enabled/disabled */
+ int osmux;
+ /* osmux internal to unbatch messages for this endpoint */
+ struct osmux_out_handle osmux_out;
};
#define ENDPOINT_NUMBER(endp) abs(endp - endp->tcfg->endpoints)
@@ -197,5 +206,11 @@ 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 *);
+enum {
+ MGCP_DEST_NET = 0,
+ MGCP_DEST_BTS,
+};
+
+#define MGCP_DUMMY_LOAD 0x23
#endif