Search in sources :

Example 46 with Message

use of org.jdiameter.api.Message in project jain-slee.diameter by RestComm.

the class GqMessageFactoryImpl method createGqAbortSessionRequest.

@Override
public GqAbortSessionRequest createGqAbortSessionRequest(String sessionId) {
    Message raw = createRequest(GqAbortSessionRequest.COMMAND_CODE, new DiameterAvp[] {});
    GqAbortSessionRequest asr = new GqAbortSessionRequestImpl(raw);
    asr.setSessionId(sessionId);
    addOrigin(asr);
    return asr;
}
Also used : GqAbortSessionRequestImpl(org.mobicents.slee.resource.diameter.gq.events.GqAbortSessionRequestImpl) Message(org.jdiameter.api.Message) DiameterMessage(net.java.slee.resource.diameter.base.events.DiameterMessage) GqAbortSessionRequest(net.java.slee.resource.diameter.gq.events.GqAbortSessionRequest)

Example 47 with Message

use of org.jdiameter.api.Message in project jain-slee.diameter by RestComm.

the class GqMessageFactoryImpl method createGqSessionTerminationRequest.

@Override
public GqSessionTerminationRequest createGqSessionTerminationRequest() {
    Message raw = createRequest(GqSessionTerminationRequest.COMMAND_CODE, new DiameterAvp[] {});
    GqSessionTerminationRequest str = new GqSessionTerminationRequestImpl(raw);
    if (sessionId != null) {
        str.setSessionId(sessionId);
    }
    addOrigin(str);
    return str;
}
Also used : GqSessionTerminationRequestImpl(org.mobicents.slee.resource.diameter.gq.events.GqSessionTerminationRequestImpl) GqSessionTerminationRequest(net.java.slee.resource.diameter.gq.events.GqSessionTerminationRequest) Message(org.jdiameter.api.Message) DiameterMessage(net.java.slee.resource.diameter.base.events.DiameterMessage)

Example 48 with Message

use of org.jdiameter.api.Message in project jain-slee.diameter by RestComm.

the class GqMessageFactoryImpl method createGqAbortSessionRequest.

@Override
public GqAbortSessionRequest createGqAbortSessionRequest() {
    Message raw = createRequest(GqAbortSessionRequest.COMMAND_CODE, new DiameterAvp[] {});
    GqAbortSessionRequest asr = new GqAbortSessionRequestImpl(raw);
    if (sessionId != null) {
        asr.setSessionId(sessionId);
    }
    addOrigin(asr);
    return asr;
}
Also used : GqAbortSessionRequestImpl(org.mobicents.slee.resource.diameter.gq.events.GqAbortSessionRequestImpl) Message(org.jdiameter.api.Message) DiameterMessage(net.java.slee.resource.diameter.base.events.DiameterMessage) GqAbortSessionRequest(net.java.slee.resource.diameter.gq.events.GqAbortSessionRequest)

Example 49 with Message

use of org.jdiameter.api.Message in project jain-slee.diameter by RestComm.

the class GqMessageFactoryImpl method createGqAARequest.

@Override
public GqAARequest createGqAARequest(String sessionId) {
    Message raw = createRequest(GqAARequest.COMMAND_CODE, new DiameterAvp[] {});
    GqAARequest aar = new GqAARequestImpl(raw);
    aar.setSessionId(sessionId);
    addOrigin(aar);
    return aar;
}
Also used : Message(org.jdiameter.api.Message) DiameterMessage(net.java.slee.resource.diameter.base.events.DiameterMessage) GqAARequestImpl(org.mobicents.slee.resource.diameter.gq.events.GqAARequestImpl) GqAARequest(net.java.slee.resource.diameter.gq.events.GqAARequest)

Example 50 with Message

use of org.jdiameter.api.Message in project jain-slee.diameter by RestComm.

the class GqMessageFactoryImpl method createGqAbortSessionAnswer.

@Override
public GqAbortSessionAnswer createGqAbortSessionAnswer(GqAbortSessionRequest asr) {
    Message raw = createMessage(asr.getHeader(), new DiameterAvp[] {});
    // this should be different ...
    raw.setRequest(false);
    // just in case. answers never have T flag set
    raw.setReTransmitted(false);
    GqAbortSessionAnswerImpl asa = new GqAbortSessionAnswerImpl(raw);
    asa.getGenericData().getAvps().removeAvp(DiameterAvpCodes.DESTINATION_HOST);
    asa.getGenericData().getAvps().removeAvp(DiameterAvpCodes.DESTINATION_REALM);
    asa.getGenericData().getAvps().removeAvp(DiameterAvpCodes.ORIGIN_HOST);
    asa.getGenericData().getAvps().removeAvp(DiameterAvpCodes.ORIGIN_REALM);
    asa.setSessionId(asr.getSessionId());
    addOrigin(asa);
    return asa;
}
Also used : Message(org.jdiameter.api.Message) DiameterMessage(net.java.slee.resource.diameter.base.events.DiameterMessage) GqAbortSessionAnswerImpl(org.mobicents.slee.resource.diameter.gq.events.GqAbortSessionAnswerImpl)

Aggregations

Message (org.jdiameter.api.Message)61 DiameterMessage (net.java.slee.resource.diameter.base.events.DiameterMessage)56 DiameterAvp (net.java.slee.resource.diameter.base.events.avp.DiameterAvp)22 NoSuchAvpException (net.java.slee.resource.diameter.base.NoSuchAvpException)10 AvpNotAllowedException (net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)10 AvpSet (org.jdiameter.api.AvpSet)8 ArrayList (java.util.ArrayList)7 IllegalDiameterStateException (org.jdiameter.api.IllegalDiameterStateException)7 InternalException (org.jdiameter.api.InternalException)7 ErrorAnswerImpl (org.mobicents.slee.resource.diameter.base.events.ErrorAnswerImpl)7 GxCreditControlMessage (net.java.slee.resource.diameter.gx.events.GxCreditControlMessage)5 GxReAuthMessage (net.java.slee.resource.diameter.gx.events.GxReAuthMessage)5 RoCreditControlMessage (net.java.slee.resource.diameter.ro.events.RoCreditControlMessage)4 DiameterMessageImpl (org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl)4 ExtensionDiameterMessageImpl (org.mobicents.slee.resource.diameter.base.events.ExtensionDiameterMessageImpl)4 IOException (java.io.IOException)3 AccountingAnswerImpl (org.mobicents.slee.resource.diameter.base.events.AccountingAnswerImpl)3 GqAARequestImpl (org.mobicents.slee.resource.diameter.gq.events.GqAARequestImpl)3 GqAbortSessionRequestImpl (org.mobicents.slee.resource.diameter.gq.events.GqAbortSessionRequestImpl)3 GqReAuthRequestImpl (org.mobicents.slee.resource.diameter.gq.events.GqReAuthRequestImpl)3