From a9775c0e6fc4dca8a0c0a34603dac6b0d46ca528 Mon Sep 17 00:00:00 2001 From: OpenClaw Bot Date: Sun, 8 Feb 2026 15:05:36 +0100 Subject: [PATCH] Use pyVoIP from git (latest fixes) and fix service registration (v2.0.6) --- sip-notifier/config.yaml | 6 ++---- sip-notifier/requirements.txt | 2 +- sip-notifier/sip_service.py | 16 ++++++++++++---- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/sip-notifier/config.yaml b/sip-notifier/config.yaml index 23a0a0b..8176311 100644 --- a/sip-notifier/config.yaml +++ b/sip-notifier/config.yaml @@ -1,7 +1,7 @@ name: "SIP Voice Notifier" -version: "2.0.5" +version: "2.0.6" slug: "sip-notifier" -description: "Send voice notifications via SIP phone calls (includes integration)" +description: "Send voice notifications via SIP phone calls" arch: - aarch64 - amd64 @@ -14,8 +14,6 @@ boot: auto homeassistant_api: true hassio_api: true hassio_role: default -services: - - sip_notifier.send_notification:sip_notifier ports: 8099/tcp: null options: diff --git a/sip-notifier/requirements.txt b/sip-notifier/requirements.txt index f6aacec..c7dbbe8 100644 --- a/sip-notifier/requirements.txt +++ b/sip-notifier/requirements.txt @@ -2,4 +2,4 @@ flask==3.0.0 requests==2.31.0 pydub==0.25.1 gtts==2.5.0 -pyVoIP==1.6.6 +git+https://github.com/tayler6000/pyVoIP.git diff --git a/sip-notifier/sip_service.py b/sip-notifier/sip_service.py index e28419e..bdc5d2b 100644 --- a/sip-notifier/sip_service.py +++ b/sip-notifier/sip_service.py @@ -39,7 +39,7 @@ def register_service(): 'Content-Type': 'application/json', } - # Call Home Assistant service registration endpoint + # Register service via Supervisor API response = requests.post( 'http://supervisor/services', headers=headers, @@ -53,11 +53,15 @@ def register_service(): if response.status_code in [200, 201]: _LOGGER.info("✅ Service registered: sip_notifier.send_notification") + return True else: - _LOGGER.warning(f"Service registration returned: {response.status_code}") + _LOGGER.warning(f"Service registration status: {response.status_code}") + _LOGGER.debug(f"Response: {response.text}") + return False except Exception as e: _LOGGER.error(f"Failed to register service: {e}") + return False def download_and_convert_audio(url: str) -> str: @@ -264,9 +268,13 @@ if __name__ == '__main__': # Register service with Home Assistant _LOGGER.info("Registering service with Home Assistant...") time.sleep(2) # Wait for supervisor to be ready - register_service() - _LOGGER.info("SIP Voice Notifier ready") + if register_service(): + _LOGGER.info("Service registration successful") + else: + _LOGGER.warning("Service registration failed - will be available via REST API on port 8099") + + _LOGGER.info("SIP Voice Notifier ready (using pyVoIP from git)") _LOGGER.info("Service: sip_notifier.send_notification") _LOGGER.info("Starting Flask service on port 8099") app.run(host='0.0.0.0', port=8099, debug=False)