mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-09-29 12:30:45 +03:00
transport/smpp2sim: TERMINAL RESPONSE for proactive SEND SHORT MESSAGE
A multi part OTA response (full GP GET STATUS registry or some other fat response that exceeds one SMS) is delivered as several SMS via proactive SEND SHORT MESSAGE. The card only gives us another part if it receives a TERMINAL RESPONSE for the previous one. Currently smpp2sim Proact.handle_SendShortMessage relays the SMS but returns None, so the transport falls back to prepare_response(pcmd) with the ProactiveCommand collection (empty .children) and crashes with 'not enough values to unpack (expected 1, got 0)', dropps the SMPP link, and never fetches the remaining parts. Fix: make handle_SendShortMessage return a successful TERMINAL RESPONSE built from the decoded command so the handshake proceeds. prepare_response() is extended to handle collection via .decoded and raises a useful error. The send_apdu_checksw general_result='FIXME' path is now avoided for SendShortMessage but remains a problem for other handlers that return None. Change-Id: Ib96ce81c4ff093b8a6fc715f79617e95a2dd8433
This commit is contained in:
@@ -116,6 +116,14 @@ class Proact(ProactiveHandler):
|
||||
addr_ie.decoded['ton_npi']['numbering_plan_id'])
|
||||
logger.info(submit)
|
||||
self.send_sms_via_smpp(submit)
|
||||
# Return a successful TERMINAL RESPONSE.
|
||||
# This is important:
|
||||
# - without it the transport cannot complete the proactive command
|
||||
# - for a multi part OTA response, the card would never be asked to give us
|
||||
# the remaining SMS chunks.
|
||||
# 'pcmd' is a decoded SendShortMessage IE, which contains CommandDetails and
|
||||
# DeviceIdentities that prepare_response() echoes/inverts.
|
||||
return self.prepare_response(pcmd)
|
||||
|
||||
def handle_OpenChannel(self, pcmd: ProactiveCommand):
|
||||
"""Card requests opening a new channel via a UDP/TCP socket."""
|
||||
|
||||
Reference in New Issue
Block a user