use of net.java.slee.resource.diameter.base.events.AbortSessionAnswer in project jain-slee.diameter by RestComm.
the class BaseFactoriesTest method hasDestinationRealmASA.
@Test
public void hasDestinationRealmASA() throws Exception {
AbortSessionAnswer asa = messageFactory.createAbortSessionAnswer(messageFactory.createAbortSessionRequest());
assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", asa.getDestinationRealm());
}
use of net.java.slee.resource.diameter.base.events.AbortSessionAnswer in project jain-slee.diameter by RestComm.
the class BaseFactoriesTest method isAnswerASA.
@Test
public void isAnswerASA() throws Exception {
AbortSessionAnswer asa = messageFactory.createAbortSessionAnswer(messageFactory.createAbortSessionRequest());
assertFalse("Request Flag in Abort-Session-Answer is set.", asa.getHeader().isRequest());
}
use of net.java.slee.resource.diameter.base.events.AbortSessionAnswer in project jain-slee.diameter by RestComm.
the class DiameterMessageFactoryImpl method createAbortSessionAnswer.
public AbortSessionAnswer createAbortSessionAnswer(AbortSessionRequest request, DiameterAvp[] avps) throws AvpNotAllowedException {
AbortSessionAnswer msg = (AbortSessionAnswer) this.createDiameterMessage(request.getHeader(), avps, Message.ABORT_SESSION_ANSWER, getApplicationId(request));
// Add Session-Id AVP if not present
addSessionIdAvp(msg);
return msg;
}
use of net.java.slee.resource.diameter.base.events.AbortSessionAnswer in project jain-slee.diameter by RestComm.
the class AuthClientSessionActivityImpl method sendAbortSessionAnswer.
public void sendAbortSessionAnswer(AbortSessionAnswer answer) throws IOException {
try {
// super.sendMessage(answer);
DiameterMessageImpl asa = (DiameterMessageImpl) answer;
this.clientSession.sendAbortSessionAnswer(new AbortSessionAnswerImpl((Answer) asa.getGenericData()));
} catch (org.jdiameter.api.validation.AvpNotAllowedException e) {
throw new AvpNotAllowedException("Message validation failed.", e, e.getAvpCode(), e.getVendorId());
} catch (Exception e) {
throw new IOException("Failed to send message, due to: " + e.getMessage());
}
}
use of net.java.slee.resource.diameter.base.events.AbortSessionAnswer in project jain-slee.diameter by RestComm.
the class BaseFactoriesTest method isProxiableCopiedASA.
@Test
public void isProxiableCopiedASA() throws Exception {
AbortSessionRequest asr = messageFactory.createAbortSessionRequest();
AbortSessionAnswer asa = messageFactory.createAbortSessionAnswer(asr);
assertEquals("The 'P' bit is not copied from request in Abort-Session-Answer, it should. [RFC3588/6.2]", asr.getHeader().isProxiable(), asa.getHeader().isProxiable());
// Reverse 'P' bit ...
((DiameterMessageImpl) asr).getGenericData().setProxiable(!asr.getHeader().isProxiable());
assertTrue("The 'P' bit was not modified in Abort-Session-Request, it should.", asr.getHeader().isProxiable() != asa.getHeader().isProxiable());
asa = messageFactory.createAbortSessionAnswer(asr);
assertEquals("The 'P' bit is not copied from request in Abort-Session-Answer, it should. [RFC3588/6.2]", asr.getHeader().isProxiable(), asa.getHeader().isProxiable());
}
Aggregations