Search in sources :

Example 1 with AbortSessionAnswer

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());
}
Also used : AbortSessionAnswer(net.java.slee.resource.diameter.base.events.AbortSessionAnswer) Test(org.junit.Test)

Example 2 with AbortSessionAnswer

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());
}
Also used : AbortSessionAnswer(net.java.slee.resource.diameter.base.events.AbortSessionAnswer) Test(org.junit.Test)

Example 3 with AbortSessionAnswer

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;
}
Also used : AbortSessionAnswer(net.java.slee.resource.diameter.base.events.AbortSessionAnswer)

Example 4 with AbortSessionAnswer

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());
    }
}
Also used : ReAuthAnswer(net.java.slee.resource.diameter.base.events.ReAuthAnswer) AbortSessionAnswer(net.java.slee.resource.diameter.base.events.AbortSessionAnswer) Answer(org.jdiameter.api.Answer) AbortSessionAnswerImpl(org.jdiameter.common.impl.app.auth.AbortSessionAnswerImpl) IOException(java.io.IOException) DiameterMessageImpl(org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl) AvpNotAllowedException(net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException) IOException(java.io.IOException) AvpNotAllowedException(net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)

Example 5 with AbortSessionAnswer

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());
}
Also used : AbortSessionRequest(net.java.slee.resource.diameter.base.events.AbortSessionRequest) AbortSessionAnswer(net.java.slee.resource.diameter.base.events.AbortSessionAnswer) Test(org.junit.Test)

Aggregations

AbortSessionAnswer (net.java.slee.resource.diameter.base.events.AbortSessionAnswer)8 Test (org.junit.Test)6 AbortSessionRequest (net.java.slee.resource.diameter.base.events.AbortSessionRequest)2 IOException (java.io.IOException)1 ReAuthAnswer (net.java.slee.resource.diameter.base.events.ReAuthAnswer)1 AvpNotAllowedException (net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)1 Answer (org.jdiameter.api.Answer)1 AbortSessionAnswerImpl (org.jdiameter.common.impl.app.auth.AbortSessionAnswerImpl)1 DiameterMessageImpl (org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl)1