use of org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl in project jain-slee.diameter by RestComm.
the class AuthClientSessionActivityImpl method sendReAuthAnswer.
public void sendReAuthAnswer(ReAuthAnswer answer) throws IOException {
try {
// super.sendMessage(answer);
DiameterMessageImpl msg = (DiameterMessageImpl) answer;
this.clientSession.sendReAuthAnswer(new ReAuthAnswerImpl((Answer) msg.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 org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl 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 org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl in project jain-slee.diameter by RestComm.
the class CxDxServerSessionImpl method sendRegistrationTerminationRequest.
/*
* (non-Javadoc)
* @see net.java.slee.resource.diameter.cxdx.CxDxServerSession#sendRegistrationTerminationRequest(net.java.slee.resource.diameter.cxdx.events.RegistrationTerminationRequest)
*/
public void sendRegistrationTerminationRequest(RegistrationTerminationRequest registrationTerminationRequest) throws IOException {
DiameterMessageImpl msg = (DiameterMessageImpl) registrationTerminationRequest;
JRegistrationTerminationRequestImpl request = new JRegistrationTerminationRequestImpl(msg.getGenericData());
try {
appSession.sendRegistrationTerminationRequest(request);
} catch (org.jdiameter.api.validation.AvpNotAllowedException anae) {
throw new AvpNotAllowedException(anae.getMessage(), anae.getAvpCode(), anae.getVendorId());
} catch (Exception e) {
if (logger.isDebugEnabled()) {
logger.debug("Failed to send message.", e);
}
throw new IOException(e.getMessage());
}
}
use of org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl in project jain-slee.diameter by RestComm.
the class GxClientSessionActivityImpl method sendUpdateGxCreditControlRequest.
/*
* (non-Javadoc)
* @see net.java.slee.resource.diametergx.GxClientSessionActivity#sendUpdateRoCreditControlRequest(net.java.slee.resource.diameter.gx.events.GxCreditControlRequest)
*/
public void sendUpdateGxCreditControlRequest(final GxCreditControlRequest ccr) throws IOException {
// FIXME: Should this come already in the CCR?
validateState(ccr);
final DiameterMessageImpl msg = (DiameterMessageImpl) ccr;
try {
session.sendCreditControlRequest(new GxCreditControlRequestImpl((Request) msg.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);
}
}
use of org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl in project jain-slee.diameter by RestComm.
the class AvpFlagsTest method testCorrectFlagsSupportedFeatures.
@Test
public void testCorrectFlagsSupportedFeatures() {
List<DiameterAvp> avps = new ArrayList<DiameterAvp>();
DiameterAvp avpFeatureListID = AvpUtilities.createAvp(Avp.FEATURE_LIST_ID, TGPP_VENDOR_ID, 1);
avps.add(AvpUtilities.createAvp(Avp.SUPPORTED_FEATURES, TGPP_VENDOR_ID, new DiameterAvp[] { avpFeatureListID }));
GxCreditControlRequest ccr = gxMessageFactory.createGxCreditControlRequest();
GxCreditControlAnswer cca = gxMessageFactory.createGxCreditControlAnswer(ccr);
cca.setExtensionAvps(avps.toArray(avps.toArray(new DiameterAvp[avps.size()])));
Message msg = ((DiameterMessageImpl) cca).getGenericData();
AvpUtilities.addAvp(msg, Avp.SUPPORTED_FEATURES, TGPP_VENDOR_ID, msg.getAvps(), new DiameterAvp[] { avpFeatureListID });
// Attribute Name AVP Code Section Value Type Must May Should not Must not May Encr.
// Supported-Features 628 6.3.29 Grouped V M - - - No
ArrayList<String> failures = checkAvpFlags(msg.getAvps());
if (failures.size() > 0) {
System.err.println("The following AVPs flags have failed to check against dictionary:");
for (String failure : failures) {
System.err.println(failure);
}
Assert.fail(failures.toString());
}
}
Aggregations