Search in sources :

Example 26 with MAPException

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

Example 27 with MAPException

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);
    }
}
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 28 with MAPException

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);
}
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 29 with MAPException

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);
    }
}
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 30 with MAPException

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

Aggregations

MAPException (org.restcomm.protocols.ss7.map.api.MAPException)22 MAPDialogSms (org.restcomm.protocols.ss7.map.api.service.sms.MAPDialogSms)21 ISDNAddressString (org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString)16 AddressString (org.restcomm.protocols.ss7.map.api.primitives.AddressString)14 SmsSignalInfo (org.restcomm.protocols.ss7.map.api.service.sms.SmsSignalInfo)6 Date (java.util.Date)4 ActivityContextInterface (javax.slee.ActivityContextInterface)4 Sms (org.mobicents.smsc.library.Sms)4 SmsSet (org.mobicents.smsc.library.SmsSet)4 SccpAddress (org.restcomm.protocols.ss7.sccp.parameter.SccpAddress)4 MAPErrorMessage (org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessage)3 MAPErrorMessageSubscriberBusyForMtSms (org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessageSubscriberBusyForMtSms)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 UserData (org.restcomm.protocols.ss7.map.api.smstpdu.UserData)3 Timestamp (java.sql.Timestamp)2 ArrayList (java.util.ArrayList)2 SmscProcessingException (org.mobicents.smsc.library.SmscProcessingException)2 TargetAddress (org.mobicents.smsc.library.TargetAddress)2