From 9d69a118885a49b580a1f4ffe0d1b787b1602921 Mon Sep 17 00:00:00 2001 From: Joan Date: Sun, 6 Aug 2023 09:02:30 +0200 Subject: [PATCH] Fixed integer errors and added more logging --- telemovris/telemovris.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/telemovris/telemovris.py b/telemovris/telemovris.py index a06f8fd..8f7f335 100644 --- a/telemovris/telemovris.py +++ b/telemovris/telemovris.py @@ -30,8 +30,8 @@ voip_service = VoIPFileStreamService(client, receive_calls=False) REQUEST_URL = os.environ.get("REQUEST_URL") -RING_WAIT_TIME = os.environ.get("RING_WAIT_TIME") -MAX_CALL_DURATION = os.environ.get("MAX_CALL_DURATION") +RING_WAIT_TIME = int(os.environ.get("RING_WAIT_TIME")) +MAX_CALL_DURATION = int(os.environ.get("MAX_CALL_DURATION")) def get_audio_duration(audio_name): logging.info(f"Getting audio duration for {audio_name}") @@ -88,7 +88,8 @@ async def main(user, message_text, audio): logging.info("Finishing call because of duration") await call.discard_call() break - except: + except Exception as e: + logging.error(f"There was an error during the call: {e}") break while True: