LibSip_SMSFunctions.ttcn3 1.54 KB
Newer Older
 *  @author     STF 435, 471
nikolajev's avatar
nikolajev committed
 *  @desc       This module provides the functions 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_SMSFunctions {
    import from LibSip_SMSTypesAndValues all;
tepelmann's avatar
tepelmann committed

    function f_IA5_2oct(
        charstring p_ASCII_String
    ) return octetstring  {
        var integer j;
        var integer v_Length := lengthof(p_ASCII_String);
tepelmann's avatar
tepelmann committed
        var integer v_Temp;
        var octetstring v_Noctets := ''O;
        var bitstring v_TempBitSrc := ''B;
        var bitstring v_TempBitDes := ''B;

        if ((v_Length <= 0) or (v_Length > 160) or (((v_Length * 7) mod 8) != 0)) {
            log("*** " & __SCOPE__ & "INFO: Invalid value of input string length ***");
tepelmann's avatar
tepelmann committed

        for (i := 0; i < v_Length; i := i + 1) {
tepelmann's avatar
tepelmann committed
            v_TempBitSrc := int2bit(v_Temp, 8);

            for (j := 1; j <= 7; j := j + 1) {
tepelmann's avatar
tepelmann committed

                v_TempBitDes := v_TempBitSrc[8 - j] & v_TempBitDes;
tepelmann's avatar
tepelmann committed

                if (((7 * i + j) mod 8) == 0) {
tepelmann's avatar
tepelmann committed

                    v_Noctets := v_Noctets & bit2oct(v_TempBitDes);
                    v_TempBitDes := ''B;
                }
            }
        }
tepelmann's avatar
tepelmann committed

tepelmann's avatar
tepelmann committed

    external function fx_GetSC_TimeStamp(
        integer p_TimeZone
    ) return TP_ServiceCentreTimeStamp_Type;