Search in sources :

Example 21 with MAPDialogSms

use of org.mobicents.protocols.ss7.map.api.service.sms.MAPDialogSms in project smscgateway by RestComm.

the class MoSbb method handleSmsDeliverTpdu.

private Sms handleSmsDeliverTpdu(SmsDeliverTpdu smsDeliverTpdu, CorrelationIdValue civ, int networkId, String originatorSccpAddress, boolean isMoOperation, MAPDialogSms dialog, SmsMessage evt, long invokeId) throws SmscProcessingException {
    TargetAddress ta = createDestTargetAddress(civ.getMsisdn(), networkId);
    Sms sms = this.createSmsEvent(smsDeliverTpdu, ta, persistence, civ, networkId, originatorSccpAddress);
    return sms;
// return this.processSms(sms, persistence, smscPropertiesManagement.getHrCharging(), isMoOperation, dialog, evt, invokeId);
}
Also used : MAPDialogSms(org.mobicents.protocols.ss7.map.api.service.sms.MAPDialogSms)

Example 22 with MAPDialogSms

use of org.mobicents.protocols.ss7.map.api.service.sms.MAPDialogSms in project smscgateway by RestComm.

the class MoSbb method handleSmsSubmitTpdu.

private Sms handleSmsSubmitTpdu(SmsSubmitTpdu smsSubmitTpdu, AddressString callingPartyAddress, int networkId, String originatorSccpAddress, boolean isMoOperation, MAPDialogSms dialog, SmsMessage evt, long invokeId, String origMoServiceCentreAddressDA) throws SmscProcessingException {
    TargetAddress ta = createDestTargetAddress(smsSubmitTpdu.getDestinationAddress(), networkId);
    Sms sms = this.createSmsEvent(smsSubmitTpdu, ta, persistence, callingPartyAddress, networkId, originatorSccpAddress);
    sms.setOrigMoServiceCentreAddressDA(origMoServiceCentreAddressDA);
    return sms;
// return this.processSms(sms, persistence, smscPropertiesManagement.getMoCharging(), isMoOperation, dialog, evt, invokeId);
}
Also used : MAPDialogSms(org.mobicents.protocols.ss7.map.api.service.sms.MAPDialogSms)

Example 23 with MAPDialogSms

use of org.mobicents.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.mobicents.protocols.ss7.map.api.smstpdu.AddressField) SmsSignalInfo(org.mobicents.protocols.ss7.map.api.service.sms.SmsSignalInfo) MAPDialogSms(org.mobicents.protocols.ss7.map.api.service.sms.MAPDialogSms) MAPException(org.mobicents.protocols.ss7.map.api.MAPException) SmsTpdu(org.mobicents.protocols.ss7.map.api.smstpdu.SmsTpdu) SmsSubmitTpdu(org.mobicents.protocols.ss7.map.api.smstpdu.SmsSubmitTpdu)

Example 24 with MAPDialogSms

use of org.mobicents.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.mobicents.protocols.ss7.map.api.service.sms.MAPDialogSms) MAPException(org.mobicents.protocols.ss7.map.api.MAPException)

Example 25 with MAPDialogSms

use of org.mobicents.protocols.ss7.map.api.service.sms.MAPDialogSms in project smscgateway by RestComm.

the class MAPListener method onForwardShortMessageRequest.

@Override
public void onForwardShortMessageRequest(ForwardShortMessageRequest event) {
    if (logger.isInfoEnabled()) {
        logger.info("Rx : onForwardShortMessageRequest=" + event);
    }
    // Lets first close the Dialog
    MAPDialogSms mapDialogSms = event.getMAPDialog();
    try {
        if (this.currentMapMessageCount % 7 == 0) {
            // Send back AbsentSubscriber for every 7th MtSMS
            MAPErrorMessage mapErrorMessage = mAPErrorMessageFactory.createMAPErrorMessageAbsentSubscriberSM(AbsentSubscriberDiagnosticSM.IMSIDetached, null, null);
            mapDialogSms.sendErrorComponent(event.getInvokeId(), mapErrorMessage);
        // mapDialogSms.close(false);
        } else {
            mapDialogSms.addForwardShortMessageResponse(event.getInvokeId());
        // mapDialogSms.close(false);
        }
    } catch (MAPException e) {
        logger.error("Error while sending MAPErrorMessageAbsentSubscriberSM ", e);
    }
    mapDialogSms.setUserObject(true);
}
Also used : MAPDialogSms(org.mobicents.protocols.ss7.map.api.service.sms.MAPDialogSms) MAPException(org.mobicents.protocols.ss7.map.api.MAPException) MAPErrorMessage(org.mobicents.protocols.ss7.map.api.errors.MAPErrorMessage)

Aggregations

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