aboutsummaryrefslogtreecommitdiffstats
path: root/src/libosmo-mgcp-client/mgcp_client_fsm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libosmo-mgcp-client/mgcp_client_fsm.c')
-rw-r--r--src/libosmo-mgcp-client/mgcp_client_fsm.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libosmo-mgcp-client/mgcp_client_fsm.c b/src/libosmo-mgcp-client/mgcp_client_fsm.c
index da900c529..7c4e08189 100644
--- a/src/libosmo-mgcp-client/mgcp_client_fsm.c
+++ b/src/libosmo-mgcp-client/mgcp_client_fsm.c
@@ -134,6 +134,13 @@ static void add_audio(struct mgcp_msg *mgcp_msg, struct mgcp_conn_peer *info)
mgcp_msg->conn_mode = MGCP_CONN_RECV_SEND;
}
+static void set_conn_mode(struct mgcp_msg *mgcp_msg, struct mgcp_conn_peer *peer)
+{
+ enum mgcp_connection_mode conn_mode = peer->conn_mode;
+ if (conn_mode != MGCP_CONN_NONE)
+ mgcp_msg->conn_mode = conn_mode;
+}
+
static struct msgb *make_mdcx_msg(struct mgcp_ctx *mgcp_ctx)
{
struct mgcp_msg mgcp_msg;
@@ -155,6 +162,8 @@ static struct msgb *make_mdcx_msg(struct mgcp_ctx *mgcp_ctx)
memcpy(mgcp_msg.codecs, mgcp_ctx->conn_peer_local.codecs, sizeof(mgcp_msg.codecs));
memcpy(mgcp_msg.ptmap, mgcp_ctx->conn_peer_local.ptmap, sizeof(mgcp_msg.ptmap));
+ set_conn_mode(&mgcp_msg, &mgcp_ctx->conn_peer_local);
+
/* Note: We take the endpoint and the call_id from the remote
* connection info, because we can be confident that the
* information there is valid. For the local info, we explicitly
@@ -199,6 +208,8 @@ static void fsm_crcx_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data)
make_crcx_msg(&mgcp_msg, &mgcp_ctx->conn_peer_local);
if (mgcp_ctx->conn_peer_local.port)
add_audio(&mgcp_msg, &mgcp_ctx->conn_peer_local);
+ set_conn_mode(&mgcp_msg, &mgcp_ctx->conn_peer_local);
+
msg = mgcp_msg_gen(mgcp_ctx->mgcp, &mgcp_msg);
OSMO_ASSERT(msg);