Replies: 4 comments 3 replies
|
Hi, I don't quite understand the question, could you elaborate? |
0 replies
|
hello @eigenein ,I'm currently running a script to fetch the delivery status of a message through its unique message ID using the (query_message) command. However, my script encounters an error during this process. |
3 replies
|
i am also getting the the same error, Invalid message id, has anyone found the solution for this? |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
import smpplib.client
import smpplib.consts
Initialize your SMPP client
client = smpplib.client.Client('127.0.01', 2775, allow_unknown_opt_params=True)
client.connect()
try:
# Bind to the SMPP server with credentials
client.bind_transceiver(system_id='sarimali', password='password')
# Query the delivery status for a specific message ID
message_id_to_check = '2C16E7kk'
# Sending the query request
status = client.query_message(
message_id=message_id_to_check,
source_addr_ton=5,
source_addr_npi=0,
source_addr='Dar'
)
# Interpret the status and print the result
client.listen()
if status.status == 0:
delivery_status = "Delivered" if status.status else "Not Delivered"
print(f"Delivery Status: {delivery_status}")
else:
print("Query Failed")
except smpplib.exceptions.PDUError as e:
print(f"Error querying delivery status: {e}")
finally:
client.disconnect()
-----------------Response-------------------------
<smpplib.client.Client object at 0x000001D7D08520D0> is disconnecting in the bound state
Error querying delivery status: ('(12) query_sm_resp: Invalid Message ID', 12)
All reactions