paging: Send SGsAP-SERVICE-ABORT-REQUEST on paging timeout

When pagig for a CS-Call via SGs times out, the MME expects to be
informed about this via an SGsAP-SERVICE-ABORT-REQUEST, make sure this
message is sent, but only for CS-Fallback calls.

Change-Id: I3f8f153afe24cf2efa245713509bdc8488902877
Depends: osmo-ttcn3-hacks I99950a17ccf26aaa0eebded5480f33be4c57586a
Related: OS#3614
diff --git a/src/libmsc/sgs_iface.c b/src/libmsc/sgs_iface.c
index a4527f4..5ccded7 100644
--- a/src/libmsc/sgs_iface.c
+++ b/src/libmsc/sgs_iface.c
@@ -1256,6 +1256,28 @@
 	sgs_tx(mme->conn, msg_sgs);
 }
 
+/*! Send SGsAP-SERVICE-ABORT-REQUEST message to MME
+ *  \param[in] vsub subscriber context */
+void sgs_iface_tx_serv_abrt(struct vlr_subscr *vsub)
+{
+	struct msgb *msg_sgs;
+	struct sgs_mme_ctx *mme;
+
+	OSMO_ASSERT(vsub);
+
+	/* The service abort procedure is only defined for MT calls,
+	 * see also 3GPP TS 29.118, chapter 5.13.2 */
+	if (vsub->sgs.paging_serv_ind != SGSAP_SERV_IND_CS_CALL)
+		return;
+
+	mme = sgs_mme_ctx_by_vsub(vsub, SGSAP_MSGT_DL_UD);
+	if (!mme)
+		return;
+
+	msg_sgs = gsm29118_create_service_abort_req(vsub->imsi);
+	sgs_tx(mme->conn, msg_sgs);
+}
+
 /*! initalize SGs new interface
  *  \param[in] ctx talloc context
  *  \param[in] network associated gsm network