LibSip_Templates.ttcn 196 KB
Newer Older
/**
garciay's avatar
garciay committed
 * @author STF 346, STF366, STF368, STF369, STF450, STF471
 * @version $Id$
tepelmann's avatar
tepelmann committed
 * @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.
 *     This module is part of LibSipV3. 
tepelmann's avatar
tepelmann committed
 * @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
garciay's avatar
garciay committed
module LibSip_Templates {
tepelmann's avatar
tepelmann committed
    // LibSip
garciay's avatar
garciay committed
    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_SimpleMsgSummaryTypes all;
garciay's avatar
garciay committed
    import from LibSip_MessageBodyTypes all;
    import from LibSip_Common all;
schmitting's avatar
schmitting committed
    import from NoTargetNamespace language "XSD" all
    with {
garciay's avatar
garciay committed
        extension "File:../xsd/Ims3gpp.xsd";
schmitting's avatar
schmitting committed
    }
schmitting's avatar
schmitting committed
    import from urn_ietf_params_xml_ns_conference_info language "XSD" all
    with {
garciay's avatar
garciay committed
        extension "File:../xsd/CONF.xsd";
schmitting's avatar
schmitting committed
    }
schmitting's avatar
schmitting committed
    import from http_uri_etsi_org_ngn_params_xml_simservs_pstn language "XSD" all
    with {
garciay's avatar
garciay committed
        extension "File:../xsd/PSTN.xsd";
schmitting's avatar
schmitting committed
    }
schmitting's avatar
schmitting committed
    import from http_uri_etsi_org_ngn_params_xml_simservs_xcap language "XSD" all
    with {
garciay's avatar
garciay committed
        extension "File:../xsd/SupplementaryServices.xsd";
schmitting's avatar
schmitting committed
    }
schmitting's avatar
schmitting committed
    import from http_uri_etsi_org_ngn_params_xml_simservs_mcid language "XSD" all
    with {
garciay's avatar
garciay committed
        extension "File:../xsd/MCID.xsd";
schmitting's avatar
schmitting committed
    }
schmitting's avatar
schmitting committed
    import from urn_ietf_params_xml_ns_resource_lists language "XSD" all
    with {
garciay's avatar
garciay committed
        extension "File:../xsd/ResourceList.xsd";
schmitting's avatar
schmitting committed
    }
    import from http_uri_etsi_org_ngn_params_xml_comm_div_info language "XSD" all
    with {
garciay's avatar
garciay committed
        extension "File:../xsd/CDIVN.xsd";
    }

    import from urn_3gpp_ns_cw_1_0 language "XSD" all
garciay's avatar
garciay committed
    with {
        extension "File:../xsd/cw.xsd";
garciay's avatar
garciay committed
    group SubFields {

tepelmann's avatar
tepelmann committed
        template(value) Addr_Union m_AddrUnion_NameAddr(template(value) NameAddr p_nameAddr) := {nameAddr := p_nameAddr}
garciay's avatar
garciay committed

        template(value) Addr_Union m_AddrUnion_DisplayAndSipUrl(
            template(value) DisplayName p_displayName,
tepelmann's avatar
tepelmann committed
            template(value) SipUrl p_addrSpec
        ) := {
garciay's avatar
garciay committed
            nameAddr := m_CallingAddr(p_displayName, p_addrSpec)
        }

        template(value) NameAddr m_NameAddr(
            template(omit) DisplayName p_displayName := omit,
tepelmann's avatar
tepelmann committed
            template(value) SipUrl p_addrSpec
        ) := {
            displayName := p_displayName,
            addrSpec := p_addrSpec
garciay's avatar
garciay committed
        }

        template(value) NameAddr m_CallingAddr(
            template(value) DisplayName p_displayName,
tepelmann's avatar
tepelmann committed
            template(value) SipUrl p_addrSpec
        ) := m_NameAddr(p_displayName, p_addrSpec);
garciay's avatar
garciay committed

        template(present) NameAddr mw_NameAddr(
            template DisplayName p_displayName,
            template(present) SipUrl p_addrSpec := ?
tepelmann's avatar
tepelmann committed
        ) := {
            displayName := p_displayName,
            addrSpec := p_addrSpec
        template(present) CommaParam_List mw_digestResponse(
            template(present) GenericParam p_genericParam := ?
        ) := superset(p_genericParam);
        
tepelmann's avatar
tepelmann committed
        //*     c_Integrity_protected_yes
        /**
         * @desc send template for parameter list with CPC set to a specific value
         * @param p_ISUP_CPC_value CPC parameter value
         *             former PX_SIP_ISUP_CPC_VALUE
         */
        template(value) SemicolonParam_List m_cpc(
            template(value) charstring p_ISUP_CPC_value := "prison"
        ) := {
garciay's avatar
garciay committed
            {
tepelmann's avatar
tepelmann committed
                "cpc",
                {tokenOrHost := p_ISUP_CPC_value}
tepelmann's avatar
tepelmann committed
            }
garciay's avatar
garciay committed
        }
