aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2017-06-08 12:21:07 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-06-18 01:49:29 +0200
commit2395f55300b3f76b090d3c870c998f6663ad6281 (patch)
tree7bb47907b63a2f70b41e8f45ec20fb7d488ede38
parent8559e411b45101faffe9a880a9f0839eb2ebb773 (diff)
mgcp: use mgcp DLCX command to terminate endpoint after call is done
Currently no DLCX command is sent to the mgcpgw when a call is over, this leaves the endpoint open. This means that the endpoint can not never be reused by other calls. This patch adds a DLCX that terminates the the endpoint when the call is done.
-rw-r--r--openbsc/include/openbsc/msc_ifaces.h1
-rw-r--r--openbsc/src/libmsc/gsm_04_08.c3
-rw-r--r--openbsc/src/libmsc/msc_ifaces.c14
3 files changed, 18 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/msc_ifaces.h b/openbsc/include/openbsc/msc_ifaces.h
index 942e1cebd..e278f9305 100644
--- a/openbsc/include/openbsc/msc_ifaces.h
+++ b/openbsc/include/openbsc/msc_ifaces.h
@@ -55,3 +55,4 @@ int msc_gsm0808_tx_cipher_mode(struct gsm_subscriber_connection *conn, int ciphe
int msc_tx_common_id(struct gsm_subscriber_connection *conn);
int msc_call_assignment(struct gsm_trans *trans);
int msc_call_bridge(struct gsm_trans *trans1, struct gsm_trans *trans2);
+void msc_call_release(struct gsm_trans *trans);
diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c
index c2919f7aa..4e7b0bb70 100644
--- a/openbsc/src/libmsc/gsm_04_08.c
+++ b/openbsc/src/libmsc/gsm_04_08.c
@@ -1333,6 +1333,9 @@ void _gsm48_cc_trans_free(struct gsm_trans *trans)
{
gsm48_stop_cc_timer(trans);
+ /* Make sure call also gets released on the mgcp side */
+ msc_call_release(trans);
+
/* send release to L4, if callref still exists */
if (trans->callref) {
/* Ressource unavailable */
diff --git a/openbsc/src/libmsc/msc_ifaces.c b/openbsc/src/libmsc/msc_ifaces.c
index 7162f5f12..0b0dfdcfd 100644
--- a/openbsc/src/libmsc/msc_ifaces.c
+++ b/openbsc/src/libmsc/msc_ifaces.c
@@ -328,3 +328,17 @@ int msc_call_bridge(struct gsm_trans *trans1, struct gsm_trans *trans2)
return 0;
}
+
+void msc_call_release(struct gsm_trans *trans)
+{
+ struct msgb *msg;
+ struct gsm_subscriber_connection *conn = trans->conn;
+ struct mgcpgw_client *mgcp = conn->network->mgcpgw.client;
+
+ msg = mgcp_msg_dlcx(mgcp, 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",
+ vlr_subscr_name(trans->vsub));
+}