path: root/openbsc/src
diff options
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-10-21 01:35:57 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-03-16 15:32:34 +0100
commit5f443298fea58d047f7f7b32e5bccad259e364b9 (patch)
treec173587c62c7b91a62ceddb03e63889871050576 /openbsc/src
parent1804823c92dcb34b100a89e95b7cc17476fb46d0 (diff)
mgcp: hack RAB success from nano3G: patch first RTP payload
The ip.access nano3G needs the first RTP payload's first two bytes to read hex 'e400', or it will reject the RAB assignment. Add flag patched_first_rtp_payload to mgcp_rtp_state to detect the first RTP payload on a stream, and overwrite its first bytes with e400. This should probably be configurable, but seems to not harm other femto cells (as long as we patch only the first RTP payload in each stream). Only do this when sending to the BTS side. Change-Id: If0887b0b7714fc204f2addab2d43d44bb283ba21
Diffstat (limited to 'openbsc/src')
1 files changed, 9 insertions, 0 deletions
diff --git a/openbsc/src/libmgcp/mgcp_network.c b/openbsc/src/libmgcp/mgcp_network.c
index 5686e5944..b64e25dd7 100644
--- a/openbsc/src/libmgcp/mgcp_network.c
+++ b/openbsc/src/libmgcp/mgcp_network.c
@@ -666,6 +666,14 @@ int mgcp_send(struct mgcp_endpoint *endp, int dest, int is_rtp,
forward_data(rtp_end->rtp.fd, &endp->taps[tap_idx],
buf, len);
+ if (tap_idx == MGCP_TAP_BTS_OUT
+ && !rtp_state->patched_first_rtp_payload) {
+ uint8_t *data = &buf[12];
+ osmo_hexparse("e400", data, 2);
+ rtp_state->patched_first_rtp_payload = true;
+ }
rc = mgcp_udp_send(rtp_end->rtp.fd,
rtp_end->rtp_port, buf, len);
@@ -685,6 +693,7 @@ int mgcp_send(struct mgcp_endpoint *endp, int dest, int is_rtp,
return mgcp_udp_send(rtp_end->rtcp.fd,
rtp_end->rtcp_port, buf, rc);