Search in sources :

Example 11 with RfAccountingRequest

use of net.java.slee.resource.diameter.rf.events.RfAccountingRequest in project jain-slee.diameter by RestComm.

the class RfMessageFactoryImpl method createRfAccountingRequest.

public RfAccountingRequest createRfAccountingRequest(AccountingRecordType accountingrecordtype) {
    DiameterAvp[] avps = new DiameterAvp[] {};
    RfAccountingRequest acr = (RfAccountingRequest) createRfAccountingMessage(null, avps);
    if (this.sessionId != null) {
        acr.setSessionId(sessionId);
    }
    // acr.setAcctApplicationId(_RF_ACC_APP_ID);
    acr.setAccountingRecordType(accountingrecordtype);
    return acr;
}
Also used : DiameterAvp(net.java.slee.resource.diameter.base.events.avp.DiameterAvp) RfAccountingRequest(net.java.slee.resource.diameter.rf.events.RfAccountingRequest)

Example 12 with RfAccountingRequest

use of net.java.slee.resource.diameter.rf.events.RfAccountingRequest in project jain-slee.diameter by RestComm.

the class RfServerSessionActivityImpl method createRfAccountingAnswer.

public RfAccountingAnswer createRfAccountingAnswer() {
    RfAccountingAnswer answer = null;
    for (int index = 0; index < stateMessages.size(); index++) {
        if (stateMessages.get(index).getCommand().getCode() == RfAccountingRequest.commandCode) {
            RfAccountingRequest msg = (RfAccountingRequest) stateMessages.get(index);
            answer = createRfAccountingAnswer(msg);
            if (!answer.hasSessionId() && session != null) {
                answer.setSessionId(session.getSessionId());
            }
            ((DiameterMessageImpl) answer).setData(msg);
            break;
        }
    }
    return answer;
}
Also used : RfAccountingAnswer(net.java.slee.resource.diameter.rf.events.RfAccountingAnswer) RfAccountingRequest(net.java.slee.resource.diameter.rf.events.RfAccountingRequest) DiameterMessageImpl(org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl)

Aggregations

RfAccountingRequest (net.java.slee.resource.diameter.rf.events.RfAccountingRequest)12 Test (org.junit.Test)8 BaseFactoriesTest (org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)8 RfAccountingAnswer (net.java.slee.resource.diameter.rf.events.RfAccountingAnswer)4 ApplicationId (org.jdiameter.api.ApplicationId)2 RfMessageFactoryImpl (org.mobicents.slee.resource.diameter.rf.RfMessageFactoryImpl)2 OperationNotSupportedException (javax.naming.OperationNotSupportedException)1 InvalidConfigurationException (javax.slee.resource.InvalidConfigurationException)1 Transaction (javax.transaction.Transaction)1 CreateActivityException (net.java.slee.resource.diameter.base.CreateActivityException)1 DiameterAvp (net.java.slee.resource.diameter.base.events.avp.DiameterAvp)1 AvpDataException (org.jdiameter.api.AvpDataException)1 IllegalDiameterStateException (org.jdiameter.api.IllegalDiameterStateException)1 InternalException (org.jdiameter.api.InternalException)1 DiameterMessageImpl (org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl)1 RfServerSessionActivityImpl (org.mobicents.slee.resource.diameter.rf.RfServerSessionActivityImpl)1