use of net.java.slee.resource.diameter.base.events.avp.DiameterAvp in project charging-server by RestComm.
the class DiameterChargingServerSbb method buildCCInfo.
private CreditControlInfo buildCCInfo(RoCreditControlRequest ccr, String endUserId, SubscriptionIdType endUserType, ArrayList<CreditControlUnit> ccUnits) {
// Build Credit Control Info Request to ABMF
CreditControlInfo ccInfo = new CreditControlInfo();
ccInfo.setEventTimestamp(System.currentTimeMillis());
CcRequestType type = ccr.getCcRequestType();
ccInfo.setEventType(type.toString());
if (type == CcRequestType.EVENT_REQUEST) {
ccInfo.setRequestedAction(ccr.getRequestedAction());
}
ccInfo.setRequestNumber((int) ccr.getCcRequestNumber());
ccInfo.setSessionId(ccr.getSessionId());
ccInfo.setSubscriptionId(endUserId);
ccInfo.setSubscriptionIdType(endUserType);
ccInfo.setCcUnits(ccUnits);
// Iterate CCR to capture needed AVPs
for (DiameterAvp avp : ccr.getAvps()) {
fetchDataFromAvp(avp, ccInfo);
}
return ccInfo;
}
use of net.java.slee.resource.diameter.base.events.avp.DiameterAvp in project jain-slee.diameter by RestComm.
the class S6aClientSessionImpl method createCancelLocationAnswer.
public CancelLocationAnswer createCancelLocationAnswer() {
// Make sure we have the correct type of Request
if (!(lastRequest instanceof CancelLocationRequest)) {
logger.warn("Invalid type of answer for this activity.");
return null;
}
try {
// Create the answer
CancelLocationAnswer cla = (CancelLocationAnswer) this.s6aMessageFactory.createS6aMessage(lastRequest.getHeader(), new DiameterAvp[] {}, CancelLocationAnswer.COMMAND_CODE, s6aMessageFactory.getApplicationId());
// Fill session related AVPs, if present
fillSessionAVPs(cla);
return cla;
} catch (InternalException e) {
logger.error("Failed to create Cancel-Location-Answer.", e);
}
return null;
}
use of net.java.slee.resource.diameter.base.events.avp.DiameterAvp in project jain-slee.diameter by RestComm.
the class S6aClientSessionImpl method createInsertSubscriberDataAnswer.
public InsertSubscriberDataAnswer createInsertSubscriberDataAnswer() {
// Make sure we have the correct type of Request
if (!(lastRequest instanceof InsertSubscriberDataRequest)) {
logger.warn("Invalid type of answer for this activity.");
return null;
}
try {
// Create the answer
InsertSubscriberDataAnswer ida = (InsertSubscriberDataAnswer) this.s6aMessageFactory.createS6aMessage(lastRequest.getHeader(), new DiameterAvp[] {}, InsertSubscriberDataAnswer.COMMAND_CODE, s6aMessageFactory.getApplicationId());
// Fill session related AVPs, if present
fillSessionAVPs(ida);
return ida;
} catch (InternalException e) {
logger.error("Failed to create Insert-Subscriber-Data-Answer.", e);
}
return null;
}
use of net.java.slee.resource.diameter.base.events.avp.DiameterAvp in project jain-slee.diameter by RestComm.
the class S6aClientSessionImpl method createResetAnswer.
public ResetAnswer createResetAnswer() {
// Make sure we have the correct type of Request
if (!(lastRequest instanceof ResetRequest)) {
logger.warn("Invalid type of answer for this activity.");
return null;
}
try {
// Create the answer
ResetAnswer rsa = (ResetAnswer) this.s6aMessageFactory.createS6aMessage(lastRequest.getHeader(), new DiameterAvp[] {}, ResetAnswer.COMMAND_CODE, s6aMessageFactory.getApplicationId());
// Fill session related AVPs, if present
fillSessionAVPs(rsa);
return rsa;
} catch (InternalException e) {
logger.error("Failed to create Reset-Answer.", e);
}
return null;
}
use of net.java.slee.resource.diameter.base.events.avp.DiameterAvp 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;
}
Aggregations