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

Pjsua Is intended to be executed as interactive program so I’m not able to get a call status feedback or make audio file start playing when call was picked up.

I can’t find such options in pjsua man’s pages or on internet

Hi

I’m relatively new to Home Assistant.

I’m very interested in your VOIP add-on.

I’ve probably a very stupid question. I don’t find your add-on in the HomeAssistant UI (not in official, not in community add-ons) And not in the integrations.

I can download your files but how can I install your add-on on my Raspberry Pi? . Do I need to copy your folder to a folder on my PI? I can do it with Samba. (I don’t know a lot of Linux)

You can add the “Repositories” here:

Thanks for your answer.
I was able to add the “add-on” of @sdesalve
I’m new, so you learned me something

Hi @hdehaseleer,

that reply is for another user… What do you don’t know?

Great piece of addon. I have it working calling to my linphone sip account , but when I try to call a local number in my freepbx server it fails with:

 pjsua_app.c  .....Call 0 is DISCONNECTED [reason=403 (Forbidden)]

any clues or do you need more info?

please post full logs, check also sip auth info in configuration (eg try to place call with microsip softphone with same account)

my mistake. forgot single quotes on the user and password… rookie here…

but max call time seems to be broken. it calls 50 sec before disconnection: aka:

max_call_time: '11'

logs and configurations!

ok…

sip_parameters:
  caller_id_uri: 'sip:[email protected]:5060'
  realm: '*'
  username: xxxxx
  password: xxxxxx
  max_call_time: '11'
[Info] Received messages {"call_sip_uri": "sip:[email protected]", "message_tts": "Tak for dit tryk. Jeg er på vej til dig."}
Converting audio file 'http://10.0.0.191:8123/api/tts_proxy/359c6b75f667dfbd89e449780443df31b4bb4e3b_da_-_google_translate.mp3'...
Audio succesfully converted...
Starting SIP Client and calling 'sip:[email protected]'...
This call will be terminated after '50' seconds.
23:01:53.387         os_core_unix.c !pjlib 2.9 for POSIX initialized
23:01:53.387         sip_endpoint.c  .Creating endpoint instance...
23:01:53.387                  pjlib  .select() I/O Queue created (0x557a266c2c90)
23:01:53.387         sip_endpoint.c  .Module "mod-msg-print" registered
23:01:53.387        sip_transport.c  .Transport manager created.
23:01:53.387           pjsua_core.c  .PJSUA state changed: NULL --> CREATED
23:01:53.395           pjsua_core.c  .pjsua version 2.9 for Linux-5.4.86/x86_64 initialized
23:01:53.395            pjsua_app.c  .Turning sound device -99 -99 ON
23:01:53.395                 main.c  Ready: Success
23:01:53.396            pjsua_app.c  .......Call 0 state changed to CALLING
>>>>
Account list:
  [ 0] <sip:172.30.33.5:5060>: does not register
       Online status: Online
  [ 1] <sip:172.30.33.5: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]
+=============================================================================+
|       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:01:53.494            pjsua_app.c  .....Call 0 state changed to EARLY (180 Ringing)
23:01:53.852            pjsua_app.c  .....Call 0 state changed to EARLY (180 Ringing)
23:01:55.232            pjsua_app.c  .....Call 0 state changed to CONNECTING
23:01:55.233            pjsua_app.c  .....Call 0 state changed to CONFIRMED
>>> 23:02:43.383            pjsua_app.c  .....Call 0 is DISCONNECTED [reason=200 (Normal call clearing)]
23:02:43.383     pjsua_app_common.c  .....
  [DISCONNCTD] To: sip:[email protected];tag=cf10f916-a2de-43ea-ae8e-08e9ea30cc7e
    Call time: 00h:00m:48s, 1st res in 99 ms, conn in 1838ms
    #0 audio PCMU @8kHz, sendrecv, peer=-
       SRTP status: Not active Crypto-suite: 
       RX pt=0, last update:00h:00m:02.946s 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.7Kpkt 273.2KB (341.6KB +IP hdr) @avg=45.4Kbps/56.7Kbps
          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:02:44.382            pjsua_app.c  ..Turning sound device -99 -99 OFF
