module Sanity_Templates { import from LibSip_SIPTypesAndValues all; group userInfoTemplates { template UserInfo m_userInfo(charstring p_userOrTelephoneSuscriber, template charstring p_password) := { userOrTelephoneSubscriber := p_userOrTelephoneSuscriber, password := p_password } } // end group userInfoTemplates group hostPortTemplates { template HostPort m_hostPort(charstring p_host, template integer p_port) := { host := p_host, portField := p_port } } // end group hostPortTemplates group sipUri { template SipUrl m_receiverSipUri(template SemicolonParam_List p_urlPareters) := { scheme := c_sipScheme & ":", userInfo := m_userInfo("receiver", omit), hostPort := m_hostPort("etsi.org", omit), urlParameters := p_urlPareters, headers := omit } template SipUrl m_senderSipUri(template SemicolonParam_List p_urlPareters) := { scheme := c_sipScheme & ":", userInfo := m_userInfo("sender", omit), hostPort := m_hostPort("etsi.org", omit), urlParameters := p_urlPareters, headers := omit } } // end group sipUri group startLineTemplates { template RequestLine m_requestLine(Method p_method, template SipUrl p_requestUri) := { method := p_method, requestUri := p_requestUri, sipVersion := c_sipNameVersion } } // end group startLineTemplates group callIdTemplates { template CallId m_callId(charstring p_callId) := { fieldName := CALL_ID_E, callid := p_callId } } // end group callIdTemplates group cSeqTemplates { template CSeq m_cSeq(charstring p_method) := { fieldName := CSEQ_E, seqNumber := 1, method := p_method } } // end group cSeqTemplates group genericParamTemplate { template GenericParam m_tag(charstring p_tagValue) := { id := c_tagId, paramValue := p_tagValue } template GenericParam m_branch(charstring p_branchValue) := { id := c_branchId, paramValue := p_branchValue } } // end group genericParamTemplates group fromTemplates { template From m_fromField(template SipUrl p_fromUri) := { fieldName := FROM_E, addressField := {addrSpecUnion := p_fromUri}, fromParams := omit } } // end group fromTemplates group toTemplates { template To m_toField(template SipUrl p_toUri) := { fieldName := TO_E, addressField := {addrSpecUnion := p_toUri}, toParams := omit } } // end group toTemplates group contactBodyTemplates { template ContactBody m_contactBody(template SipUrl p_contactUri) := { contactAddresses := { { addressField := { addrSpecUnion := p_contactUri}, contactParams := omit } } } } // end group contactBodyTemplates group contactTemplates { template Contact m_contact(template SipUrl p_contactUri) := { fieldName := CONTACT_E, contactBody := m_contactBody(p_contactUri) } } // end group contactTemplates group viaTemplates { template Via m_via(template ViaBody_List p_viaBodyList) := { fieldName := VIA_E, viaBody := p_viaBodyList } template ViaBody m_viaBody(template HostPort p_sentBy, template SemicolonParam_List p_viaParams) := { sentProtocol := m_sentProtocol, sentBy := p_sentBy, viaParams := p_viaParams } } // end group viaTemplates group sentProtocolTemplates { template SentProtocol m_sentProtocol := { protocolName := c_sipName, protocolVersion := c_sipVersion, transport := c_defaultSipProt } } // end group sentProtocolTemplates group msgHeaderTemplates { template MessageHeader m_minimalMsgHeader( charstring p_callId, charstring p_method, template SipUrl p_contactUri, template SipUrl p_fromUri, template SipUrl p_toUri, template ViaBody_List p_viaBodyList ) := { accept := omit, acceptContact := omit, acceptEncoding := omit, acceptLanguage := omit, alertInfo := omit, allow := omit, allowEvents := omit, // 3265/7.2 authenticationInfo := omit, // only in responses authorization := omit, // only in requests callId := m_callId(p_callId), callInfo := omit, contact := m_contact(p_contactUri), contentDisposition := omit, contentEncoding := omit, contentLanguage := omit, contentLength := omit, // optional in responses and all requests except ACK where mandatory contentType := omit, cSeq := m_cSeq(p_method), date := omit, errorInfo := omit, // only in responses event := omit, // 3265/7.2 expires := omit, fromField := m_fromField(p_fromUri), historyInfo := omit, // 4244 inReplyTo := omit, // only in requests maxForwards := c_maxForwards70, mimeVersion := omit, minExpires := omit, // only in responses minSE := omit, // 4028 organization := omit, pAccessNetworkInfo := omit, // 3455 pAssertedID := omit, // 3325 pAssertedService := omit, pAssociatedURI := omit, // 3455 path := omit, // 3327 pCalledPartyID := omit, // 3455 pChargingFunctionAddresses := omit, // 3455 pChargingVector := omit, // 3455 pEarlyMedia := omit, // 5009 pMediaAuthorization := omit, // 3313 pPreferredID := omit, // 3325 priority := omit, // only in requests privacy := omit, // 3323 proxyAuthenticate := omit, // only in responses proxyAuthorization := omit, // only in requests proxyRequire := omit, // only in requests pVisitedNetworkID := omit, // 3455 rAck := omit, // 3262/7.1 rSeq := omit, // 3262/7.1 reason := omit, // 3326 recordRoute := omit, referredBy := omit, // 3892 - REFER method referTo := omit, // 3515 - REFER method replyTo := omit, // optional in responses and INVITE requests require := omit, retryAfter := omit, // only in responses route := omit, // only in requests securityClient := omit, // 3329 securityServer := omit, // 3329 securityVerify := omit, // 3329 server := omit, // only in responses serviceRoute := omit, // 3608 sessionExpires := omit, // 4028 subject := omit, // only in requests subscriptionState := omit, // 3265/7.2 supported := omit, timestamp := omit, toField := m_toField(p_toUri), unsupported := omit, // only in responses userAgent := omit, via := m_via(p_viaBodyList), warning := omit, // only in responses wwwAuthenticate := omit, // only in responses undefinedHeader_List := omit } } // end group msgHeaderTemplates group requests { template INVITE_Request m_standardInviteRequest := { requestLine := m_requestLine(INVITE_E, m_receiverSipUri(omit)), msgHeader := m_minimalMsgHeader( "inviteCall", "INVITE", m_senderSipUri(omit), m_senderSipUri({m_tag("a-tag")}), m_receiverSipUri(omit), {m_viaBody( m_hostPort("etsi.org", c_defaultSipPort), {m_branch(c_brenchCookie)} )} ), messageBody := omit, payload := omit } template REGISTER_Request m_standardRegisterRequest := { requestLine := m_requestLine(REGISTER_E, m_senderSipUri(omit)), msgHeader := m_minimalMsgHeader( "registerCall", "REGISTER", m_senderSipUri(omit), m_senderSipUri({m_tag("a-tag")}), m_senderSipUri(omit), {m_viaBody( m_hostPort("etsi.org", c_defaultSipPort), {m_branch(c_brenchCookie)} )} ), messageBody := omit, payload := omit } } // end group requests } // end module Sanity_Templates