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

Thank you. Where could I find more information about your mentioned python library?

Google is your friend!
https://www.google.com/search?q=pjsip+python+hassio

1 Like

Hi guys!
First of all thanks to @sdesalve for the addon and, moreover, for the great supporto here.
I tried to setup the environment and to read the whole topic, but I don’t understand how to call the service to make a phone call to my mobile or if it is possible.
I’m using a Fritz, I’ve configured the IP phone on the interface and I’ve configured the addon and the tts (Picotts).
Just created a test script… but… What should I write as call_sip_uri for a mobile phone number?
Here the log of the addon generated after my first test

[Info] Starting addon...
PJSUA_CUSTOM_OPTIONS = '--ip-addr=192.168.1.10'
PLATFORM_TTS = 'picotts'
[Info] Listening for messages via stdin service call...
[Info] Received messages {"call_sip_uri":"sip:[email protected]:5060","message_tts":"Ciao Sono Io!"}
Converting audio file 'http://192.168.1.10:8123/api/tts_proxy/aebc66490ae73df55e0d940189d10acab54a38d6_it-it_-_picotts.mp3'...
Audio succesfully converted...
Starting SIP Client and calling 'sip:[email protected]:5060'...
This call will be terminated after '50' seconds.
16:04:47.707         os_core_unix.c !pjlib 2.11.1 for POSIX initialized
16:04:47.707         sip_endpoint.c  .Creating endpoint instance...
16:04:47.707                  pjlib  .select() I/O Queue created (0x7fa2292100)
16:04:47.707         sip_endpoint.c  .Module "mod-msg-print" registered
16:04:47.707        sip_transport.c  .Transport manager created.
16:04:47.707           pjsua_core.c  .PJSUA state changed: NULL --> CREATED
16:04:47.718           pjsua_core.c  .pjsua version 2.11.1 for Linux-6.1.63/aarch64 initialized
16:04:47.718            pjsua_app.c  .Turning sound device -99 -99 ON
16:04:47.718                 main.c  Ready: Success
16:04:47.719            pjsua_app.c  .......Call 0 state changed to CALLING
>>>>
Account list:
  [ 0] <sip:192.168.1.10:5060>: does not register
       Online status: Online
  [ 1] <sip:192.168.1.10:5060;transport=TCP>: does not register
       Online status: Online
 *[ 2] sip:**[email protected]:5060: does not register
       Online status: Online
Buddy list:
 [ 1] <?>  sip:[email protected]:5060

+=============================================================================+
|       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]:5060 [CALLING]
>>> 16:04:48.718            pjsua_app.c  .Turning sound device -99 -99 OFF
16:05:19.719            pjsua_app.c  ....Call 0 is DISCONNECTED [reason=408 (Request Timeout)]
No current call
>>> 16:05:39.225                timer.c  .Dumping timer heap:
16:05:39.225                timer.c  .  Cur size: 0 entries, max: 3070
[Info] Call ended...

add

--no-tcp

Is your Fritz box’s IP 192.168.1.1?

[email protected]:5060

please post here your config and your script…

Yes, 192.168.1.1 is the fritz and 10 is the rasp.
Here the addon config (after your suggestion for --no-tcp):

sip_parameters:
  caller_id_uri: sip:**[email protected]:5060
  realm: "*"
  username: user
  password: passUser
pjsua_custom_options: "--ip-addr=192.168.1.10 --no-tcp"
platform_tts: picotts

I tried also to replace **620 with username
Here the script:

test_chiamata:
  alias: Test_Chiamata
  sequence:
  - service: hassio.addon_stdin
    data:
      addon: 89275b70_dss_voip
      input:
        call_sip_uri: "sip:[email protected]:5060"
        message_tts: "Ciao Sono io"
  mode: single
  icon: mdi:cellphone

Have you used _ARM version? Can you try to switch beetween ARM version/standard version?

Hi @sdesalve,
thanks for the addon. I’m having issues with setting it up for my FritzBox.
After I start the addon and execute the service call, the addon stops before the call is started.

Im running hassio on a Raspberry Pi 4 and am using the ARM version of the addon. Fritzbox VoIP call filters are deactivated and I have setup an internal phone number for home assistant.
IP FritzBox: 192.168.178.1
IP Raspberry: 192.168.178.69