[Info] Call ended...
[Info] Listening for messages via stdin service call...

remove 2 spaces in front of line “max_call_time: ‘11’”

it isn’t a child of sip parameters

1 Like

thank you very much. works fine now!

@sdesalve

Sorry for my question. What I did was too stupid to post it again.

Your add-on is working fine now.

I’ll certainly buy you some coffees.

1 Like

Hi

The add-on works fine when I send a 'text to speak tts" message to my mobile.
When I replace the tts message with an audio file, the add-on hangs every time
How did you arrive to play an audio file?

I tried with several MP3 files, in several folders. Using https instead of http. Not sepcifying the :8123 port of my raspberry.(ip=192.168.0.130) Always the same problem.

The Service data
{
“addon”: “89275b70_dss_voip”,
“input”: {
“call_sip_uri”: ‘sip:[email protected]’,
“audio_file_url”: ‘http://192.168.0.130:8123/media/sweep.mp3
}
}

The log file shows “converting” and than the add-on terminates.

[Info] Listening for messages via stdin service call…
[Info] Received messages {“call_sip_uri”: “sip:[email protected]”, “audio_file_url”: “http://192.168.0.130:8123/share/dss_voip/sweep.mp3”}
Converting audio file ‘http://192.168.0.130:8123/share/dss_voip/sweep.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.

Create a www folder in /config folder
Place on it a file.mp3

URL Will Be http://192.168.0.130:8123/local/file.mp3

Or whatever URL you have configurare as host

Please read hassio docs and how to do basics procedures

Thanks

Now I can play also an .mp3 file.

I was somewhat confused because in Node-Red, I could play on my speakers the .mp3 files which were stored in the /config/media folder. By using: {“media_content_type”: “url”, “media_content_id”: “https://192.168.0.130/media/a_file.mp3”}

I also think that a reboot was also necessary (after creating the www folder and copying the .mp3 files) before the add-on no longer terminated.

By the way: Why the (same) audio file needs to be converted each time? Isn’t this a waste of resources? Is there a way to play an audio file that was already properly converted?

My log file:
[Info] Received messages {“call_sip_uri”: “sip:[email protected]”, “audio_file_url”: “http://192.168.0.130:8123/local/test.mp3”}
Converting audio file ‘http://192.168.0.130:8123/local/test.mp3’…
Audio succesfully converted…
Starting SIP Client and calling ‘sip:[email protected]’…

bashio::log.green "Converting audio file '$URLFILEMP3_VALUE'..."
         sox -V3 $SOX_CUSTOM_OPTIONS_INPUT_FILE_VALUE $URLFILEMP3_VALUE $SOX_CUSTOM_OPTIONS_OUTPUT_FILE_VALUE /share/dss_voip/dss_message_tts.wav pad 0.5 1.5 2> /share/dss_voip/dss_sox.log
         if [ $? -eq 0 ]; then
            bashio::log.green "Audio succesfully converted..."

it is a development choice to allow you and other user to use SOX command line options…

Hi.

I get fatal error in log when starting it. Any ideas? I’m a bit green still.
Hope to get it solved, this Addon would help me a lot.

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 Home Assistant

Add-on version: 3.5.3
You are running the latest version of this add-on.
System: Home Assistant OS 5.10 (armv7 / raspberrypi3)
Home Assistant Core: 2021.1.5
Home Assistant Supervisor: 2021.01.7

[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
exec: fatal: unable to exec bashio
: No such file or directory
execlineb: usage: execlineb [ -p | -P | -S nmin | -s nmin ] [ -q | -w | -W ] [ -c commandline ] script args
[services.d] done.
exec: fatal: unable to exec bashio
: No such file or directory
execlineb: usage: execlineb [ -p | -P | -S nmin | -s nmin ] [ -q | -w | -W ] [ -c commandline ] script args
exec: fatal: unable to exec bashio
: No such file or directory
execlineb: usage: execlineb [ -p | -P | -S nmin | -s nmin ] [ -q | -w | -W ] [ -c commandline ] script args

@Lemming got the same issue at the moment. opend an issue on github

hopefully its fixed soon!