Search in sources :

Example 1 with SendPduStatus2

use of org.mobicents.smsc.slee.resources.scheduler.SendPduStatus2 in project smscgateway by RestComm.

the class RxSmppServerSbb method onSendPduStatusLocal.

private void onSendPduStatusLocal(final SendPduStatus event, final ActivityContextInterface aci) {
    if (logger.isFineEnabled())
        logger.fine("onSendPduStatusParent - refire to RxSmppServerChildSbb : activity=" + aci.getActivity());
    RxSmppServerChildLocalObject rxSmppServerSbbLocalObject = this.getRxSmppServerChildSbbObject();
    if (rxSmppServerSbbLocalObject != null) {
        ActivityContextInterface act = getSchedulerActivityContextInterface();
        if (act != null) {
            try {
                act.attach(rxSmppServerSbbLocalObject);
                SendPduStatus2 event2 = new SendPduStatus2(event.getException(), event.getRequest(), event.getResponse(), event.getSystemId(), event.isSuccess());
                SmsSet smsSet = getSmsSet();
                Pdu pduEvent = event.getRequest();
                if (event.getResponse() != null)
                    pduEvent = event.getResponse();
                EsmeManagement esmeManagement = EsmeManagement.getInstance();
                Boolean destAddressLimitationEnabled = false;
                if (esmeManagement != null && smsSet != null) {
                    Esme esme = esmeManagement.getEsmeByName(smsSet.getDestEsmeName());
                    if (esme != null) {
                        destAddressLimitationEnabled = esme.getDestAddrSendLimit() != 0;
                    }
                }
                int realID = -1;
                SentItemsList list = null;
                if (destAddressLimitationEnabled) {
                    list = retreiveSentChunks();
                    for (int i = 0; i < list.getSentList().size(); i++) {
                        if (list.getSentList().get(i).getRemoteSequenceNumber() == pduEvent.getSequenceNumber()) {
                            realID = list.getSentList().get(i).getLocalSequenceNumber();
                            break;
                        }
                    }
                } else {
                    realID = pduEvent.getSequenceNumber();
                }
                ConfirmMessageInSendingPool confirmMessageInSendingPool = null;
                if (realID != -1)
                    confirmMessageInSendingPool = getMessageInSendingPoolBySeqNumber(realID);
                fireSendPduStatusChild(event2, act, null);
            } catch (IllegalStateException e) {
                if (logger.isInfoEnabled())
                    logger.info("onSendPduStatus - IllegalStateException (activity is ending - dropping a SLEE event because it is not needed) : new activity=" + act.getActivity() + ", event=" + event);
            }
        }
    }
}
Also used : Pdu(com.cloudhopper.smpp.pdu.Pdu) EsmeManagement(org.restcomm.smpp.EsmeManagement) SentItemsList(org.mobicents.smsc.slee.services.deliverysbb.SentItemsList) ActivityContextInterface(javax.slee.ActivityContextInterface) SendPduStatus2(org.mobicents.smsc.slee.resources.scheduler.SendPduStatus2) Esme(org.restcomm.smpp.Esme) ConfirmMessageInSendingPool(org.mobicents.smsc.slee.services.deliverysbb.ConfirmMessageInSendingPool) SmsSet(org.mobicents.smsc.library.SmsSet)

Aggregations

Pdu (com.cloudhopper.smpp.pdu.Pdu)1 ActivityContextInterface (javax.slee.ActivityContextInterface)1 SmsSet (org.mobicents.smsc.library.SmsSet)1 SendPduStatus2 (org.mobicents.smsc.slee.resources.scheduler.SendPduStatus2)1 ConfirmMessageInSendingPool (org.mobicents.smsc.slee.services.deliverysbb.ConfirmMessageInSendingPool)1 SentItemsList (org.mobicents.smsc.slee.services.deliverysbb.SentItemsList)1 Esme (org.restcomm.smpp.Esme)1 EsmeManagement (org.restcomm.smpp.EsmeManagement)1