aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2017-08-11 18:32:22 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2017-08-27 03:52:47 +0200
commita13c07e71fc36e00f5b5359a33ab15b5da129de0 (patch)
tree226b7f2d8fd885f66501bcf6ff10b6e08c8ef3a7 /src
parent04fc75f85661c7b03214831e832695a1959bb901 (diff)
mgcp: Fix uplink activation of Osmux stream
Commit 575420637981828b64c1292ada015d7170b89390 introduced OSMUX_STATE_NEGOTIATING to fix a race condition present in osmo-bsc_nat. However, after this change osmo-bsc_mgcp cannot switch to OSMUX_STATE_ACTIVATING anymore, which means during osmux_send_dummy time it won't call osmux_enable_endpoint(), which in turn won't set endp type to MGCP_OSMUX_BSC. If MGCP_OSMUX_BSC is not set, uplink streams are sent using regular RTP instead of Osmux not matter it is enabled in config or not. Change-Id: Ibcb59aa1ca25408f82cc88c2d5b81177b5f276dc
Diffstat (limited to 'src')
-rw-r--r--src/libmgcp/mgcp_protocol.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libmgcp/mgcp_protocol.c b/src/libmgcp/mgcp_protocol.c
index 78e41f193..96542c5a0 100644
--- a/src/libmgcp/mgcp_protocol.c
+++ b/src/libmgcp/mgcp_protocol.c
@@ -277,10 +277,12 @@ static struct msgb *create_response_with_sdp(struct mgcp_endpoint *endp,
if (!addr)
addr = mgcp_net_src_addr(endp);
- if (endp->osmux.state == OSMUX_STATE_NEGOTIATING)
+ if (endp->osmux.state == OSMUX_STATE_NEGOTIATING) {
sprintf(osmux_extension, "\nX-Osmux: %u", endp->osmux.cid);
- else
+ endp->osmux.state = OSMUX_STATE_ACTIVATING;
+ } else {
osmux_extension[0] = '\0';
+ }
len = snprintf(sdp_record, sizeof(sdp_record),
"I: %u%s\n\n", endp->ci, osmux_extension);