SCCP_Templates: Allow templates as Called/CallingPartyAddress in UDT

Change-Id: I8d9f782ed3f4e6363f5370deb73bd2694b4c5d6a
diff --git a/library/SCCP_Templates.ttcn b/library/SCCP_Templates.ttcn
index 9936dd0..55bf745 100644
--- a/library/SCCP_Templates.ttcn
+++ b/library/SCCP_Templates.ttcn
@@ -113,6 +113,15 @@
 	}
 }
 
+private function tr_Addr(template SCCP_PAR_Address addr := *)
+return template (present) SCCP_param_CPartyAddressEnc {
+	if (istemplatekind(addr, "?")) {
+		return ?;
+	} else {
+		return ConvertASPAddressToEncodedAddress_itu(valueof(addr));
+	}
+}
+
 template (value) PDU_SCCP ts_SCCP_UDT(SCCP_PAR_Address calling, SCCP_PAR_Address called,
 				      template (value) octetstring data,
 				      template (value) BIT4 msg_hdl := '0000'B) := {
@@ -131,7 +140,7 @@
 	}
 }
 
-template PDU_SCCP tr_SCCP_UDT(SCCP_PAR_Address calling, SCCP_PAR_Address called,
+template PDU_SCCP tr_SCCP_UDT(template (present) SCCP_PAR_Address calling, template (present) SCCP_PAR_Address called,
 			      template octetstring data := ?,
 			      template BIT4 msg_hdl := '0000'B) := {
 	unitdata := {
@@ -140,8 +149,8 @@
 		pointer1 := ?,
 		pointer2 := ?,
 		pointer3 := ?,
-		calledPAddress := ConvertASPAddressToEncodedAddress_itu(called),
-		callingPAddress := ConvertASPAddressToEncodedAddress_itu(calling),
+		calledPAddress := tr_Addr(called),
+		callingPAddress := tr_Addr(calling),
 		data := {
 			paramLength := ?,
 			data := data