DiameterRfRo_Templates.ttcn 432 KB
Newer Older
         * @desc Calculate the length of the Message_Body_AVP to set up the Diameter header
         * @param p_content_Type    TODO
         * @param p_content_Length  TODO
         * 
         * @see ETSI TS 132 299 V10.15.0 Clause 7.2.103 Message-Body AVP
         * @see ETSI TS 132 299 V10.15.0 Table 7.1: Use Of IETF Diameter AVPs
         */
        function f_getMessageBodyAVPLength(
                                           in template (value) Content_Type_AVP     p_content_Type,
                                           in template (value) Content_Length_AVP   p_content_Length
        ) return AVP_Length {
            var AVP_Length v_length := f_getEncvalueLength(encvalue(p_content_Type)) + f_getEncvalueLength(encvalue(p_content_Length));
            
            return v_length;
        } // End of function f_getMessageBodyAVPLength
        
        /**
         * @desc Calculate the length of the SDP_TimeStamps_AVP to set up the Diameter header
         * @param p_sdp_Offer_Timestamp_AVP  TODO
         * @param p_sdp_Answer_Timestamp_AVP TODO
         * 
         * @see ETSI TS 132 299 V10.15.0 Clause 7.2.58  Early-Media-Description AVP
         * @see ETSI TS 132 299 V10.15.0 Table 7.1: Use Of IETF Diameter AVPs
         */
        function f_getSDPTimeStampsAVPLength(
                                             in template (omit) SDP_Offer_Timestamp_AVP  p_sdp_Offer_Timestamp,
                                             in template (omit) SDP_Answer_Timestamp_AVP p_sdp_Answer_Timestamp
        ) return AVP_Length {
            var AVP_Length v_length := 0;
            if (ispresent(p_sdp_Offer_Timestamp)) {
                v_length := v_length + f_getEncvalueLength(encvalue(p_sdp_Offer_Timestamp));
            }
            if (ispresent(p_sdp_Answer_Timestamp)) {
                v_length := v_length + f_getEncvalueLength(encvalue(p_sdp_Answer_Timestamp));
            }
            
            return v_length;
        } // End of function f_getSDPTimeStampsAVPLength
        
garciay's avatar
garciay committed
        /**
         * @desc Calculate the length of the Service_Generic_Information_AVP to set up the Diameter header
         * @param p_application_Server_ID    TODO
         * @param p_application_Service_Type TODO
         * @param p_application_Session_ID   TODO
         * @param p_delivery_Status          TODO
         * 
         * @see ETSI TS 132 299 V10.15.0 Clause 7.2.191 Service-Generic-Information AVP
         * @see ETSI TS 132 299 V10.15.0 Table 7.1: Use Of IETF Diameter AVPs
         * @see OMA-DDS-Charging_Data-V1_0-20110201-A
         */
        function f_getServiceGenericInformationAVPLength(
                                                         in template (omit) Application_Server_ID_AVP      p_application_Server_ID,
                                                         in template (omit) Application_Service_Type_AVP   p_application_Service_Type,
                                                         in template (omit) Application_Session_ID_AVP     p_application_Session_ID,
                                                         in template (omit) Delivery_Status_AVP            p_delivery_Status
        ) return AVP_Length {
            var AVP_Length v_length := 0;
            if (ispresent(p_application_Server_ID)) {
                v_length := v_length + f_getEncvalueLength(encvalue(p_application_Server_ID));
            }
            if (ispresent(p_application_Service_Type)) {
                v_length := v_length + f_getEncvalueLength(encvalue(p_application_Service_Type));
            }
            if (ispresent(p_application_Session_ID)) {
                v_length := v_length + f_getEncvalueLength(encvalue(p_application_Session_ID));
            }
            if (ispresent(p_delivery_Status)) {
                v_length := v_length + f_getEncvalueLength(encvalue(p_delivery_Status));
            }
            
            return v_length;
        } // End of function f_getServiceGenericInformationAVPLength
        
        function f_getCCMoneyAVPLength(
                                       in template (value) Unit_Value_AVP   p_unit_Value,
                                       in template (omit) Currency_Code_AVP p_currency_Code
        ) return AVP_Length {
            var AVP_Length v_length := f_getEncvalueLength(encvalue(p_unit_Value));
            if (ispresent(p_currency_Code)) {
                v_length := v_length + f_getEncvalueLength(encvalue(p_currency_Code));
            }
            
            return v_length;
        } // End of function f_getCCMoneyAVPLength
        
        function f_getCostInformationAVPLength(
                                               in template (value) Unit_Value_AVP      p_unit_Value,
                                               in template (value) Currency_Code_AVP   p_currency_Code,
                                               in template (omit) Cost_Unit_AVP        p_cost_Unit
        ) return AVP_Length {
            var AVP_Length v_length := f_getEncvalueLength(encvalue(p_unit_Value)) + f_getEncvalueLength(encvalue(p_currency_Code));
            if (ispresent(p_cost_Unit)) {
                v_length := v_length + f_getEncvalueLength(encvalue(p_cost_Unit));
            }
            
            return v_length;
        } // End of function f_getCostInformationAVPLength
        
    } // End of group functionsForTemplates
    
} // End of module DiameterRfRo_Templates