Skip to content
LibIms_Templates.ttcn 92.6 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 SipUrl m_SipUrl_currIpaddr_CSCF(in SipUserProfile p_userprofile) :=  	//*  SIP-URL of the test system on SIP side
	{
			scheme := c_sipScheme,  		//*  contains "sip"
			userInfo := omit,		//*  optional
			hostPort :=
			{
		host := p_userprofile.currIpaddr,	//*  hostname, IPv4 or IPv6 as a charstring
		portField := p_userprofile.currPort	//* optional integer
			},
			urlParameters := omit,
			headers := omit
	} 
	
	template SemicolonParam_List mw_semicolonParams_realm (template charstring p_realm)	:=
	/*?;*/ 
	superset({"realm",p_realm},{"nonce",?},{"algorithm","AKAv1-MD5"},{"ik",?},{"ck",?}) ;//Working with TTWorkbench// 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 (template 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 := c_sipScheme,
                        				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 (template 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:=c_icid,		paramValue :=c_icid_value}}
	template PChargingVector m_pChargingVector_origIoi_fixedValue(charstring p_homeDomain) :=
	{
		fieldName := P_CHARGING_VECTOR_E,
		chargeParams := {{id:=c_icid,			paramValue :=c_icid_value &";"},
						 {id:=c_icid_generated_at,	paramValue :="192.1.1.10;"},
						 {id:=c_orig_ioi,			paramValue := p_homeDomain}}
	template PChargingVector m_pChargingVector_termIoi_fixedValue(charstring p_homeDomain) :=
	{
		fieldName := P_CHARGING_VECTOR_E,
		chargeParams := {{id:=c_icid,			paramValue :=c_icid_value&";"},
							{id:=c_icid_generated_at,	paramValue :="192.1.1.10;"},
							{id:=c_term_ioi,			paramValue := p_homeDomain}}
	};
	
	template PChargingVector m_pChargingVector_origIoi_fixedValue1(charstring p_homeDomain) :=
	{
		fieldName := P_CHARGING_VECTOR_E,
		chargeParams := {
						 {id:=c_icid_generated_at,	paramValue :="192.1.1.10;"},
						 {id:=c_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 :=
Loading full blame...