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

As you should already know, add-ons are available only on Hass.io
You can use my addon to make a script that add VoIP to you HomeAssistant, but I’m not able to help you. Sorry

Good job!

will this work if my Home assistant is local without any port forward or cloud subscription?

Ciao Salvatore!
Great Addon. Does it work with other TTS engines, like the offline MaryTTS?
My Hassio is behind a firewall with GeoIP blocking, only allowing incoming connections from my country.
If it is not, then I will try to first make the mp3 and then call (via 3cx) this file.

Grazie, Mario

Hi Mario,
for simplicity I’ve choosed to use Google Translate TTS integration because I use it, like most part of other Hass.io’s users…

You can also use a local/remote MP3 file that can be generated on the fly…

If you want, please run this SSH command and send me a PM with JSON response… I can evaluate if let users to choose platform to generate their TTS mp3

$ curl -X POST -H "x-ha-access: Bearer VERY_LONG_LIFE_TOKEN" \
       -H "Content-Type: application/json" \
       -d '{"message": "I am speaking now", "platform": "marytts"}' \
       http://localhost:8123/api/tts_get_url

Saluti
Salvatore

It should be possible, but obviously you need a local PBX to issue a call

Now you can use platform_tts option…

Hey, thank you for this addon! It somehow won’t work successfully with my provider and settings and I don’t know why. The call itself is working (telephones ringing) but I can’t hear any sounds - tried it with tts and also with the audio file that you suggested on github.

This is the log of your addon:

Converting audio file 'https://xxx/api/tts_proxy/3bb4cd06a7898fc0a33665f241cb48f2f2a192ac_en_-_google_translate.mp3'...
Audio succesfully converted...
Starting SIP Client and calling 'sip:[email protected]'...
23:51:51.970         os_core_unix.c !pjlib 2.9 for POSIX initialized
23:51:51.970         sip_endpoint.c  .Creating endpoint instance...
23:51:51.970                  pjlib  .select() I/O Queue created (0x559b60bc4c90)
23:51:51.970         sip_endpoint.c  .Module "mod-msg-print" registered
23:51:51.970        sip_transport.c  .Transport manager created.
23:51:51.970           pjsua_core.c  .PJSUA state changed: NULL --> CREATED
23:51:51.976           pjsua_core.c  .pjsua version 2.9 for Linux-5.0.0.37/x86_64 initialized
23:51:51.977            pjsua_app.c  .Turning sound device -99 -99 ON
23:51:51.977                 main.c  Ready: Success
23:51:51.979            pjsua_app.c  .......Call 0 state changed to CALLING
>>>>
Account list:
  [ 0] <sip:172.xxxx.4:5060>: does not register
       Online status: Online
  [ 1] <sip:172.xxxx.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]
>>> 23:51:52.013     tcpc0x559b60c1aec8  TCP connect() error: [code=120111]: Connection refused
23:51:52.013      tsx0x559b60c1a2e8  Temporary failure in sending Request msg INVITE/cseq=29543 (tdta0x559b60c115e8), will try next server: Connection refused
23:51:52.013            pjsua_app.c  SIP TCP transport is disconnected from 212xxxxxx.104:5060: Connection refused [status=120111]
23:51:52.977            pjsua_app.c  .Turning sound device -99 -99 OFF
23:52:01.739            pjsua_app.c  .....Call 0 state changed to EARLY (180 Ringing)
23:52:01.740            pjsua_app.c  ........Turning sound device -99 -99 ON
23:52:04.080            pjsua_app.c  .....Call 0 state changed to CONNECTING
23:52:04.085            pjsua_app.c  .....Call 0 state changed to CONFIRMED
>>> 23:52:41.987            pjsua_app.c  .....Call 0 is DISCONNECTED [reason=200 (Normal call clearing)]
23:52:41.987     pjsua_app_common.c  .....
  [DISCONNCTD] To: sip:[email protected];tag=00-08190-4c71165b-1aecb5c21
    Call time: 00h:00m:37s, 1st res in 9762 ms, conn in 12108ms
    #0 audio PCMU @8kHz, sendrecv, peer=-
       SRTP status: Not active Crypto-suite: 
       RX pt=0, last update:00h:00m:01.665s ago
          total 0pkt 0B (0B +IP hdr) @avg=0bps/0bps
          pkt loss=0 (0.0%), discrd=0 (0.0%), dup=0 (0.0%), reord=0 (0.0%)
                (msec)    min     avg     max     last    dev
          loss period:   0.000   0.000   0.000   0.000   0.000
          jitter     :   0.000   0.000   0.000   0.000   0.000
       TX pt=0, ptime=20, last update:never
          total 1.3Kpkt 211.8KB (264.8KB +IP hdr) @avg=42.1Kbps/52.6Kbps
          pkt loss=0 (0.0%), dup=0 (0.0%), reorder=0 (0.0%)
                (msec)    min     avg     max     last    dev 
          loss period:   0.000   0.000   0.000   0.000   0.000
          jitter     :   0.000   0.000   0.000   0.000   0.000
       RTT msec      :   0.000   0.000   0.000   0.000   0.000
