-
-
Notifications
You must be signed in to change notification settings - Fork 140
-
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)
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 4 comments 3 replies
-
Hi, I don't quite understand the question, could you elaborate?
Beta Was this translation helpful? Give feedback.
All reactions
-
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.
Beta Was this translation helpful? Give feedback.
All reactions
-
Sure, I can see that, but the error is returned by your SMSC provider
Beta Was this translation helpful? Give feedback.
All reactions
-
-
image
this response given from my script side by message id
this mail my provider send he say this problem form script side
Beta Was this translation helpful? Give feedback.
All reactions
-
this is mail body send by my provider
"Kindly note that below message ID valid and the SMS delivered successfully to the destination based on our SMSC logs below , So the issue on your SMPP software/conversion ."
Beta Was this translation helpful? Give feedback.
All reactions
-
@eigenein please tell me ?
Beta Was this translation helpful? Give feedback.
All reactions
-
i am also getting the the same error, Invalid message id, has anyone found the solution for this?
Beta Was this translation helpful? Give feedback.