Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Invalid Message ID #240

Unanswered
sairmali asked this question in Q&A
Dec 10, 2023 · 4 comments · 3 replies
Discussion options

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)

You must be logged in to vote

Replies: 4 comments 3 replies

Comment options

Hi, I don't quite understand the question, could you elaborate?

You must be logged in to vote
0 replies
Comment options

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.

You must be logged in to vote
3 replies
Comment options

Sure, I can see that, but the error is returned by your SMSC provider

Comment options

  1. image
    this response given from my script side by message id

  2. WhatsApp Image 2023年12月10日 at 19 46 33_bd57f37e

this mail my provider send he say this problem form script side

Comment options

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 ."

Comment options

@eigenein please tell me ?

You must be logged in to vote
0 replies
Comment options

i am also getting the the same error, Invalid message id, has anyone found the solution for this?

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
Converted from issue

This discussion was converted from issue #238 on December 11, 2023 11:01.

AltStyle によって変換されたページ (->オリジナル) /