Search in sources :

Example 1 with UpdateLocationAnswer

use of net.java.slee.resource.diameter.s6a.events.UpdateLocationAnswer in project jain-slee.diameter by RestComm.

the class S6aFactoriesTest method hasDestinationRealmULA.

@Test
public void hasDestinationRealmULA() throws Exception {
    UpdateLocationRequest ulr = s6aMessageFactory.createUpdateLocationRequest();
    serverSession.fetchSessionData(ulr);
    UpdateLocationAnswer ula = serverSession.createUpdateLocationAnswer();
    assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", ula.getDestinationRealm());
}
Also used : UpdateLocationAnswer(net.java.slee.resource.diameter.s6a.events.UpdateLocationAnswer) UpdateLocationRequest(net.java.slee.resource.diameter.s6a.events.UpdateLocationRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 2 with UpdateLocationAnswer

use of net.java.slee.resource.diameter.s6a.events.UpdateLocationAnswer in project jain-slee.diameter by RestComm.

the class S6aFactoriesTest method isProxiableCopiedULA.

@Test
public void isProxiableCopiedULA() throws Exception {
    UpdateLocationRequest ulr = s6aMessageFactory.createUpdateLocationRequest();
    serverSession.fetchSessionData(ulr);
    UpdateLocationAnswer ula = serverSession.createUpdateLocationAnswer();
    assertEquals("The 'P' bit is not copied from request in Location-Info-Answer, it should. [RFC3588/6.2]", ulr.getHeader().isProxiable(), ula.getHeader().isProxiable());
    // Reverse 'P' bit ...
    ((DiameterMessageImpl) ulr).getGenericData().setProxiable(!ulr.getHeader().isProxiable());
    assertTrue("The 'P' bit was not modified in Update-Location-Request, it should.", ulr.getHeader().isProxiable() != ula.getHeader().isProxiable());
    serverSession.fetchSessionData(ulr);
    ula = serverSession.createUpdateLocationAnswer();
    assertEquals("The 'P' bit is not copied from request in Update-Location-Answer, it should. [RFC3588/6.2]", ulr.getHeader().isProxiable(), ula.getHeader().isProxiable());
}
Also used : UpdateLocationAnswer(net.java.slee.resource.diameter.s6a.events.UpdateLocationAnswer) UpdateLocationRequest(net.java.slee.resource.diameter.s6a.events.UpdateLocationRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 3 with UpdateLocationAnswer

use of net.java.slee.resource.diameter.s6a.events.UpdateLocationAnswer in project jain-slee.diameter by RestComm.

the class S6aFactoriesTest method isAnswerULA.

@Test
public void isAnswerULA() throws Exception {
    UpdateLocationRequest ulr = s6aMessageFactory.createUpdateLocationRequest();
    serverSession.fetchSessionData(ulr);
    UpdateLocationAnswer ula = serverSession.createUpdateLocationAnswer();
    assertFalse("Request Flag in Update-Location-Answer is set.", ula.getHeader().isRequest());
}
Also used : UpdateLocationAnswer(net.java.slee.resource.diameter.s6a.events.UpdateLocationAnswer) UpdateLocationRequest(net.java.slee.resource.diameter.s6a.events.UpdateLocationRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 4 with UpdateLocationAnswer

use of net.java.slee.resource.diameter.s6a.events.UpdateLocationAnswer in project jain-slee.diameter by RestComm.

the class S6aFactoriesTest method testGroupedChildAVPsULA.

@Test
public // Test for http://code.google.com/p/mobicents/issues/detail?id=3096
void testGroupedChildAVPsULA() throws Exception {
    UpdateLocationRequest ulr = s6aMessageFactory.createUpdateLocationRequest();
    serverSession.fetchSessionData(ulr);
    UpdateLocationAnswer ula = serverSession.createUpdateLocationAnswer();
    SubscriptionDataAvp sd = s6aAvpFactory.createSubscriptionData();
    // AMBR
    AMBRAvp ambr = s6aAvpFactory.createAMBR();
    ambr.setMaxRequestedBandwidthDL(12L);
    ambr.setMaxRequestedBandwidthUL(6L);
    sd.setAMBR(ambr);
    // APNConfigurationProfile
    APNConfigurationProfileAvp apnCP = s6aAvpFactory.createAPNConfigurationProfile();
    apnCP.setAllAPNConfigurationsIncludedIndicator(AllAPNConfigurationsIncludedIndicator.ALL_APN_CONFIGURATIONS_INCLUDED);
    APNConfigurationAvp apnC = s6aAvpFactory.createAPNConfiguration();
    apnC.setContextIdentifier(123L);
    apnC.setPDNType(PDNType.IPv4_OR_IPv6);
    apnC.setServiceSelection("...");
    apnCP.setAPNConfiguration(apnC);
    sd.setAPNConfigurationProfile(apnCP);
    ula.setSubscriptionData(sd);
}
Also used : UpdateLocationAnswer(net.java.slee.resource.diameter.s6a.events.UpdateLocationAnswer) UpdateLocationRequest(net.java.slee.resource.diameter.s6a.events.UpdateLocationRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 5 with UpdateLocationAnswer

use of net.java.slee.resource.diameter.s6a.events.UpdateLocationAnswer in project jain-slee.diameter by RestComm.

the class S6aServerSessionImpl method createUpdateLocationAnswer.

public UpdateLocationAnswer createUpdateLocationAnswer() {
    // Make sure we have the correct type of Request
    if (!(lastRequest instanceof UpdateLocationRequest)) {
        logger.warn("Invalid type of answer for this activity.");
        return null;
    }
    try {
        // Create the answer
        UpdateLocationAnswer aia = (UpdateLocationAnswer) this.s6aMessageFactory.createS6aMessage(lastRequest.getHeader(), new DiameterAvp[] {}, UpdateLocationAnswer.COMMAND_CODE, s6aMessageFactory.getApplicationId());
        // Fill session related AVPs, if present
        fillSessionAVPs(aia);
        return aia;
    } catch (InternalException e) {
        logger.error("Failed to create Update-Location-Answer.", e);
    }
    return null;
}
Also used : DiameterAvp(net.java.slee.resource.diameter.base.events.avp.DiameterAvp) UpdateLocationAnswer(net.java.slee.resource.diameter.s6a.events.UpdateLocationAnswer) UpdateLocationRequest(net.java.slee.resource.diameter.s6a.events.UpdateLocationRequest) InternalException(org.jdiameter.api.InternalException)

Aggregations

UpdateLocationAnswer (net.java.slee.resource.diameter.s6a.events.UpdateLocationAnswer)9 UpdateLocationRequest (net.java.slee.resource.diameter.s6a.events.UpdateLocationRequest)9 Test (org.junit.Test)8 BaseFactoriesTest (org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)8 DiameterAvp (net.java.slee.resource.diameter.base.events.avp.DiameterAvp)1 ApplicationId (org.jdiameter.api.ApplicationId)1 InternalException (org.jdiameter.api.InternalException)1 S6aMessageFactoryImpl (org.mobicents.slee.resource.diameter.s6a.S6aMessageFactoryImpl)1