Rev

Rev 601 | Details | Compare with Previous | Last modification | View Log | SVN | Bug Tracker

Rev Author Line No. Line
520 garciay 1
/*
601 nikolajev 2
 *  @author     STF 435
520 garciay 3
 *  @version    $Id$
601 nikolajev 4
 *  @desc       This module provides the functions used by the test component
520 garciay 5
 *              for SIP-SMS over IMS as specified in 3GPP 24.341 tests.
534 rennoch 6
 *              This module is part of LibSipV2.
520 garciay 7
 */
8
module LibSip_SMSFunctions {
9
    import from LibSip_SMSTypesAndValues all;
599 tepelmann 10
 
600 nikolajev 11
    function f_IA5_2oct(
12
        charstring p_ASCII_String
13
    ) return octetstring  {
520 garciay 14
        var integer i;
607 nikolajev 15
        var integer j;
520 garciay 16
        var integer v_Length := lengthof(p_ASCII_String);
599 tepelmann 17
        var integer v_Temp;
18
        var octetstring v_Noctets := ''O;
19
        var bitstring v_TempBitSrc := ''B;
20
        var bitstring v_TempBitDes := ''B;
21
 
22
        if ((v_Length <= 0) or (v_Length > 160) or (((v_Length * 7) mod 8) != 0)) {
607 nikolajev 23
            log("*** " & __SCOPE__ & "INFO: Invalid value of input string length ***");
520 garciay 24
        }
599 tepelmann 25
 
26
        for (i := 0; i < v_Length; i := i + 1) {
520 garciay 27
            v_Temp := char2int(p_ASCII_String[i]);
599 tepelmann 28
            v_TempBitSrc := int2bit(v_Temp, 8);
29
 
607 nikolajev 30
            for (j := 1; j <= 7; j := j + 1) {
599 tepelmann 31
 
607 nikolajev 32
                v_TempBitDes := v_TempBitSrc[8 - j] & v_TempBitDes;
599 tepelmann 33
 
607 nikolajev 34
                if (((7 * i + j) mod 8) == 0) {
599 tepelmann 35
 
520 garciay 36
                    v_Noctets := v_Noctets & bit2oct(v_TempBitDes);
37
                    v_TempBitDes := ''B;
38
                }
39
            }
40
        }
599 tepelmann 41
 
520 garciay 42
        return v_Noctets;
43
    } // f_IA5_2oct
599 tepelmann 44
 
600 nikolajev 45
    external function fx_GetSC_TimeStamp(
46
        integer p_TimeZone
47
    ) return TP_ServiceCentreTimeStamp_Type;
520 garciay 48
} // End of module LibSip_SMSFunctions