Search in sources :

Example 1 with AccountAnswerImpl

use of org.jdiameter.common.impl.app.acc.AccountAnswerImpl in project jain-slee.diameter by RestComm.

the class AccountingServerSessionActivityImpl method sendAccountingAnswer.

public void sendAccountingAnswer(AccountingAnswer answer) throws IOException {
    try {
        AccountingAnswerImpl aca = (AccountingAnswerImpl) answer;
        this.serverSession.sendAccountAnswer(new AccountAnswerImpl((Answer) aca.getGenericData()));
        // FIXME: check this?
        if (this.serverSession.isStateless()) {
            endActivity();
        } else if (aca.getAccountingRecordType() == AccountingRecordType.STOP_RECORD) {
            endActivity();
        }
    } 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 : AccountingAnswer(net.java.slee.resource.diameter.base.events.AccountingAnswer) Answer(org.jdiameter.api.Answer) AccountingAnswerImpl(org.mobicents.slee.resource.diameter.base.events.AccountingAnswerImpl) AccountAnswerImpl(org.jdiameter.common.impl.app.acc.AccountAnswerImpl) IOException(java.io.IOException) AvpNotAllowedException(net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException) IOException(java.io.IOException) AvpNotAllowedException(net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)

Aggregations

IOException (java.io.IOException)1 AccountingAnswer (net.java.slee.resource.diameter.base.events.AccountingAnswer)1 AvpNotAllowedException (net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)1 Answer (org.jdiameter.api.Answer)1 AccountAnswerImpl (org.jdiameter.common.impl.app.acc.AccountAnswerImpl)1 AccountingAnswerImpl (org.mobicents.slee.resource.diameter.base.events.AccountingAnswerImpl)1