use of org.jdiameter.api.Message in project jain-slee.diameter by RestComm.
the class RfSessionActivityImpl method sendSyncMessage.
@Override
public DiameterMessage sendSyncMessage(DiameterMessage message) {
DiameterMessage answer = null;
Message receivedMessage = doSendMessage(message);
if (receivedMessage != null) {
if (!receivedMessage.isRequest()) {
if (receivedMessage.isError()) {
answer = new ErrorAnswerImpl(receivedMessage);
} else {
switch(receivedMessage.getCommandCode()) {
case RfAccountingRequest.commandCode:
answer = new RfAccountingRequestImpl(receivedMessage);
break;
default:
logger.error("Received an unknown type of Message for Rf Activity: " + receivedMessage);
break;
}
}
} else {
logger.error("Received a REQUEST message when expecting an ANSWER.");
}
} else {
logger.debug("No answer received. Returning null.");
}
return answer;
}
Aggregations