From cbb3a8f43b28625fedbd45b6a671519c88a34348 Mon Sep 17 00:00:00 2001 From: SpaceSaver Date: Fri, 22 Sep 2023 16:18:22 -0400 Subject: [PATCH] Add failsafe of using constant --- sms_registration.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sms_registration.py b/sms_registration.py index 8071c63..bd6c8a3 100644 --- a/sms_registration.py +++ b/sms_registration.py @@ -17,6 +17,9 @@ def register(push_token: bytes, no_parse = False, gateway = None) -> tuple[str, if gateway is None: mccmnc = requests.get(f"http://{PHONE_IP}:{API_PORT}/info").text gateway = gateway_fetch.getGatewayMCCMNC(mccmnc) + if gateway is None: + print("Automatic gateway detection failed, switching to default...") + gateway = GATEWAY token = push_token.hex().upper() req_id = random.randint(0, 2**32) sms = f"REG-REQ?v=3;t={token};r={req_id};"