use of org.restcomm.protocols.ss7.map.api.MAPException in project smscgateway by RestComm.
the class HrSriClientSbb method setupRoutingInfoForSMRequestIndication.
private MAPDialogSms setupRoutingInfoForSMRequestIndication(String destinationAddress, int ton, int npi, MAPApplicationContext mapApplicationContext, int networkId) throws MAPException {
// this.mapParameterFactory.creat
String hlrAddress = destinationAddress;
String hrHlrNumber = smscPropertiesManagement.getHrHlrNumber(networkId);
if (hrHlrNumber != null && hrHlrNumber.length() > 0) {
hlrAddress = hrHlrNumber;
}
SccpAddress destinationAddr = this.convertAddressFieldToSCCPAddress(hlrAddress, ton, npi);
MAPDialogSms mapDialogSms = this.mapProvider.getMAPServiceSms().createNewDialog(mapApplicationContext, this.getServiceCenterSccpAddress(networkId), null, destinationAddr, null);
mapDialogSms.setNetworkId(networkId);
ISDNAddressString isdn = this.getCalledPartyISDNAddressString(destinationAddress, ton, npi);
AddressString serviceCenterAddress = this.getServiceCenterAddressString(networkId);
boolean sm_RP_PRI = true;
mapDialogSms.addSendRoutingInfoForSMRequest(isdn, sm_RP_PRI, serviceCenterAddress, null, false, null, null, null, false, null, false, false, null, null);
if (this.logger.isInfoEnabled())
this.logger.info("Home routing: HrSriClientSbb: Sending: SendRoutingInfoForSMRequest: isdn=" + isdn + ", serviceCenterAddress=" + serviceCenterAddress + ", sm_RP_PRI=" + sm_RP_PRI);
return mapDialogSms;
}
use of org.restcomm.protocols.ss7.map.api.MAPException 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.MAPException 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.MAPException 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.MAPException 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