From 1b9cc37000909d88fccc01219f0b5048e8494a09 Mon Sep 17 00:00:00 2001 From: Kasherpete <119694008+Kasherpete@users.noreply.github.com> Date: Sat, 23 Sep 2023 22:36:17 -0500 Subject: [PATCH 1/3] Update sms_registration.py --- sms_registration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sms_registration.py b/sms_registration.py index fdf8ff6..03ca084 100644 --- a/sms_registration.py +++ b/sms_registration.py @@ -20,7 +20,7 @@ def register(push_token: bytes, no_parse = False, gateway = None) -> tuple[str, print("MCC+MNC received! " + mccmnc) print("Determining gateway...") gateway = gateway_fetch.getGatewayMCCMNC(mccmnc) - print("Gateway found! " + gateway) + print("Gateway found! " + str(gateway)) if gateway is None: print("Automatic gateway detection failed, switching to default...") gateway = GATEWAY From 207c33a6f428958a222d356601b7bf27fc3b8d6e Mon Sep 17 00:00:00 2001 From: Kasherpete <119694008+Kasherpete@users.noreply.github.com> Date: Sat, 23 Sep 2023 22:39:17 -0500 Subject: [PATCH 2/3] Update sms_registration.py --- sms_registration.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sms_registration.py b/sms_registration.py index 03ca084..80233d6 100644 --- a/sms_registration.py +++ b/sms_registration.py @@ -20,8 +20,9 @@ def register(push_token: bytes, no_parse = False, gateway = None) -> tuple[str, print("MCC+MNC received! " + mccmnc) print("Determining gateway...") gateway = gateway_fetch.getGatewayMCCMNC(mccmnc) + if gateway is not None: print("Gateway found! " + str(gateway)) - if gateway is None: + else: print("Automatic gateway detection failed, switching to default...") gateway = GATEWAY token = push_token.hex().upper() From 48f537d99131303f0a60ed856c94b4673d898daf Mon Sep 17 00:00:00 2001 From: Kasherpete <119694008+Kasherpete@users.noreply.github.com> Date: Sat, 23 Sep 2023 22:42:37 -0500 Subject: [PATCH 3/3] Update sms_registration.py --- sms_registration.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sms_registration.py b/sms_registration.py index 80233d6..896fb54 100644 --- a/sms_registration.py +++ b/sms_registration.py @@ -23,8 +23,9 @@ def register(push_token: bytes, no_parse = False, gateway = None) -> tuple[str, if gateway is not None: print("Gateway found! " + str(gateway)) else: - print("Automatic gateway detection failed, switching to default...") - gateway = GATEWAY + print("No gateway was provided, and automatic gateway detection failed. Please run again with the --gateway flag.") + # gateway = GATEWAY + raise token = push_token.hex().upper() req_id = random.randint(0, 2**32) sms = f"REG-REQ?v=3;t={token};r={req_id};"