use of org.mobicents.smsc.slee.services.smpp.server.events.InformServiceCenterContainer in project smscgateway by RestComm.
the class MtSbb method setupReportSMDeliveryStatusRequestSuccess.
private void setupReportSMDeliveryStatusRequestSuccess(SmsSet smsSet, boolean versionMore1) {
InformServiceCenterContainer informServiceCenterContainer = this.getInformServiceCenterContainer();
if (informServiceCenterContainer != null && informServiceCenterContainer.getMwStatus() != null && informServiceCenterContainer.getMwStatus().getScAddressNotIncluded() == false && versionMore1) {
// sending a report to HLR of a success delivery
Sms sms0 = smsSet.getSms(0);
String mtLocalSccpGt = null;
Integer mtRemoteSccpTt = null;
if (sms0 != null) {
mtLocalSccpGt = sms0.getMtLocalSccpGt();
mtRemoteSccpTt = sms0.getMtRemoteSccpTt();
}
this.setupReportSMDeliveryStatusRequest(smsSet.getDestAddr(), smsSet.getDestAddrTon(), smsSet.getDestAddrNpi(), SMDeliveryOutcome.successfulTransfer, smsSet.getTargetId(), smsSet.getNetworkId(), mtLocalSccpGt, mtRemoteSccpTt);
}
}
use of org.mobicents.smsc.slee.services.smpp.server.events.InformServiceCenterContainer in project smscgateway by RestComm.
the class SriSbb method onInformServiceCentreRequest.
public void onInformServiceCentreRequest(InformServiceCentreRequest evt, ActivityContextInterface aci) {
if (this.logger.isInfoEnabled()) {
this.logger.info("\nReceived INFORM_SERVICE_CENTER_REQUEST = " + evt + " Dialog=" + evt.getMAPDialog());
}
InformServiceCenterContainer informServiceCenterContainer = new InformServiceCenterContainer();
informServiceCenterContainer.setMwStatus(evt.getMwStatus());
this.setInformServiceCenterContainer(informServiceCenterContainer);
}
use of org.mobicents.smsc.slee.services.smpp.server.events.InformServiceCenterContainer in project smscgateway by RestComm.
the class SriSbb method onSms.
// *********
// initial event
public void onSms(SmsSetEvent event, ActivityContextInterface aci, EventContext eventContext) {
SmsSet smsSet = event.getSmsSet();
this.addInitialMessageSet(smsSet);
try {
if (this.logger.isFineEnabled()) {
this.logger.fine("\nReceived Submit SMS. event= " + event + "this=" + this);
}
smscStatAggregator.updateMsgOutTryAll();
smscStatAggregator.updateMsgOutTrySs7();
if (smsSet.getDestAddrTon() == SmppConstants.TON_ALPHANUMERIC) {
// bad TON at the destination address: alphanumerical is not supported
this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.BAD_TYPE_OF_NUMBER, "TON \"alhpanumerical\" is not supported for as a destination address", true, null, false, ProcessingType.SS7_SRI);
return;
}
if (smsSet.getDestAddrTon() != SmppConstants.TON_UNKNOWN && smsSet.getDestAddrTon() != SmppConstants.TON_INTERNATIONAL && smsSet.getDestAddrTon() != SmppConstants.TON_NATIONAL && smsSet.getDestAddrTon() != SmppConstants.TON_SUBSCRIBER) {
// we support only following TON for a dest address
this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.BAD_TYPE_OF_NUMBER, "TON " + smsSet.getDestAddrTon() + " is not supported for as a destination address", true, null, false, ProcessingType.SS7_SRI);
return;
}
if (smsSet.getDestAddrNpi() != SmppConstants.NPI_UNKNOWN && smsSet.getDestAddrNpi() != SmppConstants.NPI_E164 && smsSet.getDestAddrNpi() != SmppConstants.NPI_X121 && smsSet.getDestAddrNpi() != SmppConstants.NPI_TELEX && smsSet.getDestAddrNpi() != SmppConstants.NPI_LAND_MOBILE) {
// we support only following TON for a dest address
this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.BAD_NPI, "NPI " + smsSet.getDestAddrNpi() + " is not supported for as a destination address", true, null, false, ProcessingType.SS7_SRI);
return;
}
Sms sms = this.obtainNextMessage(ProcessingType.SS7_SRI);
if (sms == null) {
// this means that no messages with good ScheduleDeliveryTime or
// no messages at all we have to reschedule
this.markDeliveringIsEnded(true);
return;
}
// checking for correlationId - may be we do not need SRI
String correlationID = smsSet.getCorrelationId();
CorrelationIdValue civ = null;
if (correlationID != null) {
civ = SmsSetCache.getInstance().getCorrelationIdCacheElement(correlationID);
if (this.logger.isFineEnabled()) {
this.logger.fine("HomeRouting: correlationID=" + correlationID + ", found CorrelationIdValue=" + civ);
}
}
if (civ != null && civ.getLocationInfoWithLMSI() != null && civ.getImsi() != null) {
// preloaded routing info is found - skip SRI request
MWStatus mwStatus = civ.getMwStatus();
if (mwStatus != null) {
InformServiceCenterContainer informServiceCenterContainer = new InformServiceCenterContainer();
informServiceCenterContainer.setMwStatus(mwStatus);
this.setInformServiceCenterContainer(informServiceCenterContainer);
}
this.setSriMapVersion(civ.getSriMapVersion());
this.executeForwardSM(smsSet, civ.getLocationInfoWithLMSI(), civ.getImsi(), smsSet.getNetworkId());
return;
}
// checking for cached - may be we do not need SRI
String targetID = smsSet.getTargetId();
SriResponseValue srv = null;
srv = SmsSetCache.getInstance().getSriResponseValue(targetID);
if (this.logger.isFineEnabled()) {
this.logger.fine("SRI requesting: targetID=" + targetID + ", found cached SriResponseValue=" + srv);
}
if (srv != null) {
// preloaded routing info is found - skip SRI request
this.setSriMapVersion(3);
this.executeForwardSM(smsSet, srv.getLocationInfoWithLMSI(), srv.getImsi(), smsSet.getNetworkId());
return;
}
// no preloaded routing info
this.sendSRI(smsSet, smsSet.getDestAddr(), smsSet.getDestAddrTon(), smsSet.getDestAddrNpi(), this.getSRIMAPApplicationContext(this.maxMAPApplicationContextVersion));
} catch (Throwable e1) {
String s = "Exception in SriSbb.onSms when fetching records and issuing events: " + e1.getMessage();
logger.severe(s, e1);
markDeliveringIsEnded(true);
// this.onDeliveryError(smsSet, ErrorAction.temporaryFailure, ErrorCode.SC_SYSTEM_ERROR, s, true, null, false);
}
}
use of org.mobicents.smsc.slee.services.smpp.server.events.InformServiceCenterContainer in project smscgateway by RestComm.
the class SriSbb method onErrorComponent.
// *********
// MAP Component events
@Override
public void onErrorComponent(ErrorComponent event, ActivityContextInterface aci) {
super.onErrorComponent(event, aci);
try {
// we store error into CMP
MAPErrorMessage mapErrorMessage = event.getMAPErrorMessage();
this.setErrorResponse(mapErrorMessage);
if (mapErrorMessage.isEmAbsentSubscriber()) {
MAPErrorMessageAbsentSubscriber errAs = mapErrorMessage.getEmAbsentSubscriber();
Boolean mwdSet = errAs.getMwdSet();
if (mwdSet != null && mwdSet) {
InformServiceCenterContainer informServiceCenterContainer = new InformServiceCenterContainer();
MWStatus mwStatus = event.getMAPDialog().getService().getMAPProvider().getMAPParameterFactory().createMWStatus(false, true, false, false);
informServiceCenterContainer.setMwStatus(mwStatus);
this.setInformServiceCenterContainer(informServiceCenterContainer);
}
}
} catch (Throwable e1) {
logger.severe("Exception in SriSbb.onErrorComponent when fetching records and issuing events: " + e1.getMessage(), e1);
}
}
use of org.mobicents.smsc.slee.services.smpp.server.events.InformServiceCenterContainer in project smscgateway by RestComm.
the class SriSbb method onSendRoutingInfoForSMResponse.
/**
* Received response for SRI sent earlier
*
* @param evt
* @param aci
*/
public void onSendRoutingInfoForSMResponse(SendRoutingInfoForSMResponse evt, ActivityContextInterface aci) {
if (this.logger.isFineEnabled()) {
this.logger.fine("\nReceived SEND_ROUTING_INFO_FOR_SM_RESPONSE = " + evt + " Dialog=" + evt.getMAPDialog());
}
if (evt.getMAPDialog().getApplicationContext().getApplicationContextVersion() == MAPApplicationContextVersion.version1 && evt.getMwdSet() != null && evt.getMwdSet()) {
InformServiceCenterContainer informServiceCenterContainer = new InformServiceCenterContainer();
MWStatus mwStatus = evt.getMAPDialog().getService().getMAPProvider().getMAPParameterFactory().createMWStatus(false, true, false, false);
informServiceCenterContainer.setMwStatus(mwStatus);
this.setInformServiceCenterContainer(informServiceCenterContainer);
}
this.setSendRoutingInfoForSMResponse(evt);
}
Aggregations