aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libiu
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-10-11 02:24:53 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-03-09 17:12:23 +0100
commit542cbe47255c32592eaf72f930fe7e576ec09149 (patch)
tree6632b0b994ef34557638e2afaa7e2e0cae03b431 /openbsc/src/libiu
parentcfd785c38a05895333a97d809d2d2bbd7a34effc (diff)
IuCS: rapidly release connections
Do the same as we do in 2G: release the connection as soon as nothing else is pending for a given subscriber. Before, osmo-msc would wait for the UE "to get bored" and send an Iu release. But the CN should stay lean on connections. Also, 25.413[1] in section 7, 6th point states: "While the Iu release is managed from the CN, the RNC has the capability to request the release of all Iu connection resources from the corresponding Iu connection." So far we did not manage Iu release from osmo-msc at all. Use the same mechanism we use in 2G: from msc_release_connection(), just before freeing the gsm_subscriber_conn, invoke a CN initiated Iu Release command to the UE. This works around OS#1816 ("USSD only works when IuCS is released", on nano3G), because the Iu conn is now released right after every signalling, so that typically no two requests will use the same conn. In iu.h/iu.c, add iu_tx_release(), absorbing almost all of the code from ranap_handle_co_iu_rel_req(). Add stub to db_test.c, necessary to build it without linking libiu. [1] 3GPP TS 25.413 v12.4.0 Release 12 / ETSI TS 125 413 V12.4.0 (2015-04) Related: OS#1816 Change-Id: Ic12bd6f3666f6fd42bd6d9fdae1c93abee3b6786
Diffstat (limited to 'openbsc/src/libiu')
-rw-r--r--openbsc/src/libiu/iu.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/openbsc/src/libiu/iu.c b/openbsc/src/libiu/iu.c
index 696527dca..2f208d02b 100644
--- a/openbsc/src/libiu/iu.c
+++ b/openbsc/src/libiu/iu.c
@@ -409,20 +409,35 @@ int iu_tx(struct msgb *msg_nas, uint8_t sapi)
return 0;
}
-static int ranap_handle_co_iu_rel_req(struct ue_conn_ctx *ctx, RANAP_Iu_ReleaseRequestIEs_t *ies)
+/* Send Iu Release for the given UE connection.
+ * If cause is NULL, the standard "No remaining RAB" cause is sent, otherwise
+ * the provided cause. */
+int iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause)
{
struct msgb *msg;
struct osmo_scu_prim *prim;
+ static const struct RANAP_Cause default_cause = {
+ .present = RANAP_Cause_PR_radioNetwork,
+ .choice.radioNetwork = RANAP_CauseRadioNetwork_no_remaining_rab,
+ };
- LOGP(DRANAP, LOGL_INFO, "Received Iu Release Request, Sending Release Command\n");
- msg = ranap_new_msg_iu_rel_cmd(&ies->cause);
+ if (!cause)
+ cause = &default_cause;
+
+ msg = ranap_new_msg_iu_rel_cmd(cause);
msg->l2h = msg->data;
prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim));
prim->u.data.conn_id = ctx->conn_id;
osmo_prim_init(&prim->oph, SCCP_SAP_USER,
OSMO_SCU_PRIM_N_DATA,
PRIM_OP_REQUEST, msg);
- osmo_sua_user_link_down(ctx->link, &prim->oph);
+ return osmo_sua_user_link_down(ctx->link, &prim->oph);
+}
+
+static int ranap_handle_co_iu_rel_req(struct ue_conn_ctx *ctx, RANAP_Iu_ReleaseRequestIEs_t *ies)
+{
+ LOGP(DRANAP, LOGL_INFO, "Received Iu Release Request, Sending Release Command\n");
+ iu_tx_release(ctx, &ies->cause);
return 0;
}