Skip to content

Problem when sending parts too long and listen exceptionΒ #160

Description

@ectalactus

Hi,

Thank you very much for the library.

Sometime the function smpplib.gsm.make_parts can't split correctly the message in parts, exemple of sms :

"EMOTICON BUG 🀼 πŸƒ πŸ‡ πŸ‹ 🏹 πŸ›Ά 🀸 🀹 πŸ›Ή πŸ₯ 🎳 🏊 πŸ„ 🀽 🎿 β›Έ β›· πŸ‚ πŸ›· πŸ₯Œ 🏌"

It's an unlikely case for my need, I left out the encoding management for this type of message.

But this creates another problem. With this kind of message the method read_once call by listen raise a PDUError.
And in this PDUError , there is not all the PDU information and especially the sequence.

    def read_once(self, ignore_error_codes=None, auto_send_enquire_link=True):
        """Read a PDU and act"""
        try:
            try:
                pdu = self.read_pdu()
            except socket.timeout:
                if not auto_send_enquire_link:
                    raise
                self.logger.debug('Socket timeout, listening again')
                pdu = smpp.make_pdu('enquire_link', client=self)
                self.send_pdu(pdu)
                return

            if pdu.is_error():
                raise exceptions.PDUError('({}) {}: {}'.format(
                    pdu.status,
                    pdu.command,
                    consts.DESCRIPTIONS.get(pdu.status, 'Unknown status')),
                    int(pdu.status),
                )

It's possible to add the PDU object in the PDUError or just the sequence. I need the sequence to link the error to the messages I send.
Otherwise the message remains in an unknow status.

Best Regards.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions