Skip to content
LibSip_Templates.ttcn 71.2 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 LibSip_Templates
{
	//LibSip
	import from LibSip_SIPTypesAndValues all;
	import from LibSip_SDPTypes all;
	import from LibSip_Interface all;
	import from LibSip_PIXITS all;
	import from LibSip_XMLTypes all;
	

	group SubFields
	{

		template Addr_Union m_AddrUnion_NameAddr(template NameAddr p_nameAddr) :=
		{
		  nameAddr := p_nameAddr
		}

		template Addr_Union m_AddrUnion_DisplayAndSipUrl(template charstring p_displayName, template SipUrl p_addrSpec) :=
		{
		  nameAddr := m_CallingAddr(p_displayName, p_addrSpec)
		}
		
		template NameAddr m_CallingAddr(template charstring p_displayName, template SipUrl p_addrSpec) :=
		{
		  displayName := p_displayName,
		  addrSpec := p_addrSpec
		}		

		template CommaParam_List mw_digestResponse(in GenericParam p_genericParam) :=
		{
		  *,p_genericParam,* // c_Integrity_protected_yes
		}	

		template SemicolonParam_List m_cpc :=
		{{"cpc",PX_SIP_ISUP_CPC_VALUE}};

		template SemicolonParam_List m_ReasonParams
			(template charstring p_cause, template charstring p_text) :=
		{m_Cause(p_cause),m_Text(p_text)};
				
		template ReasonValue m_ReasonValue
			(template charstring p_cause, template charstring p_text) :=
		{		  
			token := "Q.850",
			reasonParams := m_ReasonParams(p_cause,p_text)
		};

		template RouteBody mw_routeBody (template SipUrl p_sipurl):=
		{
			nameAddr :=
			{
				displayName := *,
				addrSpec := p_sipurl
			},
			rrParam := *
		}

		template SentProtocol m_SentProtocol (charstring p_protocol) :=
		{protocolName := c_sipName,
		  protocolVersion:= c_sipVersion,
		  transport:= p_protocol};

		template SipUrl m_SipUrl_currDomain(in SipUserProfile p_userprofile) :=  	// SIP-URL of the test system on SIP side
		{
		  scheme := c_sipScheme,  		// contains "sip"
		  userInfo := 			// optional
		  {
			userOrTelephoneSubscriber := p_userprofile.publUsername,// charstring
			password := omit		// optional charstring
		  },
		  hostPort :=
		  {
			host := p_userprofile.homeDomain,	// hostname, IPv4 or IPv6 as a charstring
			portField := omit	//p_userprofile.currPort	//optional integer
		  },
		  urlParameters := omit,
		  headers := omit
		}

		template SipUrl m_SipUrl_contactIpaddr(in SipUserProfile p_userprofile) :=  	// SIP-URL of the test system on SIP side
		{
		  scheme := c_sipScheme,  		// contains "sip"
		  userInfo := 			// optional
		  {
			userOrTelephoneSubscriber := p_userprofile.publUsername,// charstring
			password := omit		// optional charstring
		  },
		  hostPort :=
		  {
			host := p_userprofile.contactIpaddr,	// hostname, IPv4 or IPv6 as a charstring
			portField := p_userprofile.contactPort	//optional integer
		  },
		  urlParameters := omit,
		  headers := omit
		}

		template SipUrl m_SipUrl_contactIpaddrAndCpc(in SipUserProfile p_userprofile) :=  	// SIP-URL of the test system on SIP side
		{
				scheme := c_sipScheme,  		// contains "sip"
				userInfo := 			// optional
				{
			userOrTelephoneSubscriber := p_userprofile.publUsername & "; cpc=" & PX_SIP_ISUP_CPC_VALUE,// charstring
			password := omit		// optional charstring
				},
				hostPort :=
				{
			host := p_userprofile.contactIpaddr,	// hostname, IPv4 or IPv6 as a charstring
			portField := p_userprofile.contactPort	//optional integer
				},
				urlParameters := omit,
				headers := omit
		}

		template SipUrl m_SipUrl_currIpaddr(in SipUserProfile p_userprofile) :=  	// SIP-URL of the test system on SIP side
		{
		  scheme := c_sipScheme,  		// contains "sip"
		  userInfo := 			// optional
		  {
			userOrTelephoneSubscriber := p_userprofile.publUsername,// charstring
			password := omit		// optional charstring
		  },
		  hostPort :=
		  {
			host := p_userprofile.currIpaddr,	// hostname, IPv4 or IPv6 as a charstring
			portField := p_userprofile.currPort	//optional integer
		  },
		  urlParameters := omit,
		  headers := omit
		} 
   
		template SipUrl m_SipUrl_Anonymous :=  	// SIP-URL with a calles party number
		{
		  scheme := c_sipScheme,  		// contains "sip"
		  userInfo := 			// optional
		  {
			userOrTelephoneSubscriber := "Anonymous",// charstring
			password := omit		// optional charstring
		  },
		  hostPort :=
		  {
			host := "Anonymous.invalid",	// hostname, IPv4 or IPv6 as a charstring
			portField := omit	//optional integer
		  },
		  urlParameters := omit,
		  headers := omit
		};
		
		template SipUrl m_TelUrl_publUser(in SipUserProfile p_userprofile) :=  	// SIP-URL of the test system on SIP side
		{
		  scheme := c_telScheme,  		// contains "tel"
		  userInfo := 			// optional
		  {
			userOrTelephoneSubscriber := p_userprofile.publUsername,// charstring
			password := omit		// optional charstring
		  },
		  hostPort :=
		  {
			host := omit,	// hostname, IPv4 or IPv6 as a charstring
			portField := omit	//p_userprofile.currPort	//optional integer
		  },
		  urlParameters := omit,
		  headers := omit
		}

	
		template SipUrl mw_TelSip_unavailableInvalidUri :=
		{
				scheme  := (c_telScheme,c_sipScheme),
				userInfo := {userOrTelephoneSubscriber:="unavailable", password:=omit},
				hostPort := {host:="anonymous.invalid", portField:=c_defaultSipPort},
				urlParameters := omit,
				headers := omit
		};		

	
		template SipUrl mw_TelSip_unavailableUri (charstring p_host):=
		{
				scheme  := (c_telScheme,c_sipScheme),
				userInfo := {userOrTelephoneSubscriber:="unavailable", password:=omit},
				hostPort := {host:=p_host, portField:=c_defaultSipPort},
				urlParameters := omit,
				headers := omit
		};		

		template SipUrl mw_SipUrl_Number(charstring p_number) :=  	// SIP-URL with a calling party number
		{
		  scheme := c_sipScheme,  		// contains "sip"
		  userInfo:= {userOrTelephoneSubscriber:=p_number, password:=*},
		  hostPort := ?,
		  urlParameters := *,
		  headers := *
		};
Loading
Loading full blame…