msc: MME emulation should send TAI during SGs LU for CSFB support

3GPP TS 23.272 sec 4.3.3:
"During the SGs location update procedure, obtaining the last used LTE
PLMN ID via TAI in SGsAP-LOCATION-UPDATE-REQUEST as specified in TS
29.118".

Related: SYS#5337
Change-Id: I7057a7c41794d62f7cbc412da3e805c1f0c69511
diff --git a/library/SGsAP_Templates.ttcn b/library/SGsAP_Templates.ttcn
index 4414dd1..21fff9e 100644
--- a/library/SGsAP_Templates.ttcn
+++ b/library/SGsAP_Templates.ttcn
@@ -13,6 +13,7 @@
 import from SGsAP_Types all;
 import from GSM_Types all;
 import from General_Types all;
+import from Osmocom_Types all;
 import from MobileL3_CommonIE_Types all;
 
 /* 9.4.2 */
@@ -162,6 +163,29 @@
 	}
 }
 
+/* 9.4.21a */
+template (value) TrackingAreaIdentityValue ts_SGsAP_TAI(GsmMcc mcc, GsmMnc mnc, uint16_t tac) := {
+	mccDigit1 := mcc[0],
+	mccDigit2 := mcc[1],
+	mccDigit3 := mcc[2],
+	mncDigit3 := f_enc_mnc_digit3(mnc),
+	mncDigit1 := mnc[0],
+	mncDigit2 := mnc[1],
+	tAC := int2oct(tac, 2)
+}
+template (value) TrackingAreaIdentity ts_SGsAP_IE_TAI(template (value) TrackingAreaIdentityValue tai) := {
+	iEI := '00100011'B,
+	lengthIndicator := 5,
+	iD := tai
+}
+function ts_SGsAP_IE_TAI_omit(template (omit) TrackingAreaIdentityValue tai)
+return template (omit) TrackingAreaIdentity {
+	if (istemplatekind(tai, "omit")) {
+		return omit;
+	} else {
+		return ts_SGsAP_IE_TAI(tai);
+	}
+}
 
 
 /* 9.4.12 */
@@ -505,7 +529,8 @@
 template (value) PDU_SGsAP ts_SGsAP_LU_REQ(hexstring imsi,
 					   template (value) octetstring mme_name,
 					   template (value) EPS_location_update_type eps_lu_type,
-					   template (value) LocationAreaIdValue new_lai) := {
+					   template (value) LocationAreaIdValue new_lai,
+					   template (omit) TrackingAreaIdentityValue tAI := omit) := {
 	sGsAP_LOCATION_UPDATE_REQUEST := {
 		messageType := '00001001'B,
 		iMSI := ts_SGsAP_IMSI(imsi),
@@ -515,7 +540,7 @@
 		oldLocationAreaId := omit,
 		tMSI_Status := omit,
 		iMEI_SV := omit,
-		tAI := omit,
+		tAI := ts_SGsAP_IE_TAI_omit(tAI),
 		eCGI := omit,
 		tMSI_NRI := omit,
 		cS_DomainOperator := omit