smpplib.exceptions.UnknownCommandError: Unknown SMPP command code "0x2001" #191
Answered
by
eigenein
AnnaLupanova
asked this question in
Q&A
-
|
Hi. I use python 3.6 and I get this error when sending a delivery report from SMSC. I also have to respond to this message with the def received_handler(pdu):
lambda pdu: sys.stdout.write('--'.format(pdu.short_message))
pdu_body = pdu.short_message
pdu_phone = pdu.source_addr
sms_1 = 'sms %s' % (pdu_body)
logger.info(sms_1)
phone_1 = 'phone %s' % (pdu_phone)
logger.info(phone_1)
try:
client = smpplib.client.Client(host,port)
client.set_message_sent_handler(
lambda pdu: sys.stdout.write('sent {} {}\n'.format(pdu.sequence, pdu.message_id)))
client.set_message_received_handler(received_handler)
client.connect()
client.bind_transceiver(system_id=sys_id, password=pwd)
client.listen()
except UnknownCommandError as e:
logger.error('UnknownCommandError DELIVER SMS')
deliver = smpplib.smpp.make_pdu('deliver_sm_resp', client=client)
client.send_pdu(deliver)
logger.info("SEND deliver_sm_resp")
except Exception as e:
client.listen() |
Beta Was this translation helpful? Give feedback.
Answered by
eigenein
Feb 16, 2022
Replies: 1 comment
-
|
Hi @AnnaLupanova 👋
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
eigenein
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @AnnaLupanova 👋
client.listen()should take care of sendingdeliver_sm_resp, seepython-smpplib/smpplib/client.py
Lines 372 to 373 in 7367454
UnknownCommandError– we're unfortunately unable to handle vendor-specific command codes at the moment. Here's the tracking issue: #105