Skip to content
LibIms_Templates.ttcn 90.2 KiB
Newer Older
 *	@author 	STF 346, STF366, STF368, STF369
 *  @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;
rennoch's avatar
rennoch committed
	import from XSDAUX 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}}
		
	template SemicolonParam_List m_semicolonParams_isub (template charstring p_address):=
		{{"isub",p_address}}	
}

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

	template Path m_path (SipUrl p_sipUrl):=
	{
		fieldName := PATH_E,
		pathValues := {
					{nameAddr := {
					displayName := omit, 	 			// optional charstring
					addrSpec := p_sipUrl		// SipUrl
				  	},
					rrParam := omit}
			}
	}
	
	template Path m_path_TS :=
		{
			fieldName := PATH_E,
			pathValues := {
						{nameAddr := {
						displayName := omit, 	 			// optional charstring
						addrSpec := {
                        				scheme := "sip",
                        				userInfo := {userOrTelephoneSubscriber:="registrar"},
                        				hostPort := {PX_IMS_TS_PCSCF_HOME_DOMAIN, PX_IMS_TS_PCSCF_PORT},
                        				urlParameters := omit,
                        				headers := omit}},
						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 := {mw_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(template SemicolonParam_List p_chargeParams) :=
	{
		fieldName := P_CHARGING_VECTOR_E,
		chargeParams := p_chargeParams
	};
	
	template PChargingVector m_pChargingVector_icid_TS :=
	{
		fieldName := P_CHARGING_VECTOR_E,
		chargeParams := {{id:="icid-value",		paramValue :="012345"}}
	};
	
	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 m_pVisitedNetworkID_TS := 
    {
      fieldName := P_VISITED_NETWORK_E,
      vNetWorkSpec := {{vNetworkSpecToken := "Viseted ETSI 1",
         genericParams := omit}}
    }
	
	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,
Loading full blame...