[New Addon] DSS VoIP Notifier: Hassio makes phone calls to you! ☎️

Thanks for replying. I got the config to work, as in, I get the call. However, as soon as I pick up, the call gets disconnected. This is the log:

You have 1 active call
Current call id=0 to sip:31*********@sip.cheapconnect.net:5060 [CALLING]
>>> 09:56:50.999            pjsua_app.c  .Turning sound device -99 -99 OFF
09:56:51.394      tsx0x55ddada635c8  .......Temporary failure in sending Request msg INVITE/cseq=6009 (tdta0x55ddada59768), will try next server: Unsupported transport (PJSIP_EUNSUPTRANSPORT)
09:56:55.183            pjsua_app.c  .....Call 0 state changed to EARLY (183 Session Progress)
09:56:55.184            pjsua_app.c  ........Turning sound device -99 -99 ON
09:56:59.346            pjsua_app.c  .....Call 0 state changed to CONNECTING
09:56:59.346           pjsua_call.c  .....Unable to create media session: No active media stream after negotiation (PJMEDIA_SDPNEG_ENOMEDIA) [status=220048]
09:56:59.346            pjsua_app.c  .....Call 0 state changed to CONFIRMED
09:56:59.661            pjsua_app.c  .....Call 0 is DISCONNECTED [reason=488 (Not Acceptable Here)]
09:56:59.661     pjsua_app_common.c  .....
  [DISCONNCTD] To: sip:31*********@sip.cheapconnect.net;tag=MZx0ywiWANwQlEeq.i
    Call time: 00h:00m:00s, 1st res in 5184 ms, conn in 9347ms

Any idea? I tried a bunch of different port/tcp/udp configs, if you want I can add them. For testing purposes I’m using the recommended Google Translate TTS platform.

1 Like

Try to use a Betamax like add-on configuration turning off TCP transport

I did, I’ve been trying a bunch of pjsua options, based on another tool I used which works (sipcli). This is the config I have so far:

pjsua_custom_options: >-
  --no-tcp --srtp-secure=0 --use-srtp=0 --proxy=sip:sip.cheapconnect.net:5060;lr
  --local-port=5070 --no-vad --add-codec=PCMA/8000

The weird thing is, that I sometimes hear half a second of voice - so the audio does work (in theory). It doesn’t seem setting related, 'cause sometimes that happens, sometimes it doesn’t, with the same settings.

If you want, I could PM you a log from the sipcli tool, it has a bunch of info - but I’m not SIP-savvy enough to decode them.

Sorry, I don’t know your provider.
My add-on will use Pjsip library and Pjsua executable to place a call.

You can try on your computer any program that use this lib to find correct configuration. Eg. Microsip.org

Please let me know if you’ll find correct configuration for you case. Otherwise you can try any of other VoIP providers that is listed on docs

I got it to work in microsip, the key there was only have one enabled codec:

sip_working

I looked up the codec’s name in ‘microsip.ini’ and added it to my config, even disabling all others, but still no luck. This is the config (without the disabled list):

pjsua_custom_options: '--no-tcp --add-codec=pcma/8000/1 --no-vad'

Tried it without no-tcp and no-vad, always same message error:

You have 1 active call
Current call id=0 to sip:31*********@sip.cheapconnect.net [CALLING]
>>> 12:10:02.019      tsx0x55e3170f35c8  .......Temporary failure in sending Request msg INVITE/cseq=29570 (tdta0x55e3170e9768), will try next server: Unsupported transport (PJSIP_EUNSUPTRANSPORT)
12:10:02.936            pjsua_app.c  .Turning sound device -99 -99 OFF
12:10:05.871            pjsua_app.c  .....Call 0 state changed to EARLY (183 Session Progress)
12:10:05.872            pjsua_app.c  ........Turning sound device -99 -99 ON
12:10:08.976            pjsua_app.c  .....Call 0 state changed to CONNECTING
12:10:08.976           pjsua_call.c  .....Unable to create media session: No active media stream after negotiation (PJMEDIA_SDPNEG_ENOMEDIA) [status=220048]
12:10:08.976            pjsua_app.c  .....Call 0 state changed to CONFIRMED
12:10:09.050            pjsua_app.c  .....Call 0 is DISCONNECTED [reason=488 (Not Acceptable Here)]
12:10:09.050     pjsua_app_common.c  .....
  [DISCONNCTD] To: sip:31*********@sip.cheapconnect.net;tag=OMAqnCO7F-JM8b-q.i
    Call time: 00h:00m:00s, 1st res in 3935 ms, conn in 7040ms

