Hoernchen has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/43558?usp=email )


Change subject: bip: answer proactive commands the relay does not implement
......................................................................

bip: answer proactive commands the relay does not implement

pySim-smpp2sim currently claims to support every feature flag that exists,
but this immediately dies here with a SJA5:

 NotImplementedError: No handler method for ProvideLocalInformation(...)

Answer anything unhandled with "performed_successfully" and log. Never
"command_beyond_terminal_capability", tho, answering that for PROVIDE LOCAL
INFORMATION refuses to open the session at all.

Change-Id: I1e55d6f88c872a04b89a3946dd840d30b329621e
---
M pySim/bip.py
1 file changed, 19 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/58/43558/1

diff --git a/pySim/bip.py b/pySim/bip.py
index e5ec029..14c75bc 100644
--- a/pySim/bip.py
+++ b/pySim/bip.py
@@ -203,6 +203,25 @@
         self.sms_sink = sms_sink
         self.channels = 
ProactChannels(on_data_available=self._on_channel_data_available)
 
+    def receive_fetch(self, pcmd: ProactiveCommand):
+        """Answer anything this handler has no specific handler for.
+
+        A card coming up will usually issue PROVIDE LOCAL INFORMATION,
+        POLL INTERVAL or TIMER MANAGEMENT before it gets anywhere near a BIP 
channel
+        because we claim to support every feature flag there is.
+
+        Note that this is not the spec-correct answer. TS 102 223 6.8.7
+        says a successful TERMINAL RESPONSE to PROVIDE LOCAL INFORMATION 
"shall" carry the
+        requested Local information data object, and 6.8.13/6.8.14 says the 
same for TIMER
+        MANAGEMENT, this returns empty results for all of them, which works 
with real cards.
+
+        Always "performed_successfully", never 
"command_beyond_terminal_capability" because
+        answering that to PROVIDE LOCAL INFORMATION makes a card refuse to 
open the session.
+        """
+        logger.info("no handler for %s, answering performed_successfully",
+                    type(pcmd.decoded).__name__)
+        return self.prepare_response(pcmd, 'performed_successfully')
+
     @staticmethod
     def _find_first_element_of_type(instlist, cls):
         for i in instlist:

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/43558?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I1e55d6f88c872a04b89a3946dd840d30b329621e
Gerrit-Change-Number: 43558
Gerrit-PatchSet: 1
Gerrit-Owner: Hoernchen <[email protected]>

Reply via email to