Search in sources :

Example 11 with RfAccountingAnswer

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

the class RfServerSessionActivityImpl method sendRfAccountingAnswer.

public void sendRfAccountingAnswer(RfAccountingAnswer answer) throws IOException {
    try {
        RfAccountingAnswerImpl aca = (RfAccountingAnswerImpl) answer;
        this.serverSession.sendAccountAnswer(new org.jdiameter.common.impl.app.rf.RfAccountingAnswerImpl((Answer) aca.getGenericData()));
        // FIXME: check this?
        if (isTerminateAfterProcessing()) {
            endActivity();
        // this.serverSession.release();
        // 
        // if(!serverSession.isValid()) {
        // String sessionId =
        // this.serverSession.getSessions().get(0).getSessionId();
        // this.baseListener.sessionDestroyed(sessionId,
        // this.serverSession);
        // }
        }
        // clean
        clean(aca);
    } catch (org.jdiameter.api.validation.AvpNotAllowedException e) {
        throw new AvpNotAllowedException("Message validation failed.", e, e.getAvpCode(), e.getVendorId());
    } catch (Exception e) {
        if (logger.isDebugEnabled()) {
            logger.debug("Failed to send message, due to: ", e);
        }
        throw new IOException("Failed to send message, due to: " + e.getMessage());
    }
}
Also used : RfAccountingAnswer(net.java.slee.resource.diameter.rf.events.RfAccountingAnswer) Answer(org.jdiameter.api.Answer) IOException(java.io.IOException) AvpNotAllowedException(net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException) RfAccountingAnswerImpl(org.mobicents.slee.resource.diameter.rf.events.RfAccountingAnswerImpl) IOException(java.io.IOException) AvpNotAllowedException(net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)

Aggregations

RfAccountingAnswer (net.java.slee.resource.diameter.rf.events.RfAccountingAnswer)11 Test (org.junit.Test)8 BaseFactoriesTest (org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)8 RfAccountingRequest (net.java.slee.resource.diameter.rf.events.RfAccountingRequest)4 IOException (java.io.IOException)1 AvpNotAllowedException (net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)1 Answer (org.jdiameter.api.Answer)1 ApplicationId (org.jdiameter.api.ApplicationId)1 DiameterMessageImpl (org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl)1 RfMessageFactoryImpl (org.mobicents.slee.resource.diameter.rf.RfMessageFactoryImpl)1 RfServerSessionActivityImpl (org.mobicents.slee.resource.diameter.rf.RfServerSessionActivityImpl)1 RfAccountingAnswerImpl (org.mobicents.slee.resource.diameter.rf.events.RfAccountingAnswerImpl)1