Addon config:

sip_parameters:
  caller_id_uri: sip:[email protected]:5060
  realm: "*"
  username: homeassistant
  password: xxxxx
pjsua_custom_options: "--ip-addr=192.168.178.69 --no-tcp"

Service call:

service: hassio.addon_stdin
data:
  addon: 89275b70_dss_voiparm
  input:
    call_sip_uri: "sip:**[email protected]:5060"
    audio_file_url: "http:192.168.178.69:8123/local/notification.mp3"

Addon logs

[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 for ARM
 VoIP Notifier for Home Assistant (for ARM processors)
-----------------------------------------------------------
 Add-on version: 4.1.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 11.5  (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2024.2.1
 Home Assistant Supervisor: 2024.01.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...
PJSUA_CUSTOM_OPTIONS = '--ip-addr=192.168.178.69 --no-tcp'
[Info] Listening for messages via stdin service call...
[Info] Received messages {"call_sip_uri":"sip:**[email protected]:5060","audio_file_url":"http:192.168.178.69:8123/local/notification.mp3"}
Converting audio file 'http:192.168.178.69:8123/local/notification.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.

**622 is the internal number I am trying to call. I have also tried with external phone numbers. The audio file url also works when opening it in a browser.

The SIP user and password are also correct. When I have tried with the sip_server_uri option, I was able to call the call the internal number of the addon to hear the confirmation message that it is running.

Anything else I can try? Thank you!

@sdesalve , no I’m using the standard version not the arm… If you want, I can switch.

there is some issue with your TTS config…
please check your configuration.yaml

yes please…

@sdesalve Almost the same log also with ARM version

Audio succesfully converted...
Starting SIP Client and calling 'sip:[email protected]:5060'...
This call will be terminated after '50' seconds.
21:30:52.501         os_core_unix.c !pjlib 2.9 for POSIX initialized
21:30:52.501         sip_endpoint.c  .Creating endpoint instance...
21:30:52.502                  pjlib  .select() I/O Queue created (0x557d40dc90)
21:30:52.502         sip_endpoint.c  .Module "mod-msg-print" registered
21:30:52.502        sip_transport.c  .Transport manager created.
21:30:52.502           pjsua_core.c  .PJSUA state changed: NULL --> CREATED
21:30:52.511           pjsua_core.c  .pjsua version 2.9 for Linux-6.1.63/aarch64 initialized
21:30:52.511            pjsua_app.c  .Turning sound device -99 -99 ON
21:30:52.511                 main.c  Ready: Success
21:30:52.511            pjsua_app.c  .......Call 0 state changed to CALLING
>>>>
Account list:
  [ 0] <sip:192.168.1.10:5060>: does not register
       Online status: Online
 *[ 1] sip:**[email protected]:5060: does not register
       Online status: Online
Buddy list:
 [ 1] <?>  sip:[email protected]:5060

+=============================================================================+
|       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]:5060 [CALLING]
>>> 21:30:53.511            pjsua_app.c  .Turning sound device -99 -99 OFF
21:31:24.511            pjsua_app.c  ....Call 0 is DISCONNECTED [reason=408 (Request Timeout)]
21:31:24.511     pjsua_app_common.c  ....
  [DISCONNCTD] To: sip:[email protected]

    Call time: 00h:00m:00s, 1st res in 32000 ms, conn in 0ms
No current call
[Info] Call ended...
[Info] Listening for messages via stdin service call...

P.S. it’s a rasp 5, but I don’t if it could be the problem

!!!

you have a typo!!!

http:**//**192.168.178.69:8123/local/notification.mp3

Nothing to do… I see the request sniffing the traffic on my fritz, but same error. @sdesalve any idea?
Could be useful to analyze the sniffing log of the fritz?

Seems that your config it’s not correct

sip_parameters:
  caller_id_uri: sip:[email protected]:5060
  realm: "*"
  username: user
  password: passUser
pjsua_custom_options: "--ip-addr=192.168.1.10 --no-tcp"
platform_tts: picotts

Also

I don’t know how, but the call is started… The only change I did is to increase the lenght of the username…
The problem now is that the call says wrong thing, It seems an error of the text To speech.
@sdesalve Here the new log:

PJSUA_CUSTOM_OPTIONS = '--ip-addr=192.168.1.10 --no-tcp'
PLATFORM_TTS = 'picotts'
[Info] Listening for messages via stdin service call...
[Info] Received messages {"call_sip_uri":"sip:[email protected]:5060","message_tts":"Ciao Sono Io"}
Converting audio file 'http://192.168.1.10:8123/api/tts_proxy/aebc66490ae73df55e0d940189d10acab54a38d6_it-it_-_picotts.mp3'...
Audio succesfully converted...
Starting SIP Client and calling 'sip:[email protected]:5060'...
This call will be terminated after '50' seconds.
21:59:25.986         os_core_unix.c !pjlib 2.9 for POSIX initialized
21:59:25.986         sip_endpoint.c  .Creating endpoint instance...
21:59:25.987                  pjlib  .select() I/O Queue created (0x55be111c90)
21:59:25.987         sip_endpoint.c  .Module "mod-msg-print" registered
21:59:25.987        sip_transport.c  .Transport manager created.
21:59:25.987           pjsua_core.c  .PJSUA state changed: NULL --> CREATED
21:59:25.996           pjsua_core.c  .pjsua version 2.9 for Linux-6.1.63/aarch64 initialized
21:59:25.996            pjsua_app.c  .Turning sound device -99 -99 ON
21:59:25.996                 main.c  Ready: Success
21:59:25.996            pjsua_app.c  .......Call 0 state changed to CALLING
>>>>
Account list:
  [ 0] <sip:192.168.1.10:5060>: does not register
       Online status: Online
 *[ 1] sip:[email protected]:5060: does not register
       Online status: Online
Buddy list:
 [ 1] <?>  sip:[email protected]:5060

+=============================================================================+
|       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]:5060 [CALLING]
>>> 21:59:26.006        tsx0x55be161aa8  .......Temporary failure in sending Request msg INVITE/cseq=2406 (tdta0x55be158da8), will try next server: Unsupported transport (PJSIP_EUNSUPTRANSPORT)
21:59:26.038            pjsua_app.c  .....Call 0 state changed to EARLY (183 Session Progress)
21:59:37.747            pjsua_app.c  .....Call 0 state changed to CONNECTING
21:59:37.748            pjsua_app.c  .....Call 0 state changed to CONFIRMED
>>> 22:00:15.982            pjsua_app.c  .....Call 0 is DISCONNECTED [reason=200 (Normal call clearing)]
22:00:15.983     pjsua_app_common.c  .....
  [DISCONNCTD] To: sip:[email protected];tag=B8BDA82DABEF8ACE

    Call time: 00h:00m:38s, 1st res in 42 ms, conn in 11752ms
    #0 audio iLBC @8kHz, sendrecv, peer=192.168.1.1:7078
       SRTP status: Not active Crypto-suite: 
       RX pt=104, last update:00h:00m:03.945s ago
          total 963pkt 48.1KB (86.6KB +IP hdr) @avg=10.0Kbps/18.1Kbps
          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   1.858   2.000   1.875   0.175
       TX pt=104, ptime=30, last update:00h:00m:10.852s ago
          total 1.0Kpkt 53.1KB (95.6KB +IP hdr) @avg=11.1Kbps/20.0Kbps
          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     :   8.125   9.725  10.125  10.125   0.800
       RTT msec      :   0.732   0.835   0.885   0.732   0.062
22:00:16.983            pjsua_app.c  ..Turning sound device -99 -99 OFF
[Info] Call ended...

anyway, the configuration seems not stable. 10 tests, 5 failures

>>> 22:43:17.727        tsx0x55a2833aa8  .......Temporary failure in sending Request msg INVITE/cseq=21347 (tdta0x55a282ada8), will try next server: Unsupported transport (PJSIP_EUNSUPTRANSPORT)
22:43:17.756            pjsua_app.c  .....Call 0 state changed to EARLY (183 Session Progress)
>>> 22:44:07.706            pjsua_app.c  .....Call 0 is DISCONNECTED [reason=487 (Request Terminated)]
22:44:07.706     pjsua_app_common.c  .....

and I have to restart the component

Try Google TTS

On NUC it run well.
raspy has less computational power

1 Like

I don’t know if that is the problem. Monitoring the resouces, the CPU never exceeds 5% and RAM is lower than 2Gb of 8 available…