aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-05-10 16:52:08 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2019-05-14 11:36:29 +0200
commitc63f15a9a75d33602a4c96b1059056367f6751f6 (patch)
treeaaa6347d80664ea769c5c3ce413d17bd173326d3
parentca538fc5eb73f70fdfa828253767ce37666d91a2 (diff)
mgcp-cli: Parse X-Osmux on MDCX response
During MDCX state is already changed to ACTIVATING but we still want to send the local CID back to announce that we still use same local CID. Change-Id: If182a48743ebe03f97caf9034e49b9947014bdf9
-rw-r--r--src/libosmo-mgcp-client/mgcp_client_fsm.c6
-rw-r--r--src/libosmo-mgcp/mgcp_protocol.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/src/libosmo-mgcp-client/mgcp_client_fsm.c b/src/libosmo-mgcp-client/mgcp_client_fsm.c
index ab7af10b2..e83a11947 100644
--- a/src/libosmo-mgcp-client/mgcp_client_fsm.c
+++ b/src/libosmo-mgcp-client/mgcp_client_fsm.c
@@ -404,6 +404,12 @@ static void mgw_mdcx_resp_cb(struct mgcp_response *r, void *priv)
}
LOGPFSML(fi, LOGL_DEBUG, "MGW/MDCX: MGW responded with address %s:%u\n", r->audio_ip, r->audio_port);
+ if (r->head.x_osmo_osmux_use) {
+ LOGPFSML(fi, LOGL_DEBUG, "MGW/CRCX: MGW responded using Osmux %u\n", r->head.x_osmo_osmux_cid);
+ mgcp_ctx->conn_peer_remote.x_osmo_osmux_use = true;
+ mgcp_ctx->conn_peer_remote.x_osmo_osmux_cid = r->head.x_osmo_osmux_cid;
+ }
+
osmo_strlcpy(mgcp_ctx->conn_peer_remote.addr, r->audio_ip, sizeof(mgcp_ctx->conn_peer_remote.addr));
mgcp_ctx->conn_peer_remote.port = r->audio_port;
diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index 35141f848..555d6c644 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -323,7 +323,7 @@ static struct msgb *create_response_with_sdp(struct mgcp_endpoint *endp,
}
/* Attach optional OSMUX parameters */
- if (conn->osmux.state == OSMUX_STATE_NEGOTIATING) {
+ if (mgcp_conn_rtp_is_osmux(conn)) {
rc = msgb_printf(sdp, "X-Osmux: %u\r\n", conn->osmux.cid);
if (rc < 0)
goto error;