Any idea? Otherwise I’m giving up.

Seems to be related to codecs incompatibility.

Please post screenshot of add-on logs during start. I want to assure that options was loaded

This is the log, up to what I posted before:

[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: 3.4.0
 You are running the latest version of this add-on.
 System: Ubuntu 18.04.3 LTS  (amd64 / qemux86-64)
 Home Assistant Core: 0.115.3
 Home Assistant Supervisor: 245
-----------------------------------------------------------
 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...
PJSUA_CUSTOM_OPTIONS = '--no-tcp --add-codec=PCMA/8000/1'
[Info] Listening for messages via stdin service call...
[Info] Received messages {"call_sip_uri": "sip:31*********@sip.cheapconnect.net", "message_tts": "This is an automated test message."}
Converting audio file 'http://***.***.***.***:8123/api/tts_proxy/e7d2580f078705fc454b1ed9dc2481c751ef01c6_en_-_google_translate.mp3'...
Audio succesfully converted...
Starting SIP Client and calling 'sip:31*********@sip.cheapconnect.net'...
This call will be terminated after '50' seconds.
13:02:08.576         os_core_unix.c !pjlib 2.9 for POSIX initialized
13:02:08.576         sip_endpoint.c  .Creating endpoint instance...
13:02:08.576                  pjlib  .select() I/O Queue created (0x55ed7ad9bc90)
13:02:08.576         sip_endpoint.c  .Module "mod-msg-print" registered
13:02:08.576        sip_transport.c  .Transport manager created.
13:02:08.576           pjsua_core.c  .PJSUA state changed: NULL --> CREATED
13:02:08.586           pjsua_core.c  .pjsua version 2.9 for Linux-4.15.0.117/x86_64 initialized
13:02:08.587            pjsua_app.c  .Turning sound device -99 -99 ON
13:02:08.587                 main.c  Ready: Success
13:02:08.597            pjsua_app.c  .......Call 0 state changed to CALLING
>>>>
Account list:
  [ 0] <sip:172.30.33.10:5060>: does not register
       Online status: Online
 *[ 1] sip:31*********@sip.cheapconnect.net:5060: does not register
       Online status: Online
Buddy list:
 [ 1] <?>  sip:31*********@sip.cheapconnect.net

Sorry, I can’t figure what kind of setting are needed with cheapconnect.net

I suggest to try to leave only --no-tcp option, call sip:31*********@sip.cheapconnect.net:5060 specifying 5060 port or an ICE server

No luck, but thanks a lot for trying!

This is the log:

[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 HomeAssistant
-----------------------------------------------------------
 Add-on version: 3.3.3
 You are running the latest version of this add-on.
 System: HassOS 4.13  (amd64 / qemux86-64)
 Home Assistant Core: 0.115.3
 Home Assistant Supervisor: 245
-----------------------------------------------------------
 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:[email protected]", "message_tts": "Prova messaggio"}
Converting audio file 'http://192.168.1.157:8123/api/tts_proxy/772c970523ed7389b60b2ed1b674b3705d965e37_it_-_google_translate.mp3'...
Audio succesfully converted...
Starting SIP Client and calling 'sip:[email protected]'...
This call will be terminated after '50' seconds.
16:41:09.278         os_core_unix.c !pjlib 2.9 for POSIX initialized
16:41:09.279         sip_endpoint.c  .Creating endpoint instance...
16:41:09.279                  pjlib  .select() I/O Queue created (0x555c5e79ec90)
16:41:09.279         sip_endpoint.c  .Module "mod-msg-print" registered
16:41:09.279        sip_transport.c  .Transport manager created.
16:41:09.279           pjsua_core.c  .PJSUA state changed: NULL --> CREATED
16:41:09.303           pjsua_core.c  .pjsua version 2.9 for Linux-5.4.63/x86_64 initialized
16:41:09.305            pjsua_app.c  .Turning sound device -99 -99 ON
16:41:09.305                 main.c  Ready: Success
16:41:09.407            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:[email protected]: does not register
       Online status: Online
Buddy list:
 [ 1] <?>  sip:[email protected]
+=============================================================================+
|       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:[email protected] [CALLING]
>>> 16:41:09.735     tcpc0x555c5e7f51a8  TCP connect() error: [code=120111]: Connection refused
16:41:09.735      tsx0x555c5e7df4a8  Temporary failure in sending Request msg INVITE/cseq=22216 (tdta0x555c5e7eb5e8), will try next server: Connection refused
16:41:09.735            pjsua_app.c  SIP TCP transport is disconnected from 83.211.227.21:5060: Connection refused [status=120111]
16:41:10.305            pjsua_app.c  .Turning sound device -99 -99 OFF
16:41:10.967            pjsua_app.c  .....Call 0 is DISCONNECTED [reason=403 (Forbidden)]
16:41:10.967     pjsua_app_common.c  .....
  [DISCONNCTD] To: sip:[email protected]
    Call time: 00h:00m:00s, 1st res in 1662 ms, conn in 0ms
No current call
[Info] Call ended...
[Info] Listening for messages via stdin service call...

And this is the config:

sip_parameters:
  caller_id_uri: 'sip:[email protected]'
  realm: '*'
  username: xxxxxxx
  password: xxxxxxx

One question, are you Italian?

Yes, I’m Italian. Send me a PM so we try to solve your problem. I’ve sended you a PM

Hey @sdesalve, sorry - back again :stuck_out_tongue: Went with 3CX and that works like a charm!

However, when switching to Amazon Polly for TTS, I get the following error:

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.

This is the config line I use:

platform_tts: amazon_polly_say

Any clue? It works fine with the default TTS, so this is just a nice-to-have as I think Amazon’s voices sound more natural.

Thanks again, sorry for bothering :slight_smile:

perfect!

Please post a screenshot (censured) of your config. I need to view leading spaces.

Then post a screenshot of addon logs during startup…

replace amazon_polly_say with amazon_polly

Config:

3cx_config

Log:

However, in the docs, when you want to use Polly in an automation you have to use:

- service: tts.amazon_polly_say
  data:
    message: '<speak>Hello from Amazon Polly</speak>'

So I tried ‘amazon_polly_say’ as well, but no luck. I tried with the speak tags as well, but no luck.

I confirm you must use amazon_polly wihout _say

Then Please post your /share/dss_voip/dss_pjsua.log file (please censure it!)

PLATFORM_TTS = 'amazon_polly'
sip_parameters = '{"caller_id_uri":"sip:***@**********.3cx.nl","realm":"*","username":"**********","password":"**********"}'
[Info] Received messages '{"call_sip_uri": "sip:316********@:***@**********.3cx.nl", "message_tts": "<speak>This is an automated test message.</speak>"}'
CALL_SIP_URI_VALUE = 'sip:316********@:***@**********.3cx.nl'
MESSAGE_TTS_VALUE = '<speak>This is an automated test message.</speak>'
DATA_JSON = '{
  "message": "<speak>This is an automated test message.</speak>",
  "platform": "amazon_polly"
}'
JSONGOOGLETTS = '500 Internal Server Error

Server got itself in trouble'

As a test, I tried one without the speak tags, but it gave exactly the same message.

Ok, nevermind! I had to first disable the Google Translate TTS in config, then it started working :slight_smile: Guess you can only have one enabled at a time.

Thanks for all your help!

1 Like

I saw a post somewhere that indicated that amazon_polly was currently broken.

Hi,
First of all thank you for the great job.

Long time is passed since you “promised” a docker version. Have you had the chance to implement it?