23:52:42.988            pjsua_app.c  ..Turning sound device -99 -99 OFF
[Info] Call ended...

Personal information redacted of course. Would be great if you could help me.

Hi,
Please try no-tcp option.

Do you have a Fritz!Box router or other kind of firewall?
Is your internet connection behind a NAT? Does your VoIP service has a STUN server available so you can specify it into pjsua option?

It didn’t work with the no-tcp options but it did work when I switched to the Fritz!Box example.

{
  "sip_parameters": {
    "caller_id_uri": "sip:[email protected]:5060",
    "realm": "*",
    "username": "user",
    "password": "password"
  },
  "pjsua_custom_options": "--ip-addr=192.168.XXX"
}

I had to figure that one out as well, because I registered a new system user the first time and not a new user via the telephone menu (telephone - telephone devices - new device - ip device). Now it’s working perfectly. Thank you!

1 Like

Hi SDeSalve,

I just successfully made my first call using your addon and my fritzbox.
Love your work!

I’m buying you a :coffee:

ciao,
Boris

1 Like

Hi @Boris!

Glad that you like my work!

Thanks very much for the :coffee:

Bye!
SDeSalve

Hi,

I’ve try the addon with account 12voip but unsuccessfully…

I have this error on log:

Current call id=0 to sip:[email protected] [CALLING]
>>> 21:59:08.519      tsx0x562ecf995408  .......Temporary failure in sending Request msg INVITE/cseq=16120 (tdta0x562ecf98c708), will try next server: Unsupported transport (PJSIP_EUNSUPTRANSPORT)
21:59:08.519      tsx0x562ecf995408  .......Temporary failure in sending Request msg INVITE/cseq=16120 (tdta0x562ecf98c708), will try next server: Unsupported transport (PJSIP_EUNSUPTRANSPORT)
21:59:08.568            pjsua_app.c  .....Call 0 is DISCONNECTED [reason=403 (Forbidden)]

Config:

sip_parameters:
  caller_id_uri: 'sip:[email protected]'
  realm: '*'
  username: username
  password: password
pjsua_custom_options: '--no-tcp'

What the problem? My config?

Thank you for your help.

Hi Ricain

Have you enabled SIP calls from website www.12voip.com?
image
Have you double checked your username/password? Have you tried to place username & password behind quotes?

Try this way:

sip_parameters:
  caller_id_uri: 'sip:[email protected]'
  realm: '*'
  username: 'myusername'
  password: 'mysecretpassword'
pjsua_custom_options: '--no-tcp'

Hi @sdesalve,

yes i have checked “enable” on settings of 12voip and tried quotes, but error continu:

