Skip to content
LibSip_Templates.ttcn 99.9 KiB
Newer Older
schmitting's avatar
schmitting committed
/*
 *  @author   STF 346, STF366, STF368, STF369
 *  @version  $Id$
 *	@desc     This module defines SIP Templates for message, header, and 
 *            structured types. <br>
 *            Note that any changes made to the definitions in this module
 *            may be overwritten by future releases of this library
 *            End users are encouraged to contact the distributers of this  
 *            module regarding their modifications or additions
 *  @remark   Any additions to the templates shall follow the design rules
 *            and always modify base templates only;
 *            Existing templates shall not be changed or removed -
 *            change requests shall be made to http://t-ort.etsi.org
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;
    import from LibSip_SMSTypes all;
	group ModuleParameters {
	
	    modulepar boolean MB_LENGTH_FROM_ENCVAL:=false; //* to get length of message body from ecoded value
	    modulepar boolean USE_FX_FOR_XML_LENGTH:=false; //* To use external functions for calculation of XML message/body length
	    
	}//* group ModuleParameters
	
	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(template GenericParam p_genericParam) :=
		  superset(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 ReasonValue m_ReasonValueSIP
			(template charstring p_cause, template charstring p_text) :=
		{		  
			token := "SIP",
			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
			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
			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
			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
			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
			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
			host := omit,	//*  hostname, IPv4 or IPv6 as a charstring
			portField := omit	//* p_userprofile.currPort	//* optional integer
		  },
		  urlParameters := omit,
		  headers := omit
		}
poglitsch's avatar
poglitsch committed
		
		template SipUrl mw_TelUrl :=
		{
    		scheme  := c_telScheme,
    		userInfo := *,
    		hostPort := ?,
    		urlParameters := *,
    		headers := *
		};
Loading
Loading full blame…