arnonym/ha-plugins

Stand-alone - Traceback (most recent call last)

Opened this issue · 1 comments

I try to run ha-sip stand-alone in my kubernetes-cluster via flux.

Unfortunately, I can't get it to run.

here is the log:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
Running in stand-alone mode.
Python 3.11.3
| 08:47:38.053948 [ ] Setting name server: ['192.168.111.1']
| 08:47:38.053987 [ ] No cache directory configured.
| 08:47:38.054019 [1] No file name for incoming call config specified.
| 08:47:38.054072 [2] Error loading menu for incoming call: [Errno 2] No such file or directory: '/config/incoming.yaml'
| 08:47:38.054112 [3] Error loading menu for incoming call: [Errno 2] No such file or directory: '/config/incoming.yaml'
22:14:02.054 os_core_unix.c !pjlib 2.14.1 for POSIX initialized
22:14:02.054 sip_endpoint.c  .Creating endpoint instance...
22:14:02.054          pjlib  .select() I/O Queue created (0xf5cc31b0)
22:14:02.054 sip_endpoint.c  .Module "mod-msg-print" registered
22:14:02.054 sip_transport.  .Transport manager created.
22:14:02.054   pjsua_core.c  .PJSUA state changed: NULL --> CREATED
| 08:47:38.063276 [ ] Supported audio codecs: speex/16000/1, speex/8000/1, speex/32000/1, iLBC/8000/1, GSM/8000/1, PCMU/8000/1, PCMA/8000/1, G722/16000/1, opus/48000/2, L16/44100/2, L16/44100/1
Traceback (most recent call last):
  File "/ha-sip/main.py", line 133, in <module>
    main()
  File "/ha-sip/main.py", line 121, in main
    mqtt_client = mqtt.create_client_and_connect(command_handler) if mqtt_mode else None
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/ha-sip/mqtt.py", line 74, in create_client_and_connect
    client.connect()
  File "/ha-sip/mqtt.py", line 55, in connect
    self.client.connect(self.broker_address, self.port, 60)
  File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 1435, in connect
    return self.reconnect()
           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 1598, in reconnect
    self._sock = self._create_socket()
                 ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 4609, in _create_socket
    sock = self._create_socket_connection()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 4640, in _create_socket_connection
    return socket.create_connection(addr, timeout=self._connect_timeout, source_address=source)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/socket.py", line 827, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/socket.py", line 962, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno -2] Name does not resolve
14:03:22.164    pjsua_acc.c  ..Unable to create/send REGISTER: Object is busy (PJSIP_EBUSY) [status=171001]
AttributeError: 'Account' object has no attribute 'onRegState'
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

and my flux-configuration:

apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: ha-sip
  namespace: homeassistant
spec:
  interval: 15m
  chart:
    spec:
      chart: app-template
      version: 3.4.0
      sourceRef:
        kind: HelmRepository
        name: bjw-s-charts
        namespace: flux-system
      interval: 15m
  install:
    createNamespace: true
    remediation:
      retries: 5
  upgrade:
    remediation:
      retries: 5
  values:
    controllers:
      ha-sip:
        pod: {}
        containers:
          main:
            image:
              repository: agellhaus/i386-ha-sip
              tag: latest
            env:
              TZ: Europe/Berlin
              COMMAND_SOURCE: "mqtt"

              PORT: "5060"
              LOG_LEVEL: "2"
              NAME_SERVER: "192.168.1.1"
              CACHE_DIR: ""

              SIP1_ENABLED: "True"
              SIP1_ID_URI: "sip:HomeAssistant@192.168.1.1" #"sip:homeassistant@fritz.box"
              SIP1_REGISTRAR_URI: "sip:192.168.1.1"
              SIP1_REALM: "*" #"fritz.box"
              SIP1_USER_NAME: "HomeAssistant"
              SIP1_ANSWER_MODE: "LISTEN"
              SIP1_PASSWORD: "mySuperSecretPassword"
              SIP1_SETTLE_TIME: "1"
              SIP1_INCOMING_CALL_FILE: "" #"/config/incoming.yaml"

              SIP2_ENABLED: "False"
              SIP2_ID_URI: "sip:homeassistantincoming@fritz.box"
              SIP2_REGISTRAR_URI: "sip:fritz.box"
              SIP2_REALM: "*"
              SIP2_USER_NAME: "homeassistantincoming"
              SIP2_PASSWORD: "password"
              SIP2_ANSWER_MODE: "ACCEPT"
              SIP2_SETTLE_TIME: "1"
              SIP2_INCOMING_CALL_FILE: "/config/incoming.yaml"

              SIP3_ENABLED: "False"
              SIP3_ID_URI: "sip:192.168.178.147:5061"
              SIP3_REGISTRAR_URI: ""
              SIP3_REALM: "*"
              SIP3_USER_NAME: ""
              SIP3_PASSWORD: ""
              SIP3_ANSWER_MODE: "LISTEN"
              SIP3_SETTLE_TIME: "1"
              SIP3_INCOMING_CALL_FILE: "/config/incoming.yaml"

              TTS_PLATFORM: "google_translate"
              TTS_LANGUAGE: "de" #"en"

              HA_BASE_URL: "http://homeassistant.mydomain.local/api" #"http://homeassistant.local:8123/api"
              HA_TOKEN: "txJMGI5ODBkMI1NiIsInR5cCI6IkpXVCJ9.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxdsfeiZXhwIjoyMDQyNzc5NTUxfQ.i8VZsnCsfe07wdSSUA8N9RyUlcJtvtjFX1UBKrH7s4fa"
              HA_WEBHOOK_ID: "sip_call_webhook_id_test"

              BROKER_ADDRESS: "mqtt.mydomain.local"
              BROKER_PORT: "1883"
              BROKER_USERNAME: ""
              BROKER_PASSWORD: ""
              MQTT_TOPIC: "hasip/execute"

    service:
      main:
        controller: ha-sip
        ports:
          sip:
            port: 5060

Perhaps the problem is the container agellhaus/i386-ha-sip i used?

Is there a better (offical) one?

Thank you for your help and answers

Propably agellhaus/amd64-ha-sip would make more sense.

And it looks like ha-sip cannot lookup the name for "mqtt.mydomain.local" inside the container.