opentelecoms-org / jsmpp

SMPP implemented in Java
Apache License 2.0
230 stars 160 forks source link

Delivery Receipt not receiving on time at the client side. #232

Open rsha-git opened 3 months ago

rsha-git commented 3 months ago

I have a smpp session in Transceiver mode. And registered delivery has been set with SMSCDeliveryReceipt.SUCCESS_FAILURE. And before connectAndBind() MessageReceiverListener has been set.

public void onAcceptDeliverSm(DeliverSm deliverSm) throws ProcessRequestException {
        if (MessageType.SMSC_DEL_RECEIPT.containedIn(deliverSm.getEsmClass())) {
            // delivery receipt
            try {
                DeliveryReceipt delReceipt = deliverSm.getShortMessageAsDeliveryReceipt();
                long id = Long.parseLong(delReceipt.getId()) & 0xffffffff;
                String messageId = Long.toString(id, 16).toUpperCase();
                log.info("delivery receipt '{}' : {}", messageId, delReceipt);
            } catch (InvalidDeliveryReceiptException e) {
                //
            }
        } else {
            log.info("Short message : {}", new String(deliverSm.getShortMessage()));
        }
    }

I'm using SUBMIT_SM. So, most of the time, I see that despite the registered delivery being set - Regular short message gets printed but not the delivery receipt. And when I stop the program and restart again, I get the delivery receipt of the previous message. I tried adding some delay in the client side assuming SMSC might need some time to deliver but the behavior was the same as before. Is this the expected behavior? How can I get the receipt on time?