garciay's avatar
garciay committed
        template(value) SemicolonParam_List m_ReasonParams(
            template(omit) GenValue p_cause := omit,
            template(value) GenValue p_text
tepelmann's avatar
tepelmann committed
        ) := {
garciay's avatar
garciay committed
            m_Cause(p_cause), m_Text(p_text)
        }

        template(present) SemicolonParam_List mw_ReasonParams(
            template GenValue p_cause,
            template GenValue p_text
tepelmann's avatar
tepelmann committed
        ) := {
garciay's avatar
garciay committed
            mw_Cause_base(p_cause), mw_Text(p_text)
        }

        template(value) ReasonValue m_ReasonValue_Base := {
tepelmann's avatar
tepelmann committed
            token := "",
garciay's avatar
garciay committed
            reasonParams := omit
        }
tepelmann's avatar
tepelmann committed

garciay's avatar
garciay committed
        template(present) ReasonValue mw_ReasonValue_Base := {
tepelmann's avatar
tepelmann committed
            token := ?,
garciay's avatar
garciay committed
            reasonParams := *
        }
tepelmann's avatar
tepelmann committed

garciay's avatar
garciay committed
        template(value) ReasonValue m_ReasonValue_param(
            template(value) GenValue p_cause,
            template(value) GenValue p_text
garciay's avatar
garciay committed
        ) modifies m_ReasonValue_Base := {
            reasonParams := m_ReasonParams(p_cause, p_text)
tepelmann's avatar
tepelmann committed

garciay's avatar
garciay committed
        template(present) ReasonValue mw_ReasonValue_param(
            template GenValue p_cause,
            template GenValue p_text
garciay's avatar
garciay committed
        ) modifies mw_ReasonValue_Base := {
            reasonParams := mw_ReasonParams(p_cause, p_text)
tepelmann's avatar
tepelmann committed

garciay's avatar
garciay committed
        template(value) ReasonValue m_ReasonValue(
            template(value) GenValue p_cause,
            template(value) GenValue p_text
garciay's avatar
garciay committed
        ) modifies m_ReasonValue_param := {
            token := "Q.850"
tepelmann's avatar
tepelmann committed

garciay's avatar
garciay committed
        template(present) ReasonValue mw_ReasonValue(
            template GenValue p_cause,
            template GenValue p_text
garciay's avatar
garciay committed
        ) modifies mw_ReasonValue_param := {
            token := "Q.850"
        }
tepelmann's avatar
tepelmann committed

garciay's avatar
garciay committed
        template(value) ReasonValue m_ReasonValueSIP(
            template(value) GenValue p_cause,
            template(value) GenValue p_text
garciay's avatar
garciay committed
        ) modifies m_ReasonValue_param := {
            token := "SIP"
        }
tepelmann's avatar
tepelmann committed

garciay's avatar
garciay committed
        template(present) ReasonValue mw_ReasonValueSIP(
            template GenValue p_cause,
            template GenValue p_text
garciay's avatar
garciay committed
        ) modifies mw_ReasonValue_param := {
            token := "SIP"
        }

        template(present) RouteBody mw_routeBody(
            template(present) SipUrl p_sipurl := ?
        ) := {
tepelmann's avatar
tepelmann committed
            nameAddr := mw_NameAddr(*, p_sipurl),
garciay's avatar
garciay committed
            rrParam := *
        }

        template(value) SentProtocol m_SentProtocol(
            template(value) charstring p_protocol
        ) := {
tepelmann's avatar
tepelmann committed
            protocolName := c_sipName,
            protocolVersion := c_sipVersion,
garciay's avatar
garciay committed
            transport := p_protocol
        }

tepelmann's avatar
tepelmann committed
        template(value) SipUrl m_BasicSipUrl := {
tepelmann's avatar
tepelmann committed
            scheme := (c_sipScheme),
garciay's avatar
garciay committed
            components := {
                sip := {
                    userInfo := {
tepelmann's avatar
tepelmann committed
                        userOrTelephoneSubscriber := "",  //*     charstring
                        password :=
                            omit //*     optional charstring
garciay's avatar
garciay committed
                    hostPort := {
tepelmann's avatar
tepelmann committed
                        host := omit,  //*     hostname, IPv4 or IPv6 as a charstring
                        portField :=
                            omit //*     p_userprofile.currPort - optional integer
garciay's avatar
garciay committed
                    }
tepelmann's avatar
tepelmann committed
            urlParameters := omit,
garciay's avatar
garciay committed
            headers := omit
garciay's avatar
garciay committed

        template(value) SipUrl m_SipUrl_currDomain_Base(
            template(value) SipUserProfile p_userprofile
        ) modifies m_BasicSipUrl := {
            components := {
                sip := {
                    userInfo := {
                        userOrTelephoneSubscriber := p_userprofile.publUsername
                    }
                }
            }
        }
tepelmann's avatar
tepelmann committed

        template(value) SipUrl m_SipUrl_currDomain(
            template(value) SipUserProfile p_userprofile
        ) modifies m_SipUrl_currDomain_Base := {
garciay's avatar
garciay committed
            components := {
                sip := {
                    hostPort := {
                        host :=
tepelmann's avatar
tepelmann committed
                            p_userprofile
                            .homeDomain //*     hostname, IPv4 or IPv6 as a charstring
        template(value) SipUrl m_SipUrl_contactIpaddr(
            template(value) SipUserProfile p_userprofile
        ) modifies m_SipUrl_currDomain_Base := {
garciay's avatar
garciay committed
            components := {
                sip := {
                    hostPort := {
garciay's avatar
garciay committed
                        host := p_userprofile.contactIpaddr,  //*     hostname, IPv4 or IPv6 as a charstring
tepelmann's avatar
tepelmann committed
                        portField :=
                            p_userprofile
                            .contactPort //*     optional integer
        /**
         * @desc send template with SIP userinfo
         * @param p_userprofile SIP user profile values
         * @param p_ISUP_CPC_value CPC parameter value
         *             former PX_SIP_ISUP_CPC_VALUE
         */
        template(value) SipUrl m_SipUrl_contactIpaddrAndCpc(
            template(value) SipUserProfile p_userprofile,
            template(value) charstring p_ISUP_CPC_value := "prison"
        ) modifies m_SipUrl_contactIpaddr := {
garciay's avatar
garciay committed
            components := {
                sip := {
                    userInfo := {
                        userOrTelephoneSubscriber :=
tepelmann's avatar
tepelmann committed
                            p_userprofile.publUsername & "; cpc=" &
                            p_ISUP_CPC_value
        template(value) SipUrl m_SipUrl_currIpaddr(
            template(value) SipUserProfile p_userprofile
        ) modifies m_SipUrl_currDomain_Base := {
garciay's avatar
garciay committed
            components := {
                sip := {
                    hostPort := {
garciay's avatar
garciay committed
                        host := p_userprofile.currIpaddr,  //*     hostname, IPv4 or IPv6 as a charstring
tepelmann's avatar
tepelmann committed
                        portField :=
                            p_userprofile
                            .currPort //*     optional integer
garciay's avatar
garciay committed
        template(value) SipUrl m_SipUrl_Anonymous modifies m_BasicSipUrl := {
garciay's avatar
garciay committed
            components := {
                sip := {
                    userInfo := {
tepelmann's avatar
tepelmann committed
                        userOrTelephoneSubscriber :=
                            "Anonymous" //*     charstring
garciay's avatar
garciay committed
                    },
                    hostPort := {
tepelmann's avatar
tepelmann committed
                        host :=
                            "Anonymous.invalid" //*     hostname, IPv4 or IPv6 as a charstring
garciay's avatar
garciay committed
                    }
                }
            }
        }

        template(value) SipUrl m_SipUrl_NumberHostHeader(
tepelmann's avatar
tepelmann committed
            template(value) charstring p_number,
            template(value) charstring p_host,
            template(omit) AmpersandParam_List p_urlParameters := omit
garciay's avatar
garciay committed
        ) modifies m_BasicSipUrl := {
            components := {
                sip := {
tepelmann's avatar
tepelmann committed
                    userInfo := {userOrTelephoneSubscriber := p_number},
                    hostPort := {host := p_host}
garciay's avatar
garciay committed
            urlParameters := p_urlParameters
        }

        template(value) SipUrl m_SipUrl_NumberHostParam(
tepelmann's avatar
tepelmann committed
            template(value) charstring p_number,
            template(value) charstring p_host,
            template(omit) AmpersandParam_List p_urlParameters := omit
garciay's avatar
garciay committed
        ) modifies m_SipUrl_NumberHostHeader := {
tepelmann's avatar
tepelmann committed
            components := {sip := {hostPort := {portField := c_defaultSipPort}}}
garciay's avatar
garciay committed
        template(value) SipUrl m_SipUrl_NumberHostParam_woPort(
tepelmann's avatar
tepelmann committed
            template(value) charstring p_number,
            template(value) charstring p_host,
            template(omit) AmpersandParam_List p_urlParameters := omit 
garciay's avatar
garciay committed
        ) modifies m_SipUrl_NumberHostParam := {
tepelmann's avatar
tepelmann committed
            components := {sip := {hostPort := {portField := omit}}}
garciay's avatar
garciay committed
        }

        template(present) SipUrl m_BasicTelUrl := {
tepelmann's avatar
tepelmann committed
            scheme := (c_telScheme),
            components := {tel := {subscriber := ""}},
            urlParameters := omit,
garciay's avatar
garciay committed
            headers := omit
        }

        template(value) SipUrl m_TelUrl_publUser(
            template(value) SipUserProfile p_userprofile
        ) modifies m_BasicTelUrl := {
garciay's avatar
garciay committed
            components := {
garciay's avatar
garciay committed
                tel := {
                    subscriber :=
tepelmann's avatar
tepelmann committed
                        p_userprofile
                        .publUsername //*     charstring
garciay's avatar
garciay committed
                }
            }
garciay's avatar
garciay committed
        template(present) SipUrl mw_TelUrl := {
tepelmann's avatar
tepelmann committed
            scheme := c_telScheme,
            components := {tel := {subscriber := ?}},
            urlParameters := *,
garciay's avatar
garciay committed
            headers := *
garciay's avatar
garciay committed
        template(present) SipUrl mw_SipUrl := {
tepelmann's avatar
tepelmann committed
            scheme := c_sipScheme,
garciay's avatar
garciay committed
            components := {
                sip := {
garciay's avatar
garciay committed
                    userInfo := {
tepelmann's avatar
tepelmann committed
                        userOrTelephoneSubscriber := ?,
garciay's avatar
garciay committed
                        password := *
                    },
                    hostPort := {
tepelmann's avatar
tepelmann committed
                        host := *,
garciay's avatar
garciay committed
                        portField := *
                    }
garciay's avatar
garciay committed
                }
garciay's avatar
garciay committed
            },
tepelmann's avatar
tepelmann committed
            urlParameters := *,
garciay's avatar
garciay committed
            headers := *
garciay's avatar
garciay committed

        template(present) SipUrl mw_TelSip_unavailableInvalidUri := (mw_TelSip_unavailableInvalidUri1, mw_TelSip_unavailableInvalidUri2);

garciay's avatar
garciay committed
        template(present) SipUrl mw_TelSip_unavailableInvalidUri1 modifies mw_SipUrl := {
garciay's avatar
garciay committed
            components := {
                sip := {
                    userInfo := {
nikolajev's avatar
nikolajev committed
                        userOrTelephoneSubscriber := "unavailable"
garciay's avatar
garciay committed
                    },
                    hostPort := {
tepelmann's avatar
tepelmann committed
                        host := "anonymous.invalid",
garciay's avatar
garciay committed
                        portField := c_defaultSipPort
                    }
                }
nikolajev's avatar
nikolajev committed
            }
garciay's avatar
garciay committed
        }
garciay's avatar
garciay committed
        template(present) SipUrl mw_TelSip_unavailableInvalidUri2 modifies mw_TelUrl := {
nikolajev's avatar
nikolajev committed
            components := {tel := {subscriber := "unavailable"}}
pintar's avatar
pintar committed

        template(present) SipUrl mw_TelSip_unavailableUri(
            template(value) charstring p_host
        ) := (mw_TelSip_unavailableUri1, mw_TelSip_unavailableUri2(p_host));
        template(present) SipUrl mw_TelSip_unavailableUri1 modifies mw_TelUrl := {
nikolajev's avatar
nikolajev committed
            components := {tel := {subscriber := "unavailable"}}
garciay's avatar
garciay committed
        }
tepelmann's avatar
tepelmann committed

        template(present) SipUrl mw_TelSip_unavailableUri2(
            template(value) charstring p_host
        ) modifies mw_SipUrl := {
garciay's avatar
garciay committed
            components := {
                sip := {
                    userInfo := {
nikolajev's avatar
nikolajev committed
                        userOrTelephoneSubscriber := "unavailable"
tepelmann's avatar
tepelmann committed
                    },
garciay's avatar
garciay committed
                    hostPort := {
tepelmann's avatar
tepelmann committed
                        host := p_host,
garciay's avatar
garciay committed
                        portField := c_defaultSipPort
garciay's avatar
garciay committed
                    }
                }
nikolajev's avatar
nikolajev committed
            }
        template(present) SipUrl mw_SipUrl_Number(
            template(present) charstring p_number := ?
        ) modifies mw_SipUrl := {
garciay's avatar
garciay committed
            components := {
                sip := {
tepelmann's avatar
tepelmann committed
                    userInfo := {userOrTelephoneSubscriber := p_number},
garciay's avatar
garciay committed
                    hostPort := ?
                }
garciay's avatar
garciay committed
            }
        template(present) SipUrl mw_TelSipUrl_Number(
            template(present) charstring p_number := ?
        ) := (mw_SipUrl_Number(p_number), mw_TelSipUrl_Number2(p_number));
        template(present) SipUrl mw_TelSipUrl_Number1(
            template(present) charstring p_number := ?
        ) := mw_SipUrl_Number(p_number);
tepelmann's avatar
tepelmann committed

        template(present) SipUrl mw_TelSipUrl_Number2(
            template(present) charstring p_number := ?
        ) modifies mw_TelUrl := {
            components := {
                tel := {
                    subscriber := p_number
                }
            }
        }
        template(present) SipUrl mw_SipUrl_Host(
            template(present) charstring p_host := ?
        ) modifies mw_SipUrl := {
garciay's avatar
garciay committed
            components := {
                sip := {
tepelmann's avatar
tepelmann committed
                    userInfo := *,
                    hostPort := {host := p_host}
garciay's avatar
garciay committed
                }
            }
garciay's avatar
garciay committed
        template(present) SipUrl mw_SipUrl_User_Host(
            template(present) charstring p_user := ?,
            template(present) charstring p_host := ?
garciay's avatar
garciay committed
        ) modifies mw_SipUrl := {
garciay's avatar
garciay committed
            components := {
garciay's avatar
garciay committed
                sip := {
tepelmann's avatar
tepelmann committed
                    userInfo := {userOrTelephoneSubscriber := p_user},
garciay's avatar
garciay committed
                    hostPort := {
tepelmann's avatar
tepelmann committed
                        host :=
                            p_host //*     hostname, IPv4 or IPv6 as a charstring
garciay's avatar
garciay committed
                    }
                }
garciay's avatar
garciay committed
            },
            urlParameters := * // FSCOM Strange {m_UserPhone}
garciay's avatar
garciay committed
        }
tepelmann's avatar
tepelmann committed

garciay's avatar
garciay committed
        template(present) SipUrl mw_SipUrl_Anonymous modifies mw_SipUrl := {
garciay's avatar
garciay committed
            components := {
                sip := {
                    userInfo := {
nikolajev's avatar
nikolajev committed
                        userOrTelephoneSubscriber := pattern "[a,A][n,N][o,O][n,N][y,Y][m,M][o,O][u,U][s,s]"  //*     charstring
garciay's avatar
garciay committed
                    },
                    hostPort := {
tepelmann's avatar
tepelmann committed
                        host :=
                            pattern
                                "[a,A]nonymous.invalid" //*     hostname, IPv4 or IPv6 as a charstring
garciay's avatar
garciay committed
            }
        template(present) SipUrl mw_SipUrl_urlParam(
            template SemicolonParam_List p_urlParameters
        ) modifies mw_SipUrl := {
            urlParameters := p_urlParameters
        }
garciay's avatar
garciay committed
        template(present) ContactAddress mw_ContactAddress := {
tepelmann's avatar
tepelmann committed
            addressField := ?,
garciay's avatar
garciay committed
            contactParams := *
        }
tepelmann's avatar
tepelmann committed
        template(present) HostPort mw_hostPort(
            template charstring p_host,
            template integer p_portField
        ) := {
            host := p_host,
garciay's avatar
garciay committed
            portField := p_portField
        }
garciay's avatar
garciay committed
        template(present) StatusLine mw_statusLine_any := {
tepelmann's avatar
tepelmann committed
            sipVersion := c_sipNameVersion,
            statusCode := ?,
garciay's avatar
garciay committed
            reasonPhrase := ?
        }
tepelmann's avatar
tepelmann committed

garciay's avatar
garciay committed
        template(present) StatusLine mw_statusLine(
            in template(present) integer p_statusCode := ?,
            in template(present) charstring p_reasonPhrase := ?
garciay's avatar
garciay committed
        ) modifies mw_statusLine_any := {
tepelmann's avatar
tepelmann committed
            statusCode := p_statusCode,
garciay's avatar
garciay committed
            reasonPhrase := p_reasonPhrase
        }
tepelmann's avatar
tepelmann committed

garciay's avatar
garciay committed
        template(present) StatusLine mw_statusLine1xx modifies mw_statusLine_any := {statusCode := (100 .. 199)}
        
        template(present) StatusLine mw_statusLine2xx modifies mw_statusLine_any := {statusCode := (200 .. 299)}
        
        template(present) StatusLine mw_statusLine3xx modifies mw_statusLine_any := {statusCode := (300 .. 399)}
tepelmann's avatar
tepelmann committed

        template(present) StatusLine mw_statusLine4xx modifies mw_statusLine_any := {statusCode := (400 .. 499)}

        template(present) StatusLine mw_statusLine5xx modifies mw_statusLine_any := {statusCode := (500 .. 599)}
        
        template(present) StatusLine mw_statusLine6xx modifies mw_statusLine_any := {statusCode := (600 .. 699)}
tepelmann's avatar
tepelmann committed

        template(present) StatusLine mw_statusLineFinal modifies mw_statusLine_any := {statusCode := (200 .. 699)}
garciay's avatar
garciay committed
        template(present) NameAddr mw_NameAddr_DispName_User_Host(
            template DisplayName p_dn,
            template(present) charstring p_user := ?,
tepelmann's avatar
tepelmann committed
            template charstring p_host
        ) := {
garciay's avatar
garciay committed
            displayName := p_dn,
            addrSpec := {
                scheme := c_sipScheme,  //*     contains "sip"
                components := {
                    sip := {
tepelmann's avatar
tepelmann committed
                        userInfo := {
                            userOrTelephoneSubscriber := p_user,
                            password := *
                        },
garciay's avatar
garciay committed
                        hostPort := {
garciay's avatar
garciay committed
                            host := p_host,  //*     hostname, IPv4 or IPv6 as a charstring
tepelmann's avatar
tepelmann committed
                            portField :=
                                * //*     optional integer
                urlParameters := *, // FSCOM: Strange: {m_UserPhone},
garciay's avatar
garciay committed
                headers := *
            }
        }

garciay's avatar
garciay committed
        template(present) Addr_Union mw_AddrUnion_Nameaddr(
            template DisplayName p_dn,
            template(present) charstring p_user := ?,
tepelmann's avatar
tepelmann committed
            template charstring p_host
        ) := {
garciay's avatar
garciay committed
            nameAddr := mw_NameAddr_DispName_User_Host(p_dn, p_user, p_host)
        }

tepelmann's avatar
tepelmann committed
        template(present) Addr_Union mw_AddrUnion_SipUrl(
            template(present) charstring p_user := ?,
tepelmann's avatar
tepelmann committed
            template charstring p_host
        ) := {
garciay's avatar
garciay committed
            addrSpecUnion := mw_SipUrl_User_Host(p_user, p_host)
        }

Bostjan Pintar's avatar
Bostjan Pintar committed
        template(present) Addr_Union mw_AddrUnion_TelUrl(
            template(present) charstring p_number := ?
        ) := {
            addrSpecUnion := mw_TelSipUrl_Number(p_number)
        }

tepelmann's avatar
tepelmann committed

    } //*     end group Subfields
garciay's avatar
garciay committed

    group HeaderFieldTemplates {
        template(value) LibSip_SIPTypesAndValues.Allow m_Allow(
            template(value) Method_List p_methods
        ) := {
tepelmann's avatar
tepelmann committed
            fieldName := ALLOW_E,
garciay's avatar
garciay committed
            methods := p_methods
        }
        template(present) LibSip_SIPTypesAndValues.Allow mw_Allow(
            template(value) charstring p_method
        ) := {
tepelmann's avatar
tepelmann committed
            fieldName := ALLOW_E,
garciay's avatar
garciay committed
            methods := superset(p_method)
        }
        template(value) GenericParam m_Cause(
            template(omit) GenValue p_cause := omit
tepelmann's avatar
tepelmann committed
            id := "cause",
garciay's avatar
garciay committed
            paramValue := p_cause
        }
tepelmann's avatar
tepelmann committed

        template(present) GenericParam mw_Cause_base(
            template GenValue p_cause
tepelmann's avatar
tepelmann committed
            id := "cause",
garciay's avatar
garciay committed
            paramValue := p_cause
        }
        template(present) GenericParam mw_Cause(
            template(value) charstring p_cause
        ) := {
tepelmann's avatar
tepelmann committed
            id := ?,
            paramValue := { tokenOrHost := pattern "*{p_cause}*" }
garciay's avatar
garciay committed
        }
        template(value) Authorization m_Authorization(
            template(value) Credentials p_credentials
        ) := {
tepelmann's avatar
tepelmann committed
            fieldName := AUTHORIZATION_E,
            body := {p_credentials}
garciay's avatar
garciay committed
        }
tepelmann's avatar
tepelmann committed

		template(present) Authorization mw_Authorization(
			template(present) Credentials p_credentials := ?
Rennoch's avatar
Rennoch committed
		) := {
			fieldName := AUTHORIZATION_E,
			body := {p_credentials}
		}
		
        template(value) Authorization m_Authorization_digest(
            template(value) CommaParam_List p_commaParam_List
        ) := {
tepelmann's avatar
tepelmann committed
            fieldName := AUTHORIZATION_E,
            body := {{digestResponse := p_commaParam_List}}
        template(present) Authorization mw_Authorization_digest(
            template(present) CommaParam_List p_commaParam_List := ?
        ) := {
tepelmann's avatar
tepelmann committed
            fieldName := AUTHORIZATION_E,
            body := {{digestResponse := p_commaParam_List}}
tepelmann's avatar
tepelmann committed
        template(value) Authorization m_add_Authorization_digest(
            template(value) Authorization p_auth,
            template(value) CommaParam_List p_commaParam_List
        ) := {
            fieldName := AUTHORIZATION_E,
            body := {{digestResponse := f_merge_CommaParam_List(p_auth.body[0].digestResponse, p_commaParam_List)}}
garciay's avatar
garciay committed
        }
garciay's avatar
garciay committed
        template(present) Authorization mw_Authorization_other := {
tepelmann's avatar
tepelmann committed
            fieldName := AUTHORIZATION_E,
            body := {{otherResponse := ?}}
garciay's avatar
garciay committed
        }
        template(value) Contact m_Contact(
            template(value) SipUrl p_sipUrl
        ) := {
garciay's avatar
garciay committed
            fieldName := CONTACT_E,
garciay's avatar
garciay committed
            contactBody := {
                contactAddresses := {
                    {
tepelmann's avatar
tepelmann committed
                        addressField := {addrSpecUnion := p_sipUrl},
garciay's avatar
garciay committed
                        contactParams := omit
                    }
                }
tepelmann's avatar
tepelmann committed
            } //*     end contactBody
        } //*     end m_Contact
        template(value) Contact m_Contact_profile(
            template(value) SipUserProfile p_userprofile
        ) := {
garciay's avatar
garciay committed
            fieldName := CONTACT_E,
tepelmann's avatar
tepelmann committed
            contactBody := {
                contactAddresses := {
                    {
                        addressField := {addrSpecUnion := m_SipUrl_contactIpaddr(p_userprofile)},
                        contactParams := omit
                    }
                }
            } //*     end
              //*     contactBody
        } //*     end m_Contact
tepelmann's avatar
tepelmann committed
        template(value) Contact m_Contact_profile_expires(
            template(value) SipUserProfile p_userprofile,
            template(value) GenValue p_expires
tepelmann's avatar
tepelmann committed
        ) := {
garciay's avatar
garciay committed
            fieldName := CONTACT_E,
            contactBody := {
tepelmann's avatar
tepelmann committed
                contactAddresses := {
                    {
                        addressField := {addrSpecUnion := m_SipUrl_contactIpaddr(p_userprofile)},
                        contactParams := {
                            {
                                "expires",
                                p_expires
                            }
                        }
                    }
                }
            } //*     end contactBody
        } //*     end m_Contact
tepelmann's avatar
tepelmann committed
        template(value) From m_From(
            template(value) NameAddr p_nameAddr,
            template(value) GenValue p_tag_str
tepelmann's avatar
tepelmann committed
        ) := {
garciay's avatar
garciay committed
            fieldName := FROM_E,
tepelmann's avatar
tepelmann committed
            addressField := {nameAddr := p_nameAddr},  //*     end addressField
garciay's avatar
garciay committed
            fromParams := {
                {
tepelmann's avatar
tepelmann committed
                    id := c_tagId,
garciay's avatar
garciay committed
                    paramValue := p_tag_str
                }
            }
        template(value) From m_From_Anonymous(
            template(value) GenValue p_tag_str
garciay's avatar
garciay committed
            fieldName := FROM_E,
            addressField := {
                nameAddr :=
tepelmann's avatar
tepelmann committed
                    m_NameAddr(
                        {token:="Anonymous"},
tepelmann's avatar
tepelmann committed
                        //*     optional charstring
                        m_SipUrl_Anonymous //*     SipUrl
                    )
            },  //*     end addressField
garciay's avatar
garciay committed
            fromParams := {
                {
tepelmann's avatar
tepelmann committed
                    id := c_tagId,
garciay's avatar
garciay committed
                    paramValue := p_tag_str
                }
            }
        template(value) From m_From_SipUrl(
            template(value) SipUrl p_sipUrl
        ) := {
garciay's avatar
garciay committed
            fieldName := FROM_E,
            addressField := {
                nameAddr :=
tepelmann's avatar
tepelmann committed
                    m_NameAddr(
                        omit,
                        //*     optional charstring
                        p_sipUrl //*     SipUrl
                    )
            },  //*     end addressField
garciay's avatar
garciay committed
            fromParams := omit
        }

garciay's avatar
garciay committed
        template(value) Event m_Event_base := {
tepelmann's avatar
tepelmann committed
            fieldName := EVENT_E,
            eventType := "",
garciay's avatar
garciay committed
            eventParams := omit
        }
tepelmann's avatar
tepelmann committed
        template(value) Event m_Event_refer modifies m_Event_base := {eventType := "refer"}
garciay's avatar
garciay committed

        template(value) Event m_Event_conference modifies m_Event_base := {eventType := "conference"}

        template(value) Event m_Event_presence modifies m_Event_base := {eventType := "presence"}

        template(value) Event m_Event_reg modifies m_Event_base := {eventType := "reg"}

        template(value) Event m_Event_cdiv modifies m_Event_base := {eventType := "comm-div-info"}

        template(value) Event m_Event_mcid := m_Event_cdiv;

tepelmann's avatar
tepelmann committed
        template(value) Expires m_Expires_base := {
            fieldName := EXPIRES_E,
            deltaSec := ""
        }
garciay's avatar
garciay committed

        template(value) Expires m_Expires_600000 modifies m_Expires_base := {deltaSec := "600000"}

        template(value) Expires m_Expires(
            template(value) charstring p_deltaSec
        ) modifies m_Expires_base := {
            deltaSec := p_deltaSec
        }
        template(present) Expires mw_Expires(
            template(present) charstring p_deltaSec := ?
        ) := {
tepelmann's avatar
tepelmann committed
            fieldName := EXPIRES_E,
            deltaSec := p_deltaSec
        }
        template(value) HistoryInfo m_HistoryInfo(
            template(value) HistoryInfo_List p_HistoryInfo_List
        ) := {
tepelmann's avatar
tepelmann committed
            fieldName := HISTORY_INFO_E,
            historyInfoList := p_HistoryInfo_List
        template(present) HistoryInfo mw_HistoryInfo(
            template(present) HistoryInfo_List p_HistoryInfo_List := ?
        ) := {
tepelmann's avatar
tepelmann committed
            fieldName := HISTORY_INFO_E,
            historyInfoList := p_HistoryInfo_List
tepelmann's avatar
tepelmann committed
        template(value) HistoryInfoEntry m_HistoryInfoEntry(
            template(value) SipUrl p_Url,
            template(omit) IntegerList p_index := omit,
            template(omit) SemicolonParam_List p_paramlist := omit
tepelmann's avatar
tepelmann committed
        ) := {
            nameAddr := m_NameAddr(omit, p_Url),
            hiIndex := p_index,
            hiExtention := p_paramlist
tepelmann's avatar
tepelmann committed
        template(present) HistoryInfoEntry mw_HistoryInfoEntry(
            template(present) SipUrl p_Url := ?,
tepelmann's avatar
tepelmann committed
            template IntegerList p_index,
            template SemicolonParam_List p_paramlist
        ) := {
            nameAddr := mw_NameAddr(*, p_Url),
            hiIndex := p_index,
            hiExtention := p_paramlist
        template(value) PAssertedID m_PAssertedID(
            template(value) Addr_Union p_pAssertedIDValue
        ) := {
tepelmann's avatar
tepelmann committed
            fieldName := P_ASSERTED_ID_E,
            pAssertedIDValueList := {p_pAssertedIDValue}
tepelmann's avatar
tepelmann committed
        template(value) PAssertedID m_PAssertedID_2x(
            template(value) Addr_Union p_pAssertedIDValue,
            template(value) Addr_Union p_pAssertedIDValue2
        ) modifies m_PAssertedID := {
garciay's avatar
garciay committed
            pAssertedIDValueList := {p_pAssertedIDValue, p_pAssertedIDValue2}
        }

        template(present) PAssertedID mw_PAssertedID(
            template(present) PAssertedIDValue p_pAssertedIDValue := ?
        ) := {
tepelmann's avatar
tepelmann committed
            fieldName := P_ASSERTED_ID_E,
            pAssertedIDValueList := {p_pAssertedIDValue}
        template(present) PAssertedIDValue mw_PAssertedIDValue(
            template(present) SipUrl p_SipUrl := ?
        ) := {
garciay's avatar
garciay committed
            nameAddr := {
tepelmann's avatar
tepelmann committed
                displayName := *,
garciay's avatar
garciay committed
                addrSpec := p_SipUrl
            }
        }
        template(value) PPreferredID m_PPreferredID(
            template(value) Addr_Union p_pPreferredIDValue
        ) := {
tepelmann's avatar
tepelmann committed
            fieldName := P_PREFERRED_ID_E,
            pPreferredIDValueList := {p_pPreferredIDValue}
        template(value) Privacy m_Privacy(
            template(value) PrivacyValue p_privacy
        ) := {
tepelmann's avatar
tepelmann committed
            fieldName := PRIVACY_E,
            privValueList := {p_privacy}
garciay's avatar
garciay committed
        }
        template(present) Privacy mw_Privacy_Base(
            template(present) charstring p_value := ?
        ) := {
tepelmann's avatar
tepelmann committed
            fieldName := PRIVACY_E,
garciay's avatar
garciay committed
            privValueList := {*, p_value, *}
        }
tepelmann's avatar
tepelmann committed

garciay's avatar
garciay committed
        template(present) Privacy mw_Privacy_id := mw_Privacy_Base("id");

        template(present) Privacy mw_Privacy_user := mw_Privacy_Base("user");

tepelmann's avatar
tepelmann committed
        template(value) RAck m_RAck(
            integer p_responseNum,
            integer p_seqNumber,
            charstring p_method
        ) := {
            fieldName := RACK_E,
            responseNum := p_responseNum,
            seqNumber := p_seqNumber,
garciay's avatar
garciay committed
            method := p_method
        template(value) Reason m_Reason(
            template(value) integer p_cause
        ) := {
tepelmann's avatar
tepelmann committed
            fieldName := REASON_E,
            reasonValues := {m_ReasonValue({tokenOrHost := int2str(valueof(p_cause))}, { tokenOrHost := "dummy"})}
tepelmann's avatar
tepelmann committed
        template(value) Reason m_Reason21 := {
            fieldName := REASON_E,
            reasonValues := {m_ReasonValue({tokenOrHost := int2str(21)}, { tokenOrHost := "call reject"})}
garciay's avatar
garciay committed
        }
garciay's avatar
garciay committed
        template(present) Reason mw_Reason_Base := {
tepelmann's avatar
tepelmann committed
            fieldName := REASON_E,
            reasonValues := {}
garciay's avatar
garciay committed
        }
        template(present) Reason mw_Reason(
            template(value) GenValue p_cause
        ) modifies mw_Reason_Base := {
            reasonValues := {mw_ReasonValue(p_cause, ?)}
        }
        template(present) Reason mw_ReasonSIP(
            template(value) GenValue p_cause
        ) modifies mw_Reason_Base := {
            reasonValues := {mw_ReasonValueSIP(p_cause, ?)}
        }
        template(value) RecordRoute m_recordRoute_currIpAddr(
            template(value) SipUserProfile p_userprofile
        ) := {
garciay's avatar
garciay committed
            fieldName := RECORD_ROUTE_E,
            routeBody := {
                {
                    nameAddr := {
                        displayName := omit,
                        addrSpec := {
                            scheme := c_sipScheme,  //*     contains "sip"
garciay's avatar
garciay committed
                            components := {
                                sip := {
tepelmann's avatar
tepelmann committed
                                    userInfo := omit,
garciay's avatar
garciay committed
                                    hostPort := {
tepelmann's avatar
tepelmann committed
                                        host := p_userprofile.currIpaddr,
garciay's avatar
garciay committed
                                        portField := p_userprofile.currPort
                                    }
                                }
                            },
garciay's avatar
garciay committed
                            urlParameters := omit,
                            headers := omit
                        }
                    },
                    rrParam := omit
                }
            }
        }

tepelmann's avatar
tepelmann committed
        template(value) RecordRoute m_recordRoute_currIpAddr_params(
            template(value) SipUserProfile p_userprofile,
            template(value) SemicolonParam_List p_urlParameters
        ) := {
garciay's avatar
garciay committed
            fieldName := RECORD_ROUTE_E,
            routeBody := {
                {
                    nameAddr := {
                        displayName := omit,
                        addrSpec := {
                            scheme := c_sipScheme,  //*     contains "sip"
garciay's avatar
garciay committed
                            components := {
                                sip := {
tepelmann's avatar
tepelmann committed
                                    userInfo := omit,
garciay's avatar
garciay committed
                                    hostPort := {
tepelmann's avatar
tepelmann committed
                                        host := p_userprofile.currIpaddr,
garciay's avatar
garciay committed
                                        portField := p_userprofile.currPort
                                    }
                                }
                            },
garciay's avatar
garciay committed
                            urlParameters := p_urlParameters,
                            headers := omit
                        }
                    },
                    rrParam := omit
                }
            }
        }

        template(value) RouteBody m_routeBody_currIpAddr(
            template(value) SipUserProfile p_userprofile
        ) := {
garciay's avatar
garciay committed
            nameAddr := {
                displayName := omit,
                addrSpec := {
                    scheme := c_sipScheme,  //*     contains "sip"
garciay's avatar
garciay committed
                    components := {
                        sip := {