handle_deliver_sm gets called after some time which appears to be random.
I printed some fields of the DeliverSM object in hopes to see a flag or sth similar...
\nHowever, I could not find anything that seemed to be different from actually receiving the SMS
client.listen(auto_send_enquire_link=False)\n...\nclient.send_message(\n source_addr_ton=smpplib.consts.SMPP_TON_ALNUM,\n source_addr_npi=smpplib.consts.SMPP_NPI_UNK,\n source_addr=config.SOURCE_NAME,\n dest_addr_ton=smpplib.consts.SMPP_TON_INTL,\n dest_addr_npi=smpplib.consts.SMPP_NPI_ISDN,\n destination_addr=phone_number,\n short_message=part,\n data_coding=encoding_flag,\n esm_class=msg_type_flag,\n registered_delivery=True,\n)Am I missing sth?
","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Turns out we have a SMSC with version 3 and the flag isn't supported until version 5.
\nSecond mistake was that the messages are actually older confirmations that haven't been processed. The SMSC seems to send those confirmations occasionally when not received yet.
","upvoteCount":0,"url":"https://github.com/python-smpplib/python-smpplib/discussions/244#discussioncomment-8012589"}}}-
|
The handler gets called while the SMS is not received. client.set_message_received_handler(lambda pdu: handle_deliver_sm(pdu))
I printed some fields of the client.listen(auto_send_enquire_link=False)
...
client.send_message(
source_addr_ton=smpplib.consts.SMPP_TON_ALNUM,
source_addr_npi=smpplib.consts.SMPP_NPI_UNK,
source_addr=config.SOURCE_NAME,
dest_addr_ton=smpplib.consts.SMPP_TON_INTL,
dest_addr_npi=smpplib.consts.SMPP_NPI_ISDN,
destination_addr=phone_number,
short_message=part,
data_coding=encoding_flag,
esm_class=msg_type_flag,
registered_delivery=True,
)Am I missing sth? |
Beta Was this translation helpful? Give feedback.
-
|
👋 I'm afraid our example is a little incorrect:
|
Beta Was this translation helpful? Give feedback.
Turns out we have a SMSC with version 3 and the flag isn't supported until version 5.
Second mistake was that the messages are actually older confirmations that haven't been processed. The SMSC seems to send those confirmations occasionally when not received yet.