Skip to content
LibIms_Templates.ttcn 68.5 KiB
Newer Older
/*
 *	@author 	STF 346
 *  @version    $Id$
 *	@desc		This module provides the types used by the test component 
 *              for SIP-IMS tests. Module become from STF306 and STF334-336
 */

module LibIms_Templates
{	
	//LibCommon
	import from LibCommon_DataStrings all;
	
	//LibSip
	import from LibSip_SIPTypesAndValues all;
	import from LibSip_SDPTypes all;
	import from LibSip_Templates all;
	import from LibSip_Steps all;
	import from LibSip_PIXITS all;
	import from LibSip_XMLTypes all;
	
	//LibIms
	import from LibIms_SIPTypesAndValues all;
	
	import from LibIms_PIXITS all;
	
	template charstring m_international_number_format := pattern  "\\+\d+";//pattern  "\+\d+";

	template NameAddr mw_SipUrl_SUTinterface(charstring p_host, integer p_port) := 
		{
			displayName := *,
			addrSpec := {
				scheme := "sip:",
				userInfo := *,
				hostPort := {p_host, p_port},
				urlParameters := *,
				headers := *
			}
		}
		
	template Addr_Union mw_UE1_Addr_display := {nameAddr:={displayName:=PX_IMS_SUT_UE1_DISPLAY,addrSpec:=?}};
	
group Subfields{
	
	template SemicolonParam_List mw_semicolonParams_realm (template charstring p_realm)	:=
		?; //superset({"realm",p_realm},{"rand",?},{"autn",?},{"algorithm","AKAv1-MD5"},{"ik",?},{"ck",?}) // ERROR HERE! Superset operation must contain value list - no templates!
		
	template SemicolonParam_List m_semicolonParams_language (template charstring p_language):=
		{{"language",p_language}}
	
	template SemicolonParam_List mw_semicolonParams_language (template charstring p_language):=
		{{"language",p_language}}
}

group HeaderFieldTemplates{
	
	template MinSE m_minSE(DeltaSec p_ds):=
	{
			fieldName := MIN_SE_E,
			deltaSec:=p_ds,
			minSeParam:=omit
	}
	
	template PathValue m_pathvalue (SipUrl p_sipUrl):=
	{
	nameAddr := {displayName := omit, 	 			// optional charstring
				 addrSpec := p_sipUrl		// SipUrl
				},
	rrParam := omit
	}

	template Path m_path (SipUrl p_sipUrl):=
	{
		fieldName := PATH_E,
		pathValues := {
					{nameAddr := {
					displayName := omit, 	 			// optional charstring
					addrSpec := p_sipUrl		// SipUrl
				  	},
					rrParam := omit}
			}
	}

/*
 * @desc Path header field expectation with at least one path value
 * @param p_sipUrl value of the last element in the list of path values
 */	
	template Path mw_path (SipUrl p_sipUrl):=
	{
		fieldName := PATH_E,
		pathValues := {*,m_pathvalue(p_sipUrl)}		// any number of SipUrl may occur before p_sipUrl
	}
	
	template PAccessNetworkInfo m_pAccessNetworkInfo_IEEE_11a :=
	{
		fieldName := P_ACCESS_NETWORK_INFO_E,
		accessType := "IEEE-802.11a",
		genericParams := {{id:="extension-access-info",paramValue :="192.1.1.20"}}
	};
		
	template PAssertedService m_pAssertedService (PAssertedServiceValue p_pAssertedServiceValue):=
	{
		fieldName := P_ASSERTED_SERVICE_E,
		pAssertedServiceValue := p_pAssertedServiceValue
	};
		
	template PChargingFunctionAddresses m_pChargingFunctionAddresses_fixedValue :=
	{
		fieldName := P_CHARGING_FUNCTION_ADDRESSES_E,
		chargeAddrParams := {{id:="ccf",paramValue :="192.1.1.1"}, // value is fixed because it is deleted on proxy 
							 {id:="ecf",paramValue :="192.1.1.2"}} // value is fixed because it is deleted on proxy
	};

	
	template PChargingVector m_pChargingVector_fixedValue(charstring p_homeDomain) :=
	{
		fieldName := P_CHARGING_VECTOR_E,
		chargeParams := {{id:="icid-value",			paramValue :="123abc"},
						 {id:="icid-generated-at",	paramValue :="192.1.1.10"},
						 {id:="orig-ioi",			paramValue := p_homeDomain}}
	};
	template PChargingVector m_pChargingVector_fixedValue1(charstring p_homeDomain) :=
	{
		fieldName := P_CHARGING_VECTOR_E,
		chargeParams := {
						 {id:="icid-generated-at",	paramValue :="192.1.1.10"},
						 {id:="orig-ioi",			paramValue := p_homeDomain}}
	};
	
	template PChargingVector mw_pChargingVector(template charstring p_id, template charstring p_paramValue) :=
	{
		fieldName := P_CHARGING_VECTOR_E,
		chargeParams := superset({id := valueof(p_id), paramValue := p_paramValue})
	};

	template PMediaAuthorization m_pMediaAuthorization_fixedValue :=
	{
		fieldName := P_MEDIA_AUTHORIZATION_E,
		pMediaAuthorizations := {"A"} // example
	};


	template PEarlyMedia m_pEarlyMedia_sup := 
		{fieldName := P_EARLY_MEDIA_E, em_param := {"supported"}};
		
	
	template ProxyRequire m_proxyRequire_secAgree :=
	{
		fieldName := PROXY_REQUIRE_E,
		optionsTags := {"sec-agree"}
	};
	
	template PVisitedNetworkID mw_pVisitedNetworkID := 
	{
	  fieldName := P_VISITED_NETWORK_E,
	  vNetWorkSpec := {{vNetworkSpecToken := PX_IMS_SUT_PCSCF_VisitedNetworkID,
						genericParams := *}}
	}

	template RecordRoute m_recordRoute_notmatching:=
	{   
		fieldName := RECORD_ROUTE_E,
		routeBody :=
		{{
			nameAddr :=
			{
				displayName := omit,
				addrSpec :=
				{
					scheme := c_sipScheme,  			// contains "sip"
					userInfo := {userOrTelephoneSubscriber := "unknown", password := omit},
					hostPort :=
					{
						host := "unknown.domain.name",	// hostname, IPv4 or IPv6 as a charstring
						portField := omit
					},
					urlParameters := omit,
					headers := omit
				}
			},
			rrParam := omit
		} }
	};
	
	template Require m_require_secAgree :=
	{
		fieldName := REQUIRE_E,
		optionsTags := {"sec-agree"}
	};
	
	template Require mw_require_path :=
	{
		fieldName := REQUIRE_E,
		optionsTags := superset("path")
	};

	template Route m_route_interface (in ImsInterfaceProfile p_interfaceprofile):=
	{   
		fieldName := ROUTE_E,
		routeBody := {{nameAddr := {displayName := omit, 
								   addrSpec := 	{scheme := c_sipScheme,  			// contains "sip"
Loading full blame...