use of org.restcomm.protocols.ss7.map.api.service.sms.MAPDialogSms in project smscgateway by RestComm.
the class HrSriServerSbb method onSriHrByPass.
@Override
public void onSriHrByPass(CorrelationIdValue correlationIdValue) {
MAPDialogSms dlg = this.getActivity();
if (dlg == null) {
this.logger.severe("Home routing: can not get MAPDialog for sending SRI hrByPass Response");
return;
}
smscStatAggregator.updateMsgInHrSriHrByPass();
StringBuilder sb = new StringBuilder();
sb.append("Home routing: bypassing of Home routing: procedure: transaction: ");
sb.append(correlationIdValue);
if (this.logger.isInfoEnabled())
this.logger.info(sb.toString());
// sending original SRI response
try {
SendRoutingInfoForSMResponse sendRoutingInfoForSMResponse = correlationIdValue.getSendRoutingInfoForSMResponse();
this.doSendResponse(correlationIdValue, dlg, sendRoutingInfoForSMResponse.getIMSI().getData(), sendRoutingInfoForSMResponse.getLocationInfoWithLMSI());
} catch (MAPException e) {
if (dlg != null) {
dlg.release();
}
String reason = "Home routing: MAPException when sending SRI bypassing of Home routing: " + e.toString();
this.logger.severe(reason, e);
}
}
use of org.restcomm.protocols.ss7.map.api.service.sms.MAPDialogSms in project smscgateway by RestComm.
the class HrSriServerSbb method onSendRoutingInfoForSMRequest.
/**
* MAP SMS Events
*/
/**
* Received SRI request. But this is error, we should never receive this
* request
*
* @param evt
* @param aci
*/
public void onSendRoutingInfoForSMRequest(SendRoutingInfoForSMRequest evt, ActivityContextInterface aci) {
if (this.logger.isInfoEnabled()) {
this.logger.info("Home routing: HrSriServerSbb: Received SEND_ROUTING_INFO_FOR_SM_REQUEST = " + evt + " Dialog=" + evt.getMAPDialog());
}
this.setInvokeId(evt.getInvokeId());
MAPDialogSms dialog = evt.getMAPDialog();
// we are changing here SSN in CallingPartyAddress of a SRI response to HLR SSN
// because it is possible that this address has been updated inside SCCP routing procedure
// when a message came to SMSC
// TODO: check if it is a proper solution ?
SccpAddress locAddr = dialog.getLocalAddress();
SccpAddress locAddr2 = sccpParameterFact.createSccpAddress(locAddr.getAddressIndicator().getRoutingIndicator(), locAddr.getGlobalTitle(), locAddr.getSignalingPointCode(), smscPropertiesManagement.getHlrSsn());
dialog.setLocalAddress(locAddr2);
if (smscPropertiesManagement.getHrCharging() == MoChargingType.reject) {
try {
MAPErrorMessage errorMessage = this.mapProvider.getMAPErrorMessageFactory().createMAPErrorMessageFacilityNotSup(null, null, null);
dialog.sendErrorComponent(evt.getInvokeId(), errorMessage);
if (this.logger.isInfoEnabled()) {
this.logger.info("Home routing: Sent ErrorComponent = " + errorMessage);
}
if (smscPropertiesManagement.isGenerateRejectionCdr()) {
generateCDR(dialog.getNetworkId(), CdrGenerator.CDR_SUBMIT_FAILED_HR, errorMessage.toString(), true);
}
dialog.close(false);
return;
} catch (Throwable e) {
logger.severe("Home routing: Error while sending Error message", e);
return;
}
}
setupSriRequest(evt.getMsisdn(), evt.getServiceCentreAddress(), dialog.getNetworkId(), dialog.getRemoteAddress());
}
use of org.restcomm.protocols.ss7.map.api.service.sms.MAPDialogSms in project smscgateway by RestComm.
the class MAPListener method onSendRoutingInfoForSMRequest.
@Override
public void onSendRoutingInfoForSMRequest(SendRoutingInfoForSMRequest event) {
if (logger.isInfoEnabled()) {
logger.info("Rx : SendRoutingInfoForSMRequestIndication=" + event);
}
IMSI imsi = new IMSIImpl("410035001692061");
ISDNAddressString nnn = new ISDNAddressStringImpl(AddressNature.international_number, NumberingPlan.ISDN, "923330052001");
LocationInfoWithLMSI li = new LocationInfoWithLMSIImpl(nnn, null, null, false, null);
MAPDialogSms mapDialogSms = event.getMAPDialog();
try {
mapDialogSms.addSendRoutingInfoForSMResponse(event.getInvokeId(), imsi, li, null, null, null);
// mapDialogSms.close(false);
} catch (MAPException e) {
e.printStackTrace();
}
mapDialogSms.setUserObject(true);
}
use of org.restcomm.protocols.ss7.map.api.service.sms.MAPDialogSms in project smscgateway by RestComm.
the class MAPListener method onMoForwardShortMessageRequest.
@Override
public void onMoForwardShortMessageRequest(MoForwardShortMessageRequest request) {
if (logger.isDebugEnabled()) {
logger.debug("Rx : MoForwardShortMessageRequestIndication=" + request);
}
MAPDialogSms dialog = request.getMAPDialog();
try {
// TODO Should we add PENDING SMS TPDU here itself?
dialog.addMoForwardShortMessageResponse(request.getInvokeId(), null, null);
// dialog.close(false);
} catch (MAPException e) {
logger.error("Error while sending MoForwardShortMessageResponse ", e);
}
dialog.setUserObject(true);
try {
SmsSignalInfo smsSignalInfo = request.getSM_RP_UI();
SmsTpdu smsTpdu = smsSignalInfo.decodeTpdu(true);
if (smsTpdu.getSmsTpduType() != SmsTpduType.SMS_SUBMIT) {
// TODO : Error, we should always receive SMS_SUBMIT for
// MoForwardShortMessageRequestIndication
logger.error("Rx : MoForwardShortMessageRequestIndication, but SmsTpduType is not SMS_SUBMIT. SmsTpdu=" + smsTpdu);
return;
}
SmsSubmitTpdu smsSubmitTpdu = (SmsSubmitTpdu) smsTpdu;
AddressField destinationAddress = smsSubmitTpdu.getDestinationAddress();
// TODO Normalize
} catch (MAPException e1) {
logger.error("Error while decoding SmsSignalInfo ", e1);
}
}
use of org.restcomm.protocols.ss7.map.api.service.sms.MAPDialogSms in project smscgateway by RestComm.
the class MAPListener method onReportSMDeliveryStatusRequest.
@Override
public void onReportSMDeliveryStatusRequest(ReportSMDeliveryStatusRequest event) {
if (logger.isInfoEnabled()) {
logger.info("Rx : ReportSMDeliveryStatusRequest=" + event);
}
MAPDialogSms dialog = event.getMAPDialog();
try {
dialog.addReportSMDeliveryStatusResponse(event.getInvokeId(), event.getMsisdn(), null);
// dialog.close(false);
} catch (MAPException e) {
e.printStackTrace();
}
dialog.setUserObject(true);
}
Aggregations