Skip to content
LibSip_SMSTemplates.ttcn 11.5 KiB
Newer Older
/**
 *  @author     STF 435, STF 471
 *  @version    $Id$
 *  @desc       This module provides the types used by the test component
 *              for SIP-SMS over IMS as specified in 3GPP 24-341 tests.
 *              This module is part of LibSipV3.
 */
module LibSip_SMSTemplates {
    import from LibCommon_DataStrings all;
    import from LibSip_SMSTypesAndValues all;
    import from LibSip_SMSFunctions all;

    group SMS_Templates_Group {

        /* Non-SMS Type Constraints */
        template(present) TypeOfNumberingPlan mw_TypeOfNumberingPlanAny := {
            extBit := ?,
            typeOfNumber := ?,
            numberingPlanId := ?
        }

        template(value) TypeOfNumberingPlan m_TypeOfNumberingPlan := {
            extBit := '1'B,
            typeOfNumber := '001'B,  // international number
            numberingPlanId :=
                '0001'B // ISDN/telephony numbering plan (Rec. E.164/E.163)
        }

        template(present) TypeOfNumberingPlan mw_TypeOfNumberingPlan := mw_TypeOfNumberingPlanAny;

        /* End Non-SMS Type Constraints */
        template(value) RP_OriginatorAddress_dl m_RP_OriginatorAddress_dl := {
            spare := omit,
            iei := omit,
            iel := '06'O,  // 6 semi-octets
            typeOfNumberingPlan := m_TypeOfNumberingPlan,
            digits := '001122'O
        }

        template(present) RP_OriginatorAddress_ul mw_RP_OriginatorAddress_ul := {
            spare := omit,
            iei := omit,
            iel := '00'O
        }

        template(present) RP_DestinationAddress_ul mw_RP_DestinationAddress_ul := {
            spare := omit,
            iei := omit,
            iel := ?,
            typeOfNumberingPlan := mw_TypeOfNumberingPlan,
            digits := ?
        }
        template(omit) RP_DestinationAddress_dl m_RP_DestinationAddress_dl := {
            spare := omit,
            iei := omit,
            iel := '00'O
        }

        template(omit) RP_UserData m_RP_UserData_DELIVER(
            octetstring p_Digits
        ) := {
            spare := omit,
            iei := omit,
            iel := int2oct((153 + lengthof(p_Digits)), 1),
            tP_PDU := {SMS_DELIVER := m_SMS_DELIVER(p_Digits)}
        }

        template(value) RP_UserData m_RP_UserData_SUBMIT_REPORT := {
            spare := '0'B,
            iei := c_IEI_RP_UserData,
            iel := '0A'O,  // the TPDU data length is 10 octets
            tP_PDU := {SMS_SUBMIT_REPORT := m_SMS_SUBMIT_REPORT}
Yann Garcia's avatar
Yann Garcia committed
        }
        template(value) RP_UserData m_RP_UserData_STATUS_REPORT(
            template(value) TP_MessageReference_Type p_MessageRef,
            template(value) TP_Address_Type p_RecipientAddress,
            template(value) TP_ServiceCentreTimeStamp_Type p_SCTP
        ) modifies m_RP_UserData_SUBMIT_REPORT := {
            tP_PDU := {SMS_STATUS_REPORT := m_SMS_STATUS_REPORT(p_MessageRef, p_RecipientAddress, p_SCTP)}
        }

        template(present) RP_UserData mw_RP_UserData_SUBMIT := {
            spare := omit,
            iei := omit,
            iel := ?,
            tP_PDU := {SMS_SUBMIT := mw_SMS_SUBMIT_VPF_REF}
        }

        template(present) RP_UserData mw_RP_UserData_DELIVER_REPORT := {
            spare := '0'B,
            iei := c_IEI_RP_UserData,
            iel := ?,
            tP_PDU := {SMS_DELIVER_REPORT := mw_SMS_DELIVER_REPORT}
        }

        /* End SM-RP Type Constraints */
        /* SM-RP PDU Constraints */
        template(value) RP_DATA_dl_Type m_RP_DATA_dl_base := {
            spare5 := '00000'B,
            rP_MessageTypeIndicator := c_MT_RP_DATA_dl,
            rP_MessageReference := '00'O,
            rP_OriginatorAddress := m_RP_OriginatorAddress_dl,
            rP_DestinationAddress := m_RP_DestinationAddress_dl,
            rP_UserData := m_RP_UserData_DELIVER('0000'O)
        }

        template(value) RP_DATA_dl_Type m_RP_DATA_dl_DELIVER(
            octetstring p_Digits
        ) modifies m_RP_DATA_dl_base := {rP_UserData := m_RP_UserData_DELIVER(p_Digits)}

        template(value) RP_DATA_dl_Type m_RP_DATA_dl_STATUS_REPORT(
            template(value) TP_MessageReference_Type p_MessageRef,
            template(value) TP_Address_Type p_RecipientAddress,
            template(value) TP_ServiceCentreTimeStamp_Type p_SCTP
        ) modifies m_RP_DATA_dl_base := {
            rP_UserData := m_RP_UserData_STATUS_REPORT(p_MessageRef, p_RecipientAddress, p_SCTP)
        }


        template(present) RP_DATA_ul_Type mw_RP_DATA_ul_SUBMIT := {
            spare5 := '00000'B,
            rP_MessageTypeIndicator := c_MT_RP_DATA_ul,
            rP_MessageReference := ?,
            rP_OriginatorAddress := mw_RP_OriginatorAddress_ul,
            rP_DestinationAddress := mw_RP_DestinationAddress_ul,
            rP_UserData := mw_RP_UserData_SUBMIT
        }

        template(value) RP_ACK_Type m_RP_ACK_SUBMIT_REPORT(
            template(value) Oct1 p_msgReference := '00'O
        ) := {
            spare5 := '00000'B,
            rP_MessageTypeIndicator := c_MT_RP_ACK_dl,
            rP_MessageReference := p_msgReference,
            rP_UserData := m_RP_UserData_SUBMIT_REPORT
        }

        template(present) RP_ACK_Type mw_RP_ACK_DELIVER_REPORT := {
            spare5 := '00000'B,
            rP_MessageTypeIndicator := c_MT_RP_ACK_ul,
            rP_MessageReference := ?,
            rP_UserData := mw_RP_UserData_DELIVER_REPORT
        }

        /* End SM-RP PDU Constraints */
        /* SM-TP Type Constraints */
        template(value) TP_ProtocolIdentifier_Type mw_TP_ProtocolIdentifier := {
            pidType := '01'B,
            interworking := '0'B,
            pidValue := '00000'B
        }

        template(value) TP_ProtocolIdentifier_Type m_TP_ProtocolIdentifier := {
            pidType := '01'B,
            interworking := '0'B,
            pidValue := '00000'B
        }

        template(value) TP_DataCodingScheme_Type m_TP_DataCodingScheme := {
            codingGroup := '0000'B,
            codeValue := '0000'B
        }

        template(present) TP_Address_Type mw_TP_AddressAny := {
            iel := ?,
            typeOfNumberingPlan := mw_TypeOfNumberingPlanAny,
            digits := *
        }

        template(value) TP_Address_Type m_TP_Address(
            octetstring p_Digits
        ) := {
            iel := int2oct(2 * lengthof(p_Digits), 1),
            // length is number of useful semi-octets
            // as p_digits is declared as octetstring the number must be even
            typeOfNumberingPlan := m_TypeOfNumberingPlan,
            digits := p_Digits
        }

        template(value) TP_ParameterIndicator_Type m_TP_ParameterIndicator := {
            extBit1 := '0'B,
            spare4 := '0000'B,
            tP_UDL := '0'B,
            tP_DCS := '0'B,
            tP_PID := '1'B
        }

        /* End SM-TP Type Constraints */
        /* SM-TP PDU Constraints */
        template(value) SMS_DELIVER_Type m_SMS_DELIVER(
            octetstring p_Digits
        ) := {
            tP_ReplyPath := '0'B,
            tP_UserDataHeaderIndicator := '0'B,
            tP_StatusReportIndication := '1'B,
            spare2 := '00'B,
            tP_MoreMessagesToSend := '0'B,
            tP_MessageTypeIndicator := c_MT_SMS_DELIVER,
            tP_OriginatingAddress := m_TP_Address(p_Digits),
            tP_ProtocolIdentifier := m_TP_ProtocolIdentifier,
            tP_DataCodingScheme_Type := m_TP_DataCodingScheme,
            tP_ServiceCentreTimeStamp := fx_GetSC_TimeStamp(0),  // Time Zone 0 assumed
            tP_UserDataLength := int2oct(160, 1),
            tP_UserData := f_IA5_2oct(c_Fox)
        }

        template(present) SMS_DELIVER_REPORT_Type mw_SMS_DELIVER_REPORT := {
            spare1 := '0'B,
            tP_UserDataHeaderIndicator := '0'B,
            spare4 := '0000'B,
            tP_MessageTypeIndicator := c_MT_SMS_DELIVER_REPORT,
            tP_FailureCause := omit,
            tP_ParameterIndicator := ?,
            tP_ProtocolIdentifier := mw_TP_ProtocolIdentifier,
            tP_DataCodingScheme_Type := *,
            tP_UserDataLength := *,
            tP_UserData := *
        }

        template(present) SMS_SUBMIT_Type mw_SMS_SUBMIT := {
            tP_ReplyPath := '0'B,
            tP_UserDataHeaderIndicator := '0'B,
            tP_StatusReportRequest := '1'B,
            tP_ValidityPeriodFormat := '??'B,
            tP_RejectDuplicates := '0'B,
            tP_MessageTypeIndicator := c_MT_SMS_SUBMIT,
            tP_MessageReference := ?,
            tP_DestinationAddress := mw_TP_AddressAny,
            tP_ProtocolIdentifier := mw_TP_ProtocolIdentifier,
            tP_DataCodingScheme_Type := ?,
            tP_ValidityPeriod := *,
            tP_UserDataLength := int2oct(160, 1),
            tP_UserData :=
                ? // any data will do: 140 octets
        }

        template(present) SMS_SUBMIT_Type mw_SMS_SUBMIT_VPF_NP modifies mw_SMS_SUBMIT := {
            tP_ValidityPeriodFormat := '00'B,
            tP_ValidityPeriod := omit
        }

        template(present) SMS_SUBMIT_Type mw_SMS_SUBMIT_VPF_REF modifies mw_SMS_SUBMIT := {
            tP_ValidityPeriodFormat := '10'B,
            tP_ValidityPeriod := ?
        }

        template(present) SMS_SUBMIT_Type mw_SMS_SUBMIT_VPF_ENH modifies mw_SMS_SUBMIT := {
            tP_ValidityPeriodFormat := '01'B,
            tP_ValidityPeriod := ?
        }

        template(present) SMS_SUBMIT_Type mw_SMS_SUBMIT_VPF_ABS modifies mw_SMS_SUBMIT := {
            tP_ValidityPeriodFormat := '11'B,
            tP_ValidityPeriod := ?
        }

        template(value) SMS_SUBMIT_REPORT_Type m_SMS_SUBMIT_REPORT := {
            spare1 := '0'B,
            tP_UserDataHeaderIndicator := '0'B,
            spare4 := '0000'B,
            tP_MessageTypeIndicator := c_MT_SMS_SUBMIT_REPORT,
            tP_FailureCause := omit,
            tP_ParameterIndicator := m_TP_ParameterIndicator,
            tP_ServiceCentreTimeStamp := fx_GetSC_TimeStamp(0),  // Time Zone 0 assumed
            tP_ProtocolIdentifier := m_TP_ProtocolIdentifier,
            tP_DataCodingScheme_Type := omit,
            tP_UserDataLength := omit,
            tP_UserData := omit
        }

        template(value) SMS_STATUS_REPORT_Type m_SMS_STATUS_REPORT(
            template(value) TP_MessageReference_Type p_MessageRef,
            template(value) TP_Address_Type p_RA,
            template(value) TP_ServiceCentreTimeStamp_Type p_SCTP
        ) := {
            // TS 34.229-1 clause A.7.5
            spare1 := '0'B,
            tP_UserDataHeaderIndicator := '0'B,
            tP_StatusReportQualifier := '0'B,
            spare2 := '00'B,
            tP_MoreMessagesToSend := '0'B,
            tP_MessageTypeIndicator := c_MT_SMS_STATUS_REPORT,
            tP_MessageReference := p_MessageRef,
            tP_RecipientAddress := p_RA,
            tP_ServiceCentreTimeStamp := p_SCTP,
            tP_DischargeTime := '00000000000000'H,
            tP_Status := {
                reserved := '0'B,
                status := '0000000'B
            },
            tP_ParameterIndicator := m_TP_ParameterIndicator,
            tP_ProtocolIdentifier := m_TP_ProtocolIdentifier,
            tP_DataCodingScheme_Type := omit,
            tP_UserDataLength := omit,
            tP_UserData := omit
        }





    /* End SM-TP PDU Constraints */
    } // group SMS_Templates_Group
Yann Garcia's avatar
Yann Garcia committed
} // End of module LibSip_SMSTypesAndValues