sdesalve / hassio-addons

MIT License
87 stars 21 forks source link

DSS VoIP Notifier: parse error: Expected string key before ':' at line 1, column 4 #96

Closed f18m closed 8 months ago

f18m commented 8 months ago

Hi @sdesalve , I'm getting an error when I try to use the DSS VoIP Notifier. This is the complete log of the add-on:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 

-----------------------------------------------------------
 Add-on: DSS VoIP Notifier
 VoIP Notifier for Home Assistant
-----------------------------------------------------------
 Add-on version: 4.0.0
 You are running the latest version of this add-on.
 System: Debian GNU/Linux 12 (bookworm)  (amd64 / qemux86-64)
 Home Assistant Core: 2024.3.3
 Home Assistant Supervisor: 2024.03.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[Info] Starting addon...
[Info] Listening for messages via stdin service call...
[Info] Received messages {"call_sip_uri":"sip:+393391300XXX@voip.eutelia.it","message_tts":"Prova messaggio"}
parse error: Expected string key before ':' at line 1, column 4
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 99-message.sh: executing... 
[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

(just note that I obscured the last 3 digits of the cellphone I'm calling for privacy reasons). Note that I'm using the service from the HA "Developer tools" -> Services tab:

image

sdesalve commented 8 months ago

https://github.com/sdesalve/hassio-addons/issues?q=Expected+string+

f18m commented 8 months ago

hi @sdesalve , sorry but I still have some trouble. I looked at the other tickets you linked and I added the "tts" section in my configuration.yaml. Now I get the following error:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 

-----------------------------------------------------------
 Add-on: DSS VoIP Notifier
 VoIP Notifier for Home Assistant
-----------------------------------------------------------
 Add-on version: 4.0.0
 You are running the latest version of this add-on.
 System: Debian GNU/Linux 12 (bookworm)  (amd64 / qemux86-64)
 Home Assistant Core: 2024.4.0
 Home Assistant Supervisor: 2024.03.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[Info] Starting addon...
[Info] Listening for messages via stdin service call...
[Info] Received messages {"call_sip_uri":"sip:+393391300XXX@voip.eutelia.it","message_tts":"Prova messaggio"}
jq: error (at <stdin>:1): Cannot index number with string "url"
parse error: Invalid numeric literal at line 1, column 13
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 99-message.sh: executing... 
[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

do you know off-hand what that means?

f18m commented 8 months ago

I noticed that in the dss_psjua.log file the entry for the TTS service contains:

JSONGOOGLETTS = '500 Internal Server Error

Server got itself in trouble'

I have no clue why it happens though

f18m commented 8 months ago

I did find in the HA logs the following stack trace associated with the 500 Internal Server Error:

Registratore: aiohttp.server
Fonte: /usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py:421
Prima occorrenza: 01:00:57 (1 occorrenze)
Ultima registrazione: 01:00:57

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 88, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 1017, in post
    base = get_url(self.tts.hass)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/network.py", line 208, in get_url
    raise NoURLAvailableError
homeassistant.helpers.network.NoURLAvailableError
f18m commented 8 months ago

Actually I realized the error was related to the wrong setting of the HA external URL. I have fixed that in my HA -> settings -> network panel. Next trouble is related to the call that is not going through... I get this:

[Info] Received messages {"call_sip_uri":"sip:3391300XXX@voip.eutelia.it","message_tts":"Prova messaggio"}
Converting audio file 'https://myurl.duckdns.org/api/tts_proxy/a772c970523ed7389b60b2ed1b674b3705d965e37_no_-_google_translate.mp3'...
Audio succesfully converted...
Starting SIP Client and calling 'sip:3391300XXX@voip.eutelia.it'...
This call will be terminated after '50' seconds.
01:05:48.530         os_core_unix.c !pjlib 2.11.1 for POSIX initialized
01:05:48.530         sip_endpoint.c  .Creating endpoint instance...
01:05:48.530                  pjlib  .select() I/O Queue created (0x7f76fc615100)
01:05:48.530         sip_endpoint.c  .Module "mod-msg-print" registered
01:05:48.530        sip_transport.c  .Transport manager created.
01:05:48.530           pjsua_core.c  .PJSUA state changed: NULL --> CREATED
01:05:48.537           pjsua_core.c  .pjsua version 2.11.1 for Linux-6.1.0.18/x86_64 initialized
01:05:48.539            pjsua_app.c  .Turning sound device -99 -99 ON
01:05:48.539                 main.c  Ready: Success
01:05:48.540            pjsua_app.c  .......Call 0 state changed to CALLING
>>>>
Account list:
  [ 0] <sip:172.30.33.4:5060>: does not register
       Online status: Online
  [ 1] <sip:172.30.33.4:5060;transport=TCP>: does not register
       Online status: Online
 *[ 2] sip:0595964988@voip.eutelia.it: does not register
       Online status: Online
Buddy list:
 [ 1] <?>  sip:3391300XXX@voip.eutelia.it

+=============================================================================+
|       Call Commands:         |   Buddy, IM & Presence:  |     Account:      |
|                              |                          |                   |
|  m  Make new call            | +b  Add new buddy       .| +a  Add new accnt |
|  M  Make multiple calls      | -b  Delete buddy         | -a  Delete accnt. |
|  a  Answer call              |  i  Send IM              | !a  Modify accnt. |
|  h  Hangup call  (ha=all)    |  s  Subscribe presence   | rr  (Re-)register |
|  H  Hold call                |  u  Unsubscribe presence | ru  Unregister    |
|  v  re-inVite (release hold) |  t  ToGgle Online status |  >  Cycle next ac.|
|  U  send UPDATE              |  T  Set online status    |  <  Cycle prev ac.|
| ],[ Select next/prev call    +--------------------------+-------------------+
|  x  Xfer call                |      Media Commands:     |  Status & Config: |
|  X  Xfer with Replaces       |                          |                   |
|  #  Send RFC 2833 DTMF       | cl  List ports           |  d  Dump status   |
|  *  Send DTMF with INFO      | cc  Connect port         | dd  Dump detailed |
| dq  Dump curr. call quality  | cd  Disconnect port      | dc  Dump config   |
|                              |  V  Adjust audio Volume  |  f  Save config   |
|  S  Send arbitrary REQUEST   | Cp  Codec priorities     |                   |
+-----------------------------------------------------------------------------+
|  q  QUIT   L  ReLoad   sleep MS   echo [0|1|txt]     n: detect NAT type     |
+=============================================================================+
You have 1 active call
Current call id=0 to sip:3391300XXX@voip.eutelia.it [CALLING]
>>> 01:05:49.539            pjsua_app.c  .Turning sound device -99 -99 OFF
01:06:20.561            pjsua_app.c  ....Call 0 is DISCONNECTED [reason=408 (Request Timeout)]
No current call
>>> 01:06:40.051                timer.c  .Dumping timer heap:
01:06:40.051                timer.c  .  Cur size: 0 entries, max: 3070
[Info] Call ended...
[Info] Listening for messages via stdin service call...

getting closer..

sdesalve commented 8 months ago

Ok. Domanda stupida: c'è credito sull'account?

sdesalve commented 8 months ago

sip:3391300XXX@voip.eutelia.it

E dimmi che il numero scritto qui è corretto nella tua configurazione

f18m commented 8 months ago

Ok. Domanda stupida: c'è credito sull'account?

si c'e' credito, ho verificato. Sono anche riuscito ad usare il numero di telefono attivo tramite un softphone come Zoiper.

sip:3391300XXX@voip.eutelia.it E dimmi che il numero scritto qui è corretto nella tua configurazione

si si è corretto, l'ho solo oscurato per privacy su questa github issue...

Stasera posso tentare altre idee... ma attualmente sono un pò a corto di idee. Posso provare ad usare pjsua direttamente da command-line di un sistema Linux? Come posso lanciarlo per fare una chiamata base, avendo a disposizione un MP3 come audio?

grazie!!

sdesalve commented 8 months ago

metti

1 configurazione TTS 2 configurazione addon 3 log completo addon dall'avvio all'errore

f18m commented 8 months ago

metti

1 configurazione TTS 2 configurazione addon 3 log completo addon dall'avvio all'errore

ok certo, ecco la configurazione TTS:

tts:
 - platform: google_translate
   service_name: google_translate_say
   language: "no"

la configurazione dell'addon:

caller_id_uri: sip:0595964988@voip.eutelia.it
realm: "*"
username: "0595964988"
password: HIDDEN_JUST_IN_THIS_GITHUB_ISSUE

e il log dell'addon:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 

-----------------------------------------------------------
 Add-on: DSS VoIP Notifier
 VoIP Notifier for Home Assistant
-----------------------------------------------------------
 Add-on version: 4.0.0
 You are running the latest version of this add-on.
 System: Debian GNU/Linux 12 (bookworm)  (amd64 / qemux86-64)
 Home Assistant Core: 2024.4.0
 Home Assistant Supervisor: 2024.03.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[Info] Starting addon...
[Info] Listening for messages via stdin service call...
[Info] Received messages {"call_sip_uri":"sip:3391300XXX@voip.eutelia.it","message_tts":"Prova messaggio"}
Converting audio file 'https://xxx.duckdns.org/api/tts_proxy/772c970523ed7389b60b2ed1b674b3705d965e37_no_-_google_translate.mp3'...
Audio succesfully converted...
Starting SIP Client and calling 'sip:3391300XXX@voip.eutelia.it'...
This call will be terminated after '50' seconds.
23:53:16.038         os_core_unix.c !pjlib 2.11.1 for POSIX initialized
23:53:16.039         sip_endpoint.c  .Creating endpoint instance...
23:53:16.039                  pjlib  .select() I/O Queue created (0x7f5c4893a100)
23:53:16.039         sip_endpoint.c  .Module "mod-msg-print" registered
23:53:16.039        sip_transport.c  .Transport manager created.
23:53:16.039           pjsua_core.c  .PJSUA state changed: NULL --> CREATED
23:53:16.050           pjsua_core.c  .pjsua version 2.11.1 for Linux-6.1.0.18/x86_64 initialized
23:53:16.060            pjsua_app.c  .Turning sound device -99 -99 ON
23:53:16.061                 main.c  Ready: Success
23:53:16.070            pjsua_app.c  .......Call 0 state changed to CALLING
>>>>
Account list:
  [ 0] <sip:172.30.33.4:5060>: does not register
       Online status: Online
  [ 1] <sip:172.30.33.4:5060;transport=TCP>: does not register
       Online status: Online
 *[ 2] sip:0595964988@voip.eutelia.it: does not register
       Online status: Online
Buddy list:
 [ 1] <?>  sip:3391300XXX@voip.eutelia.it

+=============================================================================+
|       Call Commands:         |   Buddy, IM & Presence:  |     Account:      |
|                              |                          |                   |
|  m  Make new call            | +b  Add new buddy       .| +a  Add new accnt |
|  M  Make multiple calls      | -b  Delete buddy         | -a  Delete accnt. |
|  a  Answer call              |  i  Send IM              | !a  Modify accnt. |
|  h  Hangup call  (ha=all)    |  s  Subscribe presence   | rr  (Re-)register |
|  H  Hold call                |  u  Unsubscribe presence | ru  Unregister    |
|  v  re-inVite (release hold) |  t  ToGgle Online status |  >  Cycle next ac.|
|  U  send UPDATE              |  T  Set online status    |  <  Cycle prev ac.|
| ],[ Select next/prev call    +--------------------------+-------------------+
|  x  Xfer call                |      Media Commands:     |  Status & Config: |
|  X  Xfer with Replaces       |                          |                   |
|  #  Send RFC 2833 DTMF       | cl  List ports           |  d  Dump status   |
|  *  Send DTMF with INFO      | cc  Connect port         | dd  Dump detailed |
| dq  Dump curr. call quality  | cd  Disconnect port      | dc  Dump config   |
|                              |  V  Adjust audio Volume  |  f  Save config   |
|  S  Send arbitrary REQUEST   | Cp  Codec priorities     |                   |
+-----------------------------------------------------------------------------+
|  q  QUIT   L  ReLoad   sleep MS   echo [0|1|txt]     n: detect NAT type     |
+=============================================================================+
You have 1 active call
Current call id=0 to sip:3391300XXX@voip.eutelia.it [CALLING]
>>> 23:53:17.061            pjsua_app.c  .Turning sound device -99 -99 OFF
23:53:48.092            pjsua_app.c  ....Call 0 is DISCONNECTED [reason=408 (Request Timeout)]
No current call
>>> 23:54:07.567                timer.c  .Dumping timer heap:
23:54:07.567                timer.c  .  Cur size: 0 entries, max: 3070
[Info] Call ended...
[Info] Listening for messages via stdin service call...
f18m commented 8 months ago

Attenzione: mi e' capitato di leggere nel README che per certi operatori FreeVoipDeal/Any other Dellmont/Betamax serve come opzione '--no-tcp'. L'ho provata e ho ricevuto la chiamata!! finalmente!

Forse va aggiornata la docu per indicare che serve --no-tcp anche per Irideos/Eutelia ?

sdesalve commented 8 months ago

Fammi capire

language: "no"

Hai messo no per norvegese?

call_sip_uri":"sip:3391300XXX@voip.eutelia.it","message_tts":"Prova

Vuoi chiamare un +33 senza mettere il + o un +39 e lo stai omettendo?

Prova a mettere nelle pjsua options --no-tcp

f18m commented 8 months ago

Fammi capire

language: "no"

Hai messo no per norvegese?

Si mi sono sbagliato. Appena ho sentito l'audio ho realizzato e corretto in "it".

call_sip_uri":"sip:3391300XXX@voip.eutelia.it","message_tts":"Prova

Vuoi chiamare un +33 senza mettere il + o un +39 e lo stai omettendo?

un +39 e sto omettendo il prefisso. Dici che è meglio esplicitarlo?

Prova a mettere nelle pjsua options --no-tcp

si con questa opzione è andata! Meglio aggiungerlo nel README?