Commit 568d5e01 authored by filatov's avatar filatov
Browse files

v3.0.0 after STF471 validation

parent 0da9eb2a
Loading
Loading
Loading
Loading
+39 −0
Original line number Diff line number Diff line
/**
 * @author STF160, STF471
 * @version $Id: LibSip_Common.ttcn 488 2014-09-18 10:17:19Z rennoch $
 * @desc This module provides the common definitions for SIP messages.
 *              This module is part of LibSipV3.
*/
module LibSip_Common {

  type set length (1..infinity) of charstring Charstring_List;
  
  // [20.1, 20.3, 20.4, 20.7, 20.9, 20.10, 20.11, 20.18, 20.20, 20.27, 20.28, 20.30, 20.31,
  // 20.33, 20.34, 20.39, 20.42, 20.44]


  type union GenValue {
    charstring  tokenOrHost,
    charstring  quotedString
  }

  type record GenericParam
  {
    charstring             id,
    GenValue               paramValue optional
  }
  
  // [?]
  type set of GenericParam SemicolonParam_List;
  
  // [?]
  type set of GenericParam AmpersandParam_List;
  
  // [?]
  type set of GenericParam CommaParam_List;
  //------------------------------------------------------------------------------
      
}
with {
    encode "LibSip V3";
} // end module LibSip_Common
+7 −14
Original line number Diff line number Diff line
@@ -31,8 +31,7 @@ module LibSip_MessageBodyTypes {
        }

        type record MIME_Message {
            charstring boundary,
            // len:
            charstring boundary, // len:
            MimeEncapsulatedList mimeEncapsulatedList
        }

