Search in sources :

Example 51 with Message

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

the class GqMessageFactoryImpl method createMessage.

public Message createMessage(DiameterHeader header, DiameterAvp[] avps) throws AvpNotAllowedException {
    Message msg = createRawMessage(header);
    AvpSet set = msg.getAvps();
    for (DiameterAvp avp : avps) {
        addAvp(avp, set);
    }
    return msg;
}
Also used : Message(org.jdiameter.api.Message) DiameterMessage(net.java.slee.resource.diameter.base.events.DiameterMessage) DiameterAvp(net.java.slee.resource.diameter.base.events.avp.DiameterAvp) AvpSet(org.jdiameter.api.AvpSet)

Example 52 with Message

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

the class GqMessageFactoryImpl method createGqReAuthRequest.

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

Example 53 with Message

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

the class GqMessageFactoryImpl method createGqSessionTerminationAnswer.

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

Example 54 with Message

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

the class GqMessageFactoryImpl method createGqReAuthRequest.

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

Example 55 with Message

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

the class GqMessageFactoryImpl method createGqAARequest.

@Override
public GqAARequest createGqAARequest() {
    Message raw = createRequest(GqAARequest.COMMAND_CODE, new DiameterAvp[] {});
    GqAARequest aar = new GqAARequestImpl(raw);
    if (sessionId != null) {
        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)

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