aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2017-06-28 18:22:46 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-07-12 23:42:47 +0200
commit6d410dff91bb0ac29e1e06a3c4babba9f34ea18a (patch)
tree4ebe68c225da46332420dfa7f750aff8d6032762
parentbc7fabb8b92a4c05ffaaa3e6c7a34e3d8a985ac6 (diff)
mgcp: Fix missing call id in DLCX
The call id field in the DLCX message is missing. Use the endpoint id as call id in all CRCX and DLCX messages. Change-Id: I8b78b76126c63c4882e982c64c3953dbe1dab179
-rw-r--r--include/openbsc/mgcpgw_client.h3
-rw-r--r--src/libmgcp/mgcpgw_client.c9
-rw-r--r--src/libmsc/msc_ifaces.c11
3 files changed, 13 insertions, 10 deletions
diff --git a/include/openbsc/mgcpgw_client.h b/include/openbsc/mgcpgw_client.h
index 24b1fd6e..b1b5fd42 100644
--- a/include/openbsc/mgcpgw_client.h
+++ b/include/openbsc/mgcpgw_client.h
@@ -97,7 +97,8 @@ struct msgb *mgcp_msg_mdcx(struct mgcpgw_client *mgcp,
uint16_t rtp_endpoint, const char *rtp_conn_addr,
uint16_t rtp_port, enum mgcp_connection_mode mode);
-struct msgb *mgcp_msg_dlcx(struct mgcpgw_client *mgcp, uint16_t rtp_endpoint);
+struct msgb *mgcp_msg_dlcx(struct mgcpgw_client *mgcp, uint16_t rtp_endpoint,
+ unsigned int call_id);
void mgcpgw_client_vty_init(int node, struct mgcpgw_client_conf *conf);
int mgcpgw_client_config_write(struct vty *vty, const char *indent);
diff --git a/src/libmgcp/mgcpgw_client.c b/src/libmgcp/mgcpgw_client.c
index f21983ed..1910a9f3 100644
--- a/src/libmgcp/mgcpgw_client.c
+++ b/src/libmgcp/mgcpgw_client.c
@@ -606,12 +606,11 @@ struct msgb *mgcp_msg_mdcx(struct mgcpgw_client *mgcp,
rtp_port);
}
-struct msgb *mgcp_msg_dlcx(struct mgcpgw_client *mgcp, uint16_t rtp_endpoint)
+struct msgb *mgcp_msg_dlcx(struct mgcpgw_client *mgcp, uint16_t rtp_endpoint,
+ unsigned int call_id)
{
mgcp_trans_id_t trans_id = mgcpgw_client_next_trans_id(mgcp);
return mgcp_msg_from_str(trans_id,
- "DLCX %u %x@mgw MGCP 1.0\r\n"
- ,
- trans_id,
- rtp_endpoint);
+ "DLCX %u %x@mgw MGCP 1.0\r\n"
+ "C: %x\r\n", trans_id, rtp_endpoint, call_id);
}
diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c
index cdc724b5..8eb68822 100644
--- a/src/libmsc/msc_ifaces.c
+++ b/src/libmsc/msc_ifaces.c
@@ -219,7 +219,9 @@ static int conn_iu_rab_act_cs(struct gsm_trans *trans)
* endpoint in order to ensure that this endpoint is not occupied
* with some old connection that was not properly cleared during
* some crash or restart event */
- msg_dlcx = mgcp_msg_dlcx(mgcp, conn->iu.mgcp_rtp_endpoint);
+ msg_dlcx =
+ mgcp_msg_dlcx(mgcp, conn->iu.mgcp_rtp_endpoint,
+ conn->iu.mgcp_rtp_endpoint);
if (mgcpgw_client_tx(mgcp, msg_dlcx, NULL, NULL))
LOGP(DMGCP, LOGL_ERROR,
"Failed to send DLCX message for %s\n",
@@ -228,8 +230,8 @@ static int conn_iu_rab_act_cs(struct gsm_trans *trans)
/* Establish the RTP stream first as looping back to the originator.
* The MDCX will patch through to the counterpart. TODO: play a ring
* tone instead. */
- msg = mgcp_msg_crcx(mgcp, conn->iu.mgcp_rtp_endpoint, trans->callref,
- MGCP_CONN_LOOPBACK);
+ msg = mgcp_msg_crcx(mgcp, conn->iu.mgcp_rtp_endpoint,
+ conn->iu.mgcp_rtp_endpoint, MGCP_CONN_LOOPBACK);
return mgcpgw_client_tx(mgcp, msg, mgcp_response_rab_act_cs_crcx, trans);
}
#endif
@@ -355,7 +357,8 @@ void msc_call_release(struct gsm_trans *trans)
struct mgcpgw_client *mgcp = conn->network->mgcpgw.client;
/* Send DLCX */
- msg = mgcp_msg_dlcx(mgcp, conn->iu.mgcp_rtp_endpoint);
+ msg = mgcp_msg_dlcx(mgcp, conn->iu.mgcp_rtp_endpoint,
+ conn->iu.mgcp_rtp_endpoint);
if (mgcpgw_client_tx(mgcp, msg, NULL, NULL))
LOGP(DMGCP, LOGL_ERROR,
"Failed to send DLCX message for %s\n",