Switch to Debian base image with linphone-cli (v3.1.0)
This commit is contained in:
@@ -1,40 +1,14 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
bashio::log.info "Starting SIP Voice Notifier..."
|
||||
echo "Starting SIP Voice Notifier..."
|
||||
|
||||
# Get config from add-on options
|
||||
SIP_SERVER=$(bashio::config 'sip_server')
|
||||
SIP_USER=$(bashio::config 'sip_user')
|
||||
SIP_PASSWORD=$(bashio::config 'sip_password')
|
||||
DEFAULT_DURATION=$(bashio::config 'default_duration')
|
||||
|
||||
bashio::log.info "SIP Server: ${SIP_SERVER}"
|
||||
bashio::log.info "SIP User: ${SIP_USER}"
|
||||
bashio::log.info "Default Duration: ${DEFAULT_DURATION}s"
|
||||
|
||||
# Wait for supervisor to be ready
|
||||
sleep 3
|
||||
|
||||
# Register service with Home Assistant via Supervisor API
|
||||
bashio::log.info "Registering sip_notifier.send_notification service with Home Assistant..."
|
||||
|
||||
# Get add-on slug
|
||||
ADDON_SLUG="088d3b92_sip-notifier"
|
||||
|
||||
# Register the service
|
||||
curl -sSL -X POST \
|
||||
-H "Authorization: Bearer ${SUPERVISOR_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{
|
||||
\"addon\": \"${ADDON_SLUG}\",
|
||||
\"service\": \"send_notification\"
|
||||
}" \
|
||||
"http://supervisor/services/sip_notifier/send_notification" \
|
||||
&& bashio::log.info "Service registered successfully!" \
|
||||
|| bashio::log.warning "Service registration failed (may already exist)"
|
||||
|
||||
bashio::log.info "Add-on ready - listening on port 8099"
|
||||
bashio::log.info "Service available as: sip_notifier.send_notification"
|
||||
# Load config from options.json
|
||||
if [ -f /data/options.json ]; then
|
||||
echo "Config file found"
|
||||
else
|
||||
echo "Warning: No config file found at /data/options.json"
|
||||
fi
|
||||
|
||||
# Start the Flask service
|
||||
exec python3 /app/sip_service.py
|
||||
|
||||
Reference in New Issue
Block a user