Current call id=0 to sip:[email protected] [CALLING]
>>> 13:17:43.869      tsx0x55e32f811408  .......Temporary failure in sending Request msg INVITE/cseq=31954 (tdta0x55e32f808708), will try next server: Unsupported transport (PJSIP_EUNSUPTRANSPORT)
13:17:43.869      tsx0x55e32f811408  .......Temporary failure in sending Request msg INVITE/cseq=31954 (tdta0x55e32f808708), will try next server: Unsupported transport (PJSIP_EUNSUPTRANSPORT)
13:17:43.917            pjsua_app.c  .....Call 0 is DISCONNECTED [reason=403 (Forbidden)]
13:17:43.917     pjsua_app_common.c  .....
  [DISCONNCTD] To: sip:[email protected]
    Call time: 00h:00m:00s, 1st res in 109 ms, conn in 0ms
13:17:44.807            pjsua_app.c  .Turning sound device -99 -99 OFF
No current call
[Info] Call ended...
[Info] Listening for messages via stdin service call...

you must wait some time after enabling SIP call…

How do this? It’s possible configure this time?
Edit: A call is not doing. I am not receiving any call. The timeout is on addon… It’s possible increase timeout on addon?

Hello sdesalve

Thank you for this really great project, works perfect for me.

Just one little question, is it possible to send a DTMF Option Code during the call?

Thanks Noah

1 Like

I fear that pjsua do not allow to send DTMF from command line…
But I think that you can use audio_file_url option to play to the attendee an MP3 file with choosen DTMF tones…

bye

Great idea! And it is working perfectly, I have just tested it. With this method you can trigger a SIP enabled door opener.

1 Like

Any hints what could be wrong with my setup, can’t get any calls through. I have enabled the SIP Server from Freevoideal settings and have hassio with HA Cloud account as well. (read through this thread to try to catch any errors I’ve made but could not figure it out)

sip_parameters:
  caller_id_uri: 'sip:[email protected]'
  realm: '*'
  username: MyUsername
  password: MyVoipPassword
pjsua_custom_options: '--no-tcp'

[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.2
 You are running the latest version of this add-on.
 System: HassOS 4.9  (amd64 / intel-nuc)
 Home Assistant Core: 0.110.5
 Home Assistant Supervisor: 227
-----------------------------------------------------------
 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'
[Info] Listening for messages via stdin service call...
[Info] Received messages {"call_sip_uri": "sip:[email protected]", "message_tts": "test"}
Converting audio file 'http://LocalHassioIP:8123/api/tts_proxy/a94a8fe5ccb19ba61c4c0873d391e987982fbbd3_fi_-_google_translate.mp3'...
Audio succesfully converted...
Starting SIP Client and calling 'sip:[email protected]'...
This call will be terminated after '50' seconds.
22:10:39.191         os_core_unix.c !pjlib 2.9 for POSIX initialized
22:10:39.191         sip_endpoint.c  .Creating endpoint instance...
22:10:39.191                  pjlib  .select() I/O Queue created (0x55eaefbc6c90)
22:10:39.191         sip_endpoint.c  .Module "mod-msg-print" registered
22:10:39.191        sip_transport.c  .Transport manager created.
22:10:39.191           pjsua_core.c  .PJSUA state changed: NULL --> CREATED
22:10:39.204           pjsua_core.c  .pjsua version 2.9 for Linux-5.4.44/x86_64 initialized
22:10:39.206            pjsua_app.c  .Turning sound device -99 -99 ON
22:10:39.206                 main.c  Ready: Success
22:10:39.210            pjsua_app.c  .......Call 0 state changed to CALLING
>>>>
Account list:
  [ 0] <sip:myip:5060>: does not register
       Online status: Online
 *[ 1] 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]
>>> 22:10:40.205            pjsua_app.c  .Turning sound device -99 -99 OFF
22:11:11.211            pjsua_app.c  ....Call 0 is DISCONNECTED [reason=408 (Request Timeout)]
22:11:11.211     pjsua_app_common.c  ....
  [DISCONNCTD] To: sip:[email protected]
    Call time: 00h:00m:00s, 1st res in 32005 ms, conn in 0ms
No current call
[Info] Call ended...
[Info] Listening for messages via stdin service call...