@@ -42,19 +41,13 @@ module LibSip_MessageBodyTypes {
    } // group MIMETypes

    type union MessageBody {
        SDP_Message sdpMessageBody,
        // if there is only SDP part
        SDP_Message sdpMessageBody, // if there is only SDP part
        // XMLMessage xmlMessage, // if there is XML message (with header and body)
        XmlBody xmlBody,
        // if there is XML body
        MIME_Message mimeMessageBody,
        // if there is SDP and encapsulated ISUP part
        charstring sipfrag,
        // if content-Type is message/sipfrag (cp. NOTIFY, cp TS124147 A.4.3.1.2)
        charstring textplain,
        // if content type is text/plain (for testing long messages)
        SimpleMsgSummary simpleMsgSummary,
        // RFC 3842
        XmlBody xmlBody, // if there is XML body
        MIME_Message mimeMessageBody, // if there is SDP and encapsulated ISUP part
        charstring sipfrag, // if content-Type is message/sipfrag (cp. NOTIFY, cp TS124147 A.4.3.1.2)
        charstring textplain, // if content type is text/plain (for testing long messages)
        SimpleMsgSummary simpleMsgSummary, // RFC 3842
        octetstring smsMessage // encoded SMS message 3GPP 23.040, 24.011
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@
 * @remark Adding of new attributes types is ok; Adding of new optional attributes in @see SDP_attribute type is ok; Existing attribute types shall not be changed or removed - change requests shall be made to http://t-ort.etsi.org
 */
module LibSip_SDPTypes {
    import from LibSip_SIPTypesAndValues all;
    import from LibSip_Common all;
    group Constants {
        group SimpleConstants {
            // SDP net_type
+60 −112
Original line number Diff line number Diff line
/**
 * @author STF 346, STF366, STF368, STF369, STF450, STF471
 * @author STF 346, STF366, STF368, STF369, STF450, STF471, STF160
 * @version $Id$
 * @desc This module defines message, header, structured and simple SIP
 *             types as well constants used by LipSip constructs. <br>
@@ -13,7 +13,7 @@
 */
module LibSip_SIPTypesAndValues {
    import from LibSip_MessageBodyTypes all;
    import from LibSip_PIXITS all;
    import from LibSip_Common all;

    group Constants {
        group SimpleConstants {
@@ -74,9 +74,6 @@ module LibSip_SIPTypesAndValues {
            // XML name resource-list
            const charstring c_xmlresourcelistApplication := "application/resource-lists+xml";

            // MIME name application
            const charstring c_mimeMultipart := "multipart/mixed;boundary=""" & PX_SIP_MIME_BOUNDARY & """";

            // IMS 3GPP name application
            const charstring c_ims3gppApplication := "application/3gpp-ims+xml";

@@ -104,8 +101,7 @@ module LibSip_SIPTypesAndValues {
            // text content of 1300 bytes for messages with message body
            const charstring c_longMessageContent_1300Bytes :=
                "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" &
                "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & oct2char('0D'O) & oct2char('0A'O);
            // CRLF
                "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & oct2char('0D'O) & oct2char('0A'O); // CRLF
            // Default SIP port number : 5060
            const integer c_defaultSipPort := 5060;

@@ -148,8 +144,7 @@ module LibSip_SIPTypesAndValues {
            const PrivacyValue c_privacy_session := "session";

            //
            const charstring c_AT := "@";
            // MRO
            const charstring c_AT := "@"; // MRO
            const charstring c_SP := oct2char('20'O);
            const charstring c_SLASH := oct2char('2F'O);
            const charstring c_LT := oct2char('3C'O);
@@ -270,8 +265,7 @@ module LibSip_SIPTypesAndValues {
                headers := omit
            };

            const To c_empty_To := {
                // value of To header
            const To c_empty_To := { // value of To header
                fieldName := TO_E,
                addressField := {
                    nameAddr := {
@@ -546,35 +540,10 @@ module LibSip_SIPTypesAndValues {
                    UNKNOWN_METHOD_E
                }

                type union GenValue { 
                    charstring tokenOrHost,
                    charstring quotedString
                }

                // [20.1, 20.3, 20.4, 20.7, 20.9, 20.10, 20.11, 20.18, 20.20, 20.27, 20.28, 20.30, 20.31,
                // 20.33, 20.34, 20.39, 20.42, 20.44 ]
                type record GenericParam {
                    charstring id,
                    GenValue paramValue optional
                }

                // [? ]
                type set of GenericParam SemicolonParam_List;

                // [? ]
                type set of GenericParam AmpersandParam_List;

                // [? ]
                type set of GenericParam CommaParam_List;

                type set length (1..infinity) of charstring Charstring_List;

                // [20.10, 20.20, 20.30, 20.31, 20.34, 20.39, 20.42, 20.43 ]
                type record HostPort {
                    charstring host optional,
                    // hostname, IPv4 or IPv6
                    integer portField
                     optional // represented as an integer
                    charstring host optional, // hostname, IPv4 or IPv6
                    integer portField optional // represented as an integer
                }

                // [20.10, 20.20, 20.30, 20.31, 20.34, 20.39 ]
@@ -597,41 +566,30 @@ module LibSip_SIPTypesAndValues {
                 * @member urlParameters Contains either SIP or TEL URL parameters, separated by semicolons, e.g. transport=tcp or user=phone
                 * @member headers Additional information added after the parameters, e.g. priority=urgent
                 */
                type record SipUriComponents {
                    // sip-uri acc. to RFC 3261 cl. 19.1
                type record SipUriComponents { // sip-uri acc. to RFC 3261 cl. 19.1
                    UserInfo userInfo optional,
                    HostPort hostPort
                }

                type record TelUriComponents {
                    // tel-uri acc. to RFC 3966
                type record TelUriComponents { // tel-uri acc. to RFC 3966
                    charstring subscriber
                }

                type record UrnUriComponents {
                    // urn-uri acc. to RFC 2141
                    charstring namespaceId,
                    // e.g. "service" as acc. to RFC 5031
                    charstring
                    namespaceSpecificString // e.g. "sos"
                type record UrnUriComponents { // urn-uri acc. to RFC 2141
                    charstring namespaceId, // e.g. "service" as acc. to RFC 5031
                    charstring namespaceSpecificString // e.g. "sos"
                }

                type union UriComponents {
                    SipUriComponents sip,
                    // scheme: "sip" or sips"
                    TelUriComponents tel,
                    // scheme: "tel"
                    UrnUriComponents urn,
                    // scheme: "urn"
                    charstring
                    other // scheme: none of the above schemes
                    SipUriComponents sip, // scheme: "sip" or sips"
                    TelUriComponents tel, // scheme: "tel"
                    UrnUriComponents urn, // scheme: "urn"
                    charstring other // scheme: none of the above schemes
                }

                type record SipUrl {
                    charstring scheme,
                    // e.g "sip" or "tel"
                    UriComponents components,
                    // corresponding to the scheme
                    charstring scheme, // e.g "sip" or "tel"
                    UriComponents components, // corresponding to the scheme
                    SemicolonParam_List urlParameters optional,
                    AmpersandParam_List headers optional
                }
@@ -647,8 +605,7 @@ module LibSip_SIPTypesAndValues {

                // [20.4 ]
                type record AlertInfoBody {
                    charstring url,
                    // any URI
                    charstring url, // any URI
                    SemicolonParam_List genericParams optional
                }

@@ -663,8 +620,7 @@ module LibSip_SIPTypesAndValues {

                // [20.9 ]
                type record CallInfoBody {
                    charstring url,
                    // any URI
                    charstring url, // any URI
                    SemicolonParam_List infoParams optional
                }

@@ -677,17 +633,23 @@ module LibSip_SIPTypesAndValues {
                    OtherAuth otherChallenge
                }

                // [20.10, 20.20, 20.30, 20.31, 20.34, 20.39 ]
                type union DisplayName
                {
                  charstring  token,
                  charstring  quotedString
                }

                // [20.10, 20.20, 20.30, 20.31, 20.34, 20.39 ]
                type record NameAddr {
                    charstring displayName optional,
                    DisplayName displayName optional,
                    SipUrl addrSpec
                }

                // [20.10, 20.20, 20.31, 20.39 ]
                type union Addr_Union {
                    NameAddr nameAddr,
                    SipUrl
                    addrSpecUnion // STS: "Union" added to filed name to avoid dangerous name equivalence with 2nd NameAddr field
                    SipUrl addrSpecUnion // STS: "Union" added to filed name to avoid dangerous name equivalence with 2nd NameAddr field
                }

                // [20.10 ]
@@ -697,8 +659,7 @@ module LibSip_SIPTypesAndValues {
                }

                // [20.10 ]
                type set of ContactAddress ContactAddress_List;
                // 1 or more elements
                type set of ContactAddress ContactAddress_List; // 1 or more elements
                // [20.10 ]
                type union ContactBody {
                    charstring wildcard,
@@ -721,12 +682,10 @@ module LibSip_SIPTypesAndValues {
                type record of Credentials CredentialsList;

                // [20.19, 20.23, 20.33 ]
                type charstring DeltaSec;
                // an external operation can handle this field
                type charstring DeltaSec; // an external operation can handle this field
                // [20.18 ]
                type record ErrorInfoBody {
                    charstring uri,
                    // any URI
                    charstring uri, // any URI
                    SemicolonParam_List genericParams optional
                }

@@ -751,14 +710,12 @@ module LibSip_SIPTypesAndValues {
                // [20.5 ]
                type set of charstring Method_List;


                // [20.29, 20.32, 20.37, 20.40 ]
                type charstring OptionTag;

                // [20.29, 20.32, 20.37, 20.40 ]
                type set of OptionTag OptionTag_List;


                // [20.7, 20.27, 20.28, 20.44 ; RFC2616 14.33, 14.47; RFC2617 1.2 ]
                type record OtherAuth {
                    charstring authScheme,
@@ -794,10 +751,8 @@ module LibSip_SIPTypesAndValues {

                // [20.38 ]
                type record TimeValue {
                    integer majorDigit,
                    // represented as an integer
                    integer minorDigit
                     optional // represented as an integer
                    integer majorDigit, // represented as an integer
                    integer minorDigit optional // represented as an integer
                }

                // [20.42 ]
@@ -818,8 +773,7 @@ module LibSip_SIPTypesAndValues {

                // [20.43 ]
                type record WarningValue {
                    integer warnCode,
                    // represented as an integer
                    integer warnCode, // represented as an integer
                    WarnAgent warnAgent,
                    charstring warnText
                }
@@ -893,8 +847,7 @@ module LibSip_SIPTypesAndValues {
                    // [20.7 RFC2617 3.2.2 ]
                    type record Authorization {
                        FieldName fieldName (AUTHORIZATION_E) ,
                        CredentialsList
                        body // changed from Credentials to allow multiple Authorization headers
                        CredentialsList body // changed from Credentials to allow multiple Authorization headers
                    }

                    // [20.8 ]
@@ -937,8 +890,7 @@ module LibSip_SIPTypesAndValues {
                    // [20.14 ]
                    type record ContentLength {
                        FieldName fieldName (CONTENT_LENGTH_E) ,
                        integer
                        len // this field is represented as an integer
                        integer len // this field is represented as an integer
                    }

                    // [20.15 ]
@@ -950,8 +902,7 @@ module LibSip_SIPTypesAndValues {
                    // [20.16 ]
                    type record CSeq {
                        FieldName fieldName (CSEQ_E) ,
                        integer seqNumber,
                        // this field is represented as an integer
                        integer seqNumber, // this field is represented as an integer
                        charstring method
                    }

@@ -995,8 +946,7 @@ module LibSip_SIPTypesAndValues {
                    // [20.22 ]
                    type record MaxForwards {
                        FieldName fieldName (MAX_FORWARDS_E) ,
                        integer
                        forwards // this field is represented as an integer
                        integer forwards // this field is represented as an integer
                    }

                    // [20.23 ]
@@ -1008,10 +958,8 @@ module LibSip_SIPTypesAndValues {
                    // [20.24 RFC2616 19.4.1 ]
                    type record MimeVersion {
                        FieldName fieldName (MIME_VERSION_E) ,
                        integer majorNumber,
                        // this field is represented as an integer
                        integer
                        minorNumber // this field is represented as an integer
                        integer majorNumber, // this field is represented as an integer
                        integer minorNumber // this field is represented as an integer
                    }

                    // [20.25 ]
@@ -1201,8 +1149,7 @@ module LibSip_SIPTypesAndValues {
                        PMediaAuthorization_List pMediaAuthorizations
                    }

                    type charstring PMediaAuthValue;
                    // HEXDIG "0"-"9", "A"-"F"
                    type charstring PMediaAuthValue; // HEXDIG "0"-"9", "A"-"F"
                    type record of PMediaAuthValue PMediaAuthorization_List;


@@ -1569,6 +1516,7 @@ module LibSip_SIPTypesAndValues {
                    Event event optional,
                    // 3265/7.2
                    Expires expires optional,
                    FeatureCaps featureCaps optional,  // 6809
                    From fromField,
                    Geolocation geolocation optional,
                    // 6442
@@ -1780,7 +1728,7 @@ module LibSip_SIPTypesAndValues {
                    MessageHeader msgHeader,
                    MessageBody messageBody optional,
                    Payload payload optional
                }
                } with { encode "SIPCodec"}

                // Note: the introduction of the following specific types is to enable better means for logging
                // on the other side the generic type is useful for functions dealing with multiple SIP message types
@@ -1789,42 +1737,42 @@ module LibSip_SIPTypesAndValues {
                    MessageHeader msgHeader,
                    MessageBody messageBody optional,
                    Payload payload optional
                }
                } with { encode "SIPCodec"}

                type record INVITE_Request {
                    RequestLine requestLine,
                    MessageHeader msgHeader,
                    MessageBody messageBody optional,
                    Payload payload optional
                }
                } with { encode "SIPCodec"}

                type record OPTIONS_Request {
                    RequestLine requestLine,
                    MessageHeader msgHeader,
                    MessageBody messageBody optional,
                    Payload payload optional
                }
                } with { encode "SIPCodec"}

                type record BYE_Request {
                    RequestLine requestLine,
                    MessageHeader msgHeader,
                    MessageBody messageBody optional,
                    Payload payload optional
                }
                } with { encode "SIPCodec"}

                type record CANCEL_Request {
                    RequestLine requestLine,
                    MessageHeader msgHeader,
                    MessageBody messageBody optional,
                    Payload payload optional
                }
                } with { encode "SIPCodec"}

                type record ACK_Request {
                    RequestLine requestLine,
                    MessageHeader msgHeader,
                    MessageBody messageBody optional,
                    Payload payload optional
                }
                } with { encode "SIPCodec"}

                // [3262/7.1 ]
                type record PRACK_Request {
@@ -1832,7 +1780,7 @@ module LibSip_SIPTypesAndValues {
                    MessageHeader msgHeader,
                    MessageBody messageBody optional,
                    Payload payload optional
                }
                } with { encode "SIPCodec"}

                // [3265/7.1 ]
                type record NOTIFY_Request {
@@ -1840,7 +1788,7 @@ module LibSip_SIPTypesAndValues {
                    MessageHeader msgHeader,
                    MessageBody messageBody optional,
                    Payload payload optional
                }
                } with { encode "SIPCodec"}

                // [3265/7.1 ]
                type record SUBSCRIBE_Request {
@@ -1848,7 +1796,7 @@ module LibSip_SIPTypesAndValues {
                    MessageHeader msgHeader,
                    MessageBody messageBody optional,
                    Payload payload optional
                }
                } with { encode "SIPCodec"}

                // [3903/11.1 ]
                type record PUBLISH_Request {
@@ -1856,7 +1804,7 @@ module LibSip_SIPTypesAndValues {
                    MessageHeader msgHeader,
                    MessageBody messageBody optional,
                    Payload payload optional
                }
                } with { encode "SIPCodec"}

                // [3311/7 ]
                type record UPDATE_Request {
@@ -1864,28 +1812,28 @@ module LibSip_SIPTypesAndValues {
                    MessageHeader msgHeader,
                    MessageBody messageBody optional,
                    Payload payload optional
                }
                } with { encode "SIPCodec"}

                type record REFER_Request {
                    RequestLine requestLine,
                    MessageHeader msgHeader,
                    MessageBody messageBody optional,
                    Payload payload optional
                }
                } with { encode "SIPCodec"}

                type record MESSAGE_Request {
                    RequestLine requestLine,
                    MessageHeader msgHeader,
                    MessageBody messageBody optional,
                    Payload payload optional
                }
                } with { encode "SIPCodec"}

                type record INFO_Request {
                    RequestLine requestLine,
                    MessageHeader msgHeader,
                    MessageBody messageBody optional,
                    Payload payload optional
                }
                } with { encode "SIPCodec"}

                type union RequestUnion {
                    REGISTER_Request Register,
@@ -1901,7 +1849,7 @@ module LibSip_SIPTypesAndValues {
                    UPDATE_Request Update,
                    REFER_Request Refer,
                    MESSAGE_Request Message
                }
                } with { encode "SIPCodec"}

            } // end group RequestTypes

@@ -1919,7 +1867,7 @@ module LibSip_SIPTypesAndValues {
                    MessageHeader msgHeader,
                    MessageBody messageBody optional,
                    Payload payload optional
                }
                } with { encode "SIPCodec"}

            } // end group ResponseTypes

+1 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ module LibSip_Steps {
    import from LibSip_Interface all;
    import from LibSip_PIXITS all;
    import from LibSip_XMLTypes all;
    import from LibSip_Common all;

    group externalfunctions {

Loading