public void sendAccountingAnswer(AccountingAnswer answer) throws IOException {
try {
AccountingAnswerImpl aca = (AccountingAnswerImpl) answer;
this.serverSession.sendAccountAnswer(new AccountAnswerImpl((Answer) aca.getGenericData()));
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());
}
}