Navigation


Changeset 277:c94e4ea39f97 in freeDiameter


Ignore:
Timestamp:
Apr 23, 2010, 2:33:26 PM (14 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Add missing mandatory AVP

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/app_radgw/rgwx_acct.c

    r275 r277  
    5252struct rgwp_config {
    5353        struct {
     54                struct dict_object * Accounting_Record_Number;  /* Accounting-Record-Number */
    5455                struct dict_object * Accounting_Record_Type;    /* Accounting-Record-Type */
    5556                struct dict_object * Acct_Application_Id;       /* Acct-Application-Id */
     
    175176       
    176177        /* Resolve all dictionary objects we use */
     178        CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Accounting-Record-Number", &new->dict.Accounting_Record_Number, ENOENT) );
    177179        CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Accounting-Record-Type", &new->dict.Accounting_Record_Type, ENOENT) );
    178180        CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Acct-Application-Id", &new->dict.Acct_Application_Id, ENOENT) );
     
    288290        int send_str=0;
    289291        uint32_t str_cause=0;
     292        uint32_t e2eid = 0;
    290293        application_id_t auth_appl=0;
    291294        int got_id = 0;
     
    428431                CHECK_FCT( fd_msg_avp_setvalue ( avp, &value ) );
    429432                CHECK_FCT( fd_msg_avp_add ( *diam_fw, MSG_BRW_LAST_CHILD, avp) );
     433               
     434                /* save the end to end id */
     435                e2eid = header->msg_eteid;
    430436        }
    431437       
     
    736742                                CHECK_FCT( fd_msg_avp_setvalue ( avp, &value ) );
    737743                                CHECK_FCT( fd_msg_avp_add ( *diam_fw, MSG_BRW_LAST_CHILD, avp) );
     744                               
     745                                /* While here, we also add the Accouting-Record-Number AVP.
     746                                   We don't have a dedicated counter nor a state, so we just use the Diameter message End-to-end id here, which fits the conditions on the value. */
     747                                CHECK_FCT( fd_msg_avp_new ( cs->dict.Accounting_Record_Number, 0, &avp ) );
     748                                value.u32 = e2eid;
     749                                CHECK_FCT( fd_msg_avp_setvalue ( avp, &value ) );
     750                                CHECK_FCT( fd_msg_avp_add ( *diam_fw, MSG_BRW_LAST_CHILD, avp) );
     751                               
    738752                                break;
    739753                       
Note: See TracChangeset for help on using the changeset viewer.