From 485138706dec1172dc04277085740b1edeb5fa8a Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 27 Dec 2017 18:42:27 +0100 Subject: MGCP: Force-send a DLCX to all connections of before any new CRCX There are some situations in which osmo-bsc releases a call without sending a DLCX to the media gateway. The 'laforge/fsm' has a more proper solution to the problem, this is an interim hack which just sends an unsolicited DLCX before the CRCX. Change-Id: I1a78721d3d0a2f4a99cfddade2d06732f0388c30 --- src/osmo-bsc/osmo_bsc_mgcp.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/osmo-bsc/osmo_bsc_mgcp.c b/src/osmo-bsc/osmo_bsc_mgcp.c index 8ea6415da..936443970 100644 --- a/src/osmo-bsc/osmo_bsc_mgcp.c +++ b/src/osmo-bsc/osmo_bsc_mgcp.c @@ -166,6 +166,24 @@ static void fsm_crcx_bts_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data LOGPFSML(fi, LOGL_DEBUG, "CRCX/BTS: creating connection for the BTS side on MGW endpoint:0x%x...\n", rtp_endpoint); + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_DLCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT), + }; + if (snprintf(mgcp_msg.endpoint, MGCP_ENDPOINT_MAXLEN, MGCP_ENDPOINT_FORMAT, rtp_endpoint) >= + MGCP_ENDPOINT_MAXLEN) { + handle_error(mgcp_ctx, MGCP_ERR_NOMEM); + return; + } + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + mgcp_ctx->mgw_pending_trans = mgcp_msg_trans_id(msg); + rc = mgcp_client_tx(mgcp, msg, NULL, NULL); + + /* Generate MGCP message string */ mgcp_msg = (struct mgcp_msg) { .verb = MGCP_VERB_CRCX, -- cgit v1.2.3