use of org.mobicents.smsc.library.SmsSet in project smscgateway by RestComm.
the class SriSbb method onDialogProviderAbort.
@Override
public void onDialogProviderAbort(DialogProviderAbort evt, ActivityContextInterface aci) {
try {
super.onDialogProviderAbort(evt, aci);
MAPAbortProviderReason abortProviderReason = evt.getAbortProviderReason();
SmsSet smsSet = getSmsSet();
if (smsSet == null) {
logger.severe("SriSbb.onDialogProviderAbort(): CMP smsSet is missed");
markDeliveringIsEnded(true);
return;
}
this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.HLR_REJECT_AFTER_ROUTING_INFO, "onDialogProviderAbort after SRI Request: " + abortProviderReason != null ? abortProviderReason.toString() : "", true, null, false, ProcessingType.SS7_SRI);
} catch (Throwable e1) {
logger.severe("Exception in SriSbb.onDialogProviderAbort() when fetching records and issuing events: " + e1.getMessage(), e1);
markDeliveringIsEnded(true);
}
}
use of org.mobicents.smsc.library.SmsSet in project smscgateway by RestComm.
the class SriSbb method onDialogReject.
// *********
// MAP Dialog events
@Override
public void onDialogReject(DialogReject evt, ActivityContextInterface aci) {
try {
MAPRefuseReason mapRefuseReason = evt.getRefuseReason();
SmsSet smsSet = getSmsSet();
if (smsSet == null) {
logger.severe("SriSbb.onDialogReject(): CMP smsSet is missed");
markDeliveringIsEnded(true);
return;
}
if (mapRefuseReason == MAPRefuseReason.PotentialVersionIncompatibility && evt.getMAPDialog().getApplicationContext().getApplicationContextVersion() != MAPApplicationContextVersion.version1) {
if (logger.isWarningEnabled()) {
this.logger.warning("Rx : Sri onDialogReject / PotentialVersionIncompatibility=" + evt);
}
// possible a peer supports only MAP V1
// Now send new SRI with supported ACN (MAP V1)
this.sendSRI(smsSet, smsSet.getDestAddr(), smsSet.getDestAddrTon(), smsSet.getDestAddrNpi(), this.getSRIMAPApplicationContext(MAPApplicationContextVersion.version1));
return;
}
// If ACN not supported, lets use the new one suggested
if (mapRefuseReason == MAPRefuseReason.ApplicationContextNotSupported) {
if (logger.isWarningEnabled()) {
this.logger.warning("Rx : Sri onDialogReject / ApplicationContextNotSupported=" + evt);
}
// Now send new SRI with supported ACN
ApplicationContextName tcapApplicationContextName = evt.getAlternativeApplicationContext();
MAPApplicationContext supportedMAPApplicationContext = MAPApplicationContext.getInstance(tcapApplicationContextName.getOid());
this.sendSRI(smsSet, smsSet.getDestAddr(), smsSet.getDestAddrTon(), smsSet.getDestAddrNpi(), this.getSRIMAPApplicationContext(supportedMAPApplicationContext.getApplicationContextVersion()));
return;
}
super.onDialogReject(evt, aci);
this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.HLR_REJECT_AFTER_ROUTING_INFO, "onDialogReject after SRI Request: " + mapRefuseReason != null ? mapRefuseReason.toString() : "", true, null, false, ProcessingType.SS7_SRI);
} catch (Throwable e1) {
logger.severe("Exception in SriSbb.onDialogReject() when fetching records and issuing events: " + e1.getMessage(), e1);
markDeliveringIsEnded(true);
}
}
use of org.mobicents.smsc.library.SmsSet in project smscgateway by RestComm.
the class SriSbb method onSriFullResponse.
private void onSriFullResponse() {
SendRoutingInfoForSMResponse sendRoutingInfoForSMResponse = this.getSendRoutingInfoForSMResponse();
MAPErrorMessage errorMessage = this.getErrorResponse();
SmsSet smsSet = getSmsSet();
if (smsSet == null) {
logger.severe("SriSbb.onSriFullResponse(): CMP smsSet is missed");
markDeliveringIsEnded(true);
return;
}
if (sendRoutingInfoForSMResponse != null) {
// we have positive response to SRI request -
// we will try to send messages
// storing SRI response results into a cache firstly
SriResponseValue sriResponseValue = new SriResponseValue(smsSet.getTargetId(), smsSet.getNetworkId(), smsSet.getDestAddr(), smsSet.getDestAddrTon(), smsSet.getDestAddrNpi(), sendRoutingInfoForSMResponse.getLocationInfoWithLMSI(), sendRoutingInfoForSMResponse.getIMSI().getData());
try {
SmsSetCache.getInstance().putSriResponseValue(sriResponseValue, smscPropertiesManagement.getSriResponseLiveTime());
} catch (Exception e1) {
// no actions in failure
}
executeForwardSM(smsSet, sendRoutingInfoForSMResponse.getLocationInfoWithLMSI(), sendRoutingInfoForSMResponse.getIMSI().getData(), smsSet.getNetworkId());
return;
}
if (errorMessage != null) {
// we have a negative response
if (errorMessage.isEmAbsentSubscriber()) {
this.onDeliveryError(smsSet, ErrorAction.mobileNotReachableFlag, ErrorCode.ABSENT_SUBSCRIBER, "AbsentSubscriber response from HLR: " + errorMessage.toString(), true, errorMessage, false, ProcessingType.SS7_SRI);
} else if (errorMessage.isEmAbsentSubscriberSM()) {
this.onDeliveryError(smsSet, ErrorAction.mobileNotReachableFlag, ErrorCode.ABSENT_SUBSCRIBER, "AbsentSubscriberSM response from HLR: " + errorMessage.toString(), true, errorMessage, false, ProcessingType.SS7_SRI);
} else if (errorMessage.isEmCallBarred()) {
this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.CALL_BARRED, "CallBarred response from HLR: " + errorMessage.toString(), true, errorMessage, false, ProcessingType.SS7_SRI);
} else if (errorMessage.isEmFacilityNotSup()) {
this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.FACILITY_NOT_SUPPORTED, "FacilityNotSuppored response from HLR: " + errorMessage.toString(), true, errorMessage, false, ProcessingType.SS7_SRI);
} else if (errorMessage.isEmSystemFailure()) {
// TODO: may be systemFailure is not a permanent error case ?
this.onDeliveryError(smsSet, ErrorAction.temporaryFailure, ErrorCode.SYSTEM_FAILURE, "SystemFailure response from HLR: " + errorMessage.toString(), true, errorMessage, false, ProcessingType.SS7_SRI);
} else if (errorMessage.isEmUnknownSubscriber()) {
this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.UNKNOWN_SUBSCRIBER, "UnknownSubscriber response from HLR: " + errorMessage.toString(), true, errorMessage, false, ProcessingType.SS7_SRI);
} else if (errorMessage.isEmExtensionContainer()) {
if (errorMessage.getEmExtensionContainer().getErrorCode() == MAPErrorCode.dataMissing) {
this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.DATA_MISSING, "DataMissing response from HLR", true, errorMessage, false, ProcessingType.SS7_SRI);
} else if (errorMessage.getEmExtensionContainer().getErrorCode() == MAPErrorCode.unexpectedDataValue) {
this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.UNEXPECTED_DATA, "UnexpectedDataValue response from HLR", true, errorMessage, false, ProcessingType.SS7_SRI);
} else if (errorMessage.getEmExtensionContainer().getErrorCode() == MAPErrorCode.teleserviceNotProvisioned) {
this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.TELESERVICE_NOT_PROVISIONED, "TeleserviceNotProvisioned response from HLR", true, errorMessage, false, ProcessingType.SS7_SRI);
} else {
this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.UNEXPECTED_DATA_FROM_HLR, "Error response from HLR: " + errorMessage.toString(), true, errorMessage, false, ProcessingType.SS7_SRI);
}
} else {
this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.UNEXPECTED_DATA_FROM_HLR, "Error response from HLR: " + errorMessage.toString(), true, errorMessage, false, ProcessingType.SS7_SRI);
}
} else {
// we have no responses - this is an error behaviour
this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.HLR_REJECT_AFTER_ROUTING_INFO, "Empty response after SRI Request", false, null, false, ProcessingType.SS7_SRI);
}
}
use of org.mobicents.smsc.library.SmsSet in project smscgateway by RestComm.
the class SriSbb method onRejectComponent.
@Override
public void onRejectComponent(RejectComponent event, ActivityContextInterface aci) {
super.onRejectComponent(event, aci);
String reason = this.getRejectComponentReason(event);
SmsSet smsSet = getSmsSet();
if (smsSet == null) {
logger.severe("SriSbb.onRejectComponent(): CMP smsSet is missed");
markDeliveringIsEnded(true);
return;
}
this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.HLR_REJECT_AFTER_ROUTING_INFO, "onRejectComponent after SRI Request: " + reason != null ? reason.toString() : "", true, null, false, ProcessingType.SS7_SRI);
}
use of org.mobicents.smsc.library.SmsSet in project smscgateway by RestComm.
the class RxSipServerSbb method onSipSm.
// *********
// initial event
public void onSipSm(SmsSetEvent event, ActivityContextInterface aci, EventContext eventContext) {
try {
if (this.logger.isFineEnabled()) {
this.logger.fine("\nReceived SIP SMS. event= " + event + "this=" + this);
}
SmsSet smsSet = event.getSmsSet();
this.addInitialMessageSet(smsSet);
try {
this.sendMessage(smsSet);
} catch (SmscProcessingException e) {
String s = "SmscProcessingException when sending SIP MESSAGE=" + e.getMessage() + ", smsSet=" + smsSet;
logger.severe(s, e);
this.onDeliveryError(smsSet, ErrorAction.temporaryFailure, ErrorCode.SC_SYSTEM_ERROR, s);
}
} catch (Throwable e1) {
logger.severe("Exception in RxSmppServerSbb.onDeliverSm() when fetching records and issuing events: " + e1.getMessage(), e1);
markDeliveringIsEnded(true);
}
}
Aggregations