Search in sources :

Example 21 with MAPDialogSms

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);
    }
}
Also used : MAPDialogSms(org.restcomm.protocols.ss7.map.api.service.sms.MAPDialogSms) MAPException(org.restcomm.protocols.ss7.map.api.MAPException) ISDNAddressString(org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString) AddressString(org.restcomm.protocols.ss7.map.api.primitives.AddressString) SendRoutingInfoForSMResponse(org.restcomm.protocols.ss7.map.api.service.sms.SendRoutingInfoForSMResponse)

Example 22 with MAPDialogSms

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());
}
Also used : SccpAddress(org.restcomm.protocols.ss7.sccp.parameter.SccpAddress) MAPDialogSms(org.restcomm.protocols.ss7.map.api.service.sms.MAPDialogSms) MAPErrorMessage(org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessage)

Example 23 with MAPDialogSms

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);
}
Also used : LocationInfoWithLMSI(org.restcomm.protocols.ss7.map.api.service.sms.LocationInfoWithLMSI) ISDNAddressStringImpl(org.restcomm.protocols.ss7.map.primitives.ISDNAddressStringImpl) IMSIImpl(org.restcomm.protocols.ss7.map.primitives.IMSIImpl) MAPDialogSms(org.restcomm.protocols.ss7.map.api.service.sms.MAPDialogSms) MAPException(org.restcomm.protocols.ss7.map.api.MAPException) IMSI(org.restcomm.protocols.ss7.map.api.primitives.IMSI) ISDNAddressString(org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString) LocationInfoWithLMSIImpl(org.restcomm.protocols.ss7.map.service.sms.LocationInfoWithLMSIImpl)

Example 24 with MAPDialogSms

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);
    }
}
Also used : AddressField(org.restcomm.protocols.ss7.map.api.smstpdu.AddressField) SmsSignalInfo(org.restcomm.protocols.ss7.map.api.service.sms.SmsSignalInfo) MAPDialogSms(org.restcomm.protocols.ss7.map.api.service.sms.MAPDialogSms) MAPException(org.restcomm.protocols.ss7.map.api.MAPException) SmsTpdu(org.restcomm.protocols.ss7.map.api.smstpdu.SmsTpdu) SmsSubmitTpdu(org.restcomm.protocols.ss7.map.api.smstpdu.SmsSubmitTpdu)

Example 25 with MAPDialogSms

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);
}
Also used : MAPDialogSms(org.restcomm.protocols.ss7.map.api.service.sms.MAPDialogSms) MAPException(org.restcomm.protocols.ss7.map.api.MAPException)

Aggregations

MAPDialogSms (org.restcomm.protocols.ss7.map.api.service.sms.MAPDialogSms)25 MAPException (org.restcomm.protocols.ss7.map.api.MAPException)17 ISDNAddressString (org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString)16 AddressString (org.restcomm.protocols.ss7.map.api.primitives.AddressString)14 SccpAddress (org.restcomm.protocols.ss7.sccp.parameter.SccpAddress)8 MAPErrorMessage (org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessage)6 ActivityContextInterface (javax.slee.ActivityContextInterface)4 SmsSignalInfo (org.restcomm.protocols.ss7.map.api.service.sms.SmsSignalInfo)4 Sms (org.mobicents.smsc.library.Sms)3 SmsSet (org.mobicents.smsc.library.SmsSet)3 IMSI (org.restcomm.protocols.ss7.map.api.primitives.IMSI)3 SM_RP_DA (org.restcomm.protocols.ss7.map.api.service.sms.SM_RP_DA)3 SmsTpdu (org.restcomm.protocols.ss7.map.api.smstpdu.SmsTpdu)3 GlobalTitle (org.restcomm.protocols.ss7.sccp.parameter.GlobalTitle)3 SmscProcessingException (org.mobicents.smsc.library.SmscProcessingException)2 MAPApplicationContext (org.restcomm.protocols.ss7.map.api.MAPApplicationContext)2 MAPErrorMessageSubscriberBusyForMtSms (org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessageSubscriberBusyForMtSms)2 LocationInfoWithLMSI (org.restcomm.protocols.ss7.map.api.service.sms.LocationInfoWithLMSI)2 SM_RP_OA (org.restcomm.protocols.ss7.map.api.service.sms.SM_RP_OA)2 SmsSubmitTpdu (org.restcomm.protocols.ss7.map.api.smstpdu.SmsSubmitTpdu)2