-
The example contains the following snipped for sending a SMS: for part in parts:
pdu = client.send_message(
source_addr_ton=smpplib.consts.SMPP_TON_INTL,
#source_addr_npi=smpplib.consts.SMPP_NPI_ISDN,
# Make sure it is a byte string, not unicode:
source_addr='SENDERPHONENUM',
dest_addr_ton=smpplib.consts.SMPP_TON_INTL,
#dest_addr_npi=smpplib.consts.SMPP_NPI_ISDN,
# Make sure thease two params are byte strings, not unicode:
destination_addr='PHONENUMBER',
short_message=part,
data_coding=encoding_flag,
esm_class=msg_type_flag,
registered_delivery=True,
)
print(pdu.sequence) Is it somehow possible to get the client.set_message_sent_handler(
lambda pdu: logger.debug(f"sent {pdu.message_id}")
) But I cannot know if the message_id is the message id for the message I just sent in a multi-threaded environment 🤔 |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
👋 Message ID indeed comes back as a part of |
Beta Was this translation helpful? Give feedback.
-
I tried calling
Even if this works, the delay is a huge issue. |
Beta Was this translation helpful? Give feedback.
-
For the
How do you mean «didn't do anything»? Like being stuck? |
Beta Was this translation helpful? Give feedback.
-
Yes, it was stuck until the exception was thrown. Therefore it also blocked the other parts when I chose a longer message |
Beta Was this translation helpful? Give feedback.
-
I resolved the issue by entering a lock when sending an SMS and releasing it when all parts can be associated with a |
Beta Was this translation helpful? Give feedback.
I resolved the issue by entering a lock when sending an SMS and releasing it when all parts can be associated with a
message_id
provided by theset_message_sent_handler
. The time we are waiting is neglectable as the handler is usually called before the second part of the message is processed.