diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-03-16 16:14:34 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2017-08-27 03:52:45 +0200 |
commit | 0871a4c0874e86c7a9c33eb5cffd5f817c9a3d80 (patch) | |
tree | 8906476685294383df3de1bd373577c48b31c7a4 | |
parent | 0a25c1a1afc4c5493092198eeb4e1a0ee84e5f81 (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.
Related: OS#2459
Change-Id: I5eff04dcb0936e21690e427ae5e49228cd459bd4
-rw-r--r-- | include/openbsc/mgcp_internal.h | 1 | ||||
-rw-r--r-- | src/libmgcp/mgcp_network.c | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/include/openbsc/mgcp_internal.h b/include/openbsc/mgcp_internal.h index b58eb9b58..b2c24089d 100644 --- a/include/openbsc/mgcp_internal.h +++ b/include/openbsc/mgcp_internal.h @@ -64,6 +64,7 @@ struct mgcp_rtp_state { uint32_t stats_jitter; int32_t stats_transit; int stats_cycles; + bool patched_first_rtp_payload; /* FIXME: drop this, see OS#2459 */ }; struct mgcp_rtp_codec { diff --git a/src/libmgcp/mgcp_network.c b/src/libmgcp/mgcp_network.c index c9fe17973..399dc8fe1 100644 --- a/src/libmgcp/mgcp_network.c +++ b/src/libmgcp/mgcp_network.c @@ -667,6 +667,19 @@ int mgcp_send(struct mgcp_endpoint *endp, int dest, int is_rtp, forward_data(rtp_end->rtp.fd, &endp->taps[tap_idx], buf, len); + /* FIXME: HACK HACK HACK. See OS#2459. + * The ip.access nano3G needs the first RTP payload's first two bytes to read hex + * 'e400', or it will reject the RAB assignment. It seems to not harm other femto + * cells (as long as we patch only the first RTP payload in each stream). + */ + if (tap_idx == MGCP_TAP_BTS_OUT + && !rtp_state->patched_first_rtp_payload) { + uint8_t *data = (uint8_t*)&buf[12]; + data[0] = 0xe4; + data[1] = 0x00; + rtp_state->patched_first_rtp_payload = true; + } + rc = mgcp_udp_send(rtp_end->rtp.fd, &rtp_end->addr, rtp_end->rtp_port, buf, len); |