sdesalve / hassio-addons

MIT License
86 stars 21 forks source link

Error, the call sometimes starts, sometimes not #72

Closed areknames96 closed 1 year ago

areknames96 commented 1 year ago

I managed to configure the plugin with the grandstream gateway, only that about 1/3 of the time the call doesn't start, the other times it starts normally. Where can I look for the problem? The last attempt log was this:

[Info] Listening for messages via stdin service call... [Info] Received messages {"call_sip_uri":"sip:XXXXXXXXXX@192.168.1.XX:5062","audio_file_url":"https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3"} Converting audio file 'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3'... Audio succesfully converted... Starting SIP Client and calling 'sip:XXXXXXXXXX@192.168.1.XX:5062'... This call will be terminated after '50' seconds. 11:37:19.140 os_core_unix.c !pjlib 2.11.1 for POSIX initialized ./run: line 337: echo: write error: Broken pipe ./run: line 337: echo: write error: Broken pipe ./run: line 337: 428 Exit 1 ( sleep $MAX_CALL_TIME_VALUE; echo h; sleep 0.5; echo q ) 429 Segmentation fault (core dumped) | ( pjsua --app-log-level=3 --config-file '/share/dss_voip/dss_pjsua.conf' $CALL_SIP_URI_VALUE 2> /share/dss_voip/dss_pjsua.log ) [Error] pjsua Exit code: 139 [Info] Call ended... [Info] Listening for messages via stdin service call...

areknames96 commented 1 year ago

Here is my addon config:

caller_id_uri: sip:XXXXXXXXXX@192.168.1.XX:5062 realm: "*" username: None password: None

and this is how I call it:

voip_test: alias: Voip test sequence:

sdesalve commented 1 year ago

[Error] pjsua Exit code: 139

https://stackoverflow.com/posts/49414907/revisions

Seems a bug of pjSua...

'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3'... Audio succesfully converted...

This mp3 is longer than pjSua will manage... Read note on add-on's docs

Try a TTS Don't place a call immediately after last call. Let pjSua close connections

Also try microsip.org to place calls thru your gateway to exclude that is grandstream to drop calls

areknames96 commented 1 year ago

I can't get tts to work at all, all the problems I had yesterday depended on that, because I only tried with tts. When I then put audi_file_url, it started working. My tts configuration on configuration.yaml is:

tts:

The log when I run the script is:

[Info] Listening for messages via stdin service call... [Info] Received messages {"call_sip_uri":"sip:XXXXXXXXXX@192.168.1.XX:5062","message_tts":"ciao"} Converting audio file 'https://xxxx.xxxx.xx/api/tts_proxy/dc84715053452b811d4f6bf132909i7af0321782_it_-_google_translate.mp3'... [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.

Thanks for the very fast replies yesterday and today too :)

sdesalve commented 1 year ago

Docs:

https://github.com/sdesalve/hassio-addons/tree/master/dss_voip#features

See TTS suggested configuration

areknames96 commented 1 year ago

I had stuck to this for configuring google_translate: https://www.home-assistant.io/integrations/google_translate I think base_url is considered deprecated, however I also configured like in your guide:

but the result is the same, the plugin crashes, what can be the problem?

EDIT I have solved, I forgot the port at the end of the base_url