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

Hi don’t call me. i have this report
Starting SIP Client and calling ‘sip:+39************@voip.eutelia.it’…
This call will be terminated after ‘11’ seconds.
11:35:49.317 os_core_unix.c !pjlib 2.11.1 for POSIX initialized
11:35:49.317 sip_endpoint.c .Creating endpoint instance…
11:35:49.318 pjlib .select() I/O Queue created (0x7f88f5c100)
11:35:49.318 sip_endpoint.c .Module “mod-msg-print” registered
11:35:49.318 sip_transport.c .Transport manager created.
11:35:49.318 pjsua_core.c .PJSUA state changed: NULL → CREATED
11:35:49.348 pjsua_core.c .pjsua version 2.11.1 for Linux-6.1.21/aarch64 initialized
11:35:49.356 pjsua_app.c .Turning sound device -99 -99 ON
11:35:49.356 main.c Ready: Success
11:35:49.359 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:0*********@voip.eutelia.it: does not register
Online status: Online
Buddy list:
[ 1] <?> sip:+39***********@voip.eutelia.it
+=============================================================================+
| 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:+39**********@voip.eutelia.it [CALLING]

11:35:50.356 pjsua_app.c .Turning sound device -99 -99 OFF
11:36:00.297 pjsua_app.c .Call 0 is DISCONNECTED [reason=487 (Request Terminated)]
11:36:01.851 timer.c .Dumping timer heap:
11:36:01.851 timer.c . Cur size: 0 entries, max: 3070
[Info] Call ended…
[Info] Listening for messages via stdin service call…

Screenshot (fai la foto… No copia ed incolla) of your addon config (redactec without any password, of course)
Copy and paste FULL addon logs, from addon start to call end

Hello! This add-on looks great, but I haven’t managed to reach any remote lphone number. Using Movistar (Telefónica Spain) here. I have dealt with SIP clients in the past, so I think that config and proxy setup are fine. Actually, I have a SIP ATA client in my place (a Grandstream HT802 device) which works fine with a similar config. But who knows…

I have spent some time figuring out how to make calls with no errors. I have reached the point where it seems that the phone number is actually “dialed”. However, after some time, logs return either a reason=403 (Forbidden) error (with --no-tcp) or a reason=408 (Request Timeout) error (without --no-tcp). I cannot find any way to move forward from here. Any help, please?

Pasting below config, service call and logs:

ADD-ON CONFIG

sip_parameters:
  caller_id_uri: sip:949******@telefonica.net
  realm: "*"
  username: "949******"
  password: "949******"
  sip_server_uri: sip:telefonica.net:5060
pjsua_custom_options: "--proxy=sip:10.31.255.134:5070;lr --no-tcp"

SERVICE CALL

service: hassio.addon_stdin
data:
  addon: 89275b70_dss_voip
data_template:
  input: {"call_sip_uri":"sip:686******@telefonica.net","message_tts":"Esto es una prueba"}

LOGS
WITHOUT --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 Home Assistant
-----------------------------------------------------------
 Add-on version: 4.0.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 10.3  (amd64 / generic-x86-64)
 Home Assistant Core: 2023.7.2
 Home Assistant Supervisor: 2023.07.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 = '--proxy=sip:10.31.255.134:5070;lr'
[Info] Registering as SIP Client...
PJSUA_CUSTOM_OPTIONS = '--proxy=sip:10.31.255.134:5070;lr'
-----------------------------------------------------------
                  SIP Client registered.

 Call <sip:949******@telefonica.net>/VoIP phone number
 to check system status.
 You'll find logs in /share/dss_voip/dss_autoanswer.log
-----------------------------------------------------------
[Info] Listening for messages via stdin service call...
[Info] Received messages {"call_sip_uri":"sip:686******@telefonica.net","message_tts":"Esto es una prueba"}
Converting audio file 'http://192.168.0.100:8123/api/tts_proxy/a609295021744033e92fd3fb5c758fc7f19ed697_es_-_google_translate.mp3'...
Audio succesfully converted...
Starting SIP Client and calling 'sip:686******@telefonica.net'...
This call will be terminated after '50' seconds.
10:25:38.008         os_core_unix.c !pjlib 2.11.1 for POSIX initialized
10:25:38.008         sip_endpoint.c  .Creating endpoint instance...
10:25:38.009                  pjlib  .select() I/O Queue created (0x7f4320116100)
10:25:38.009         sip_endpoint.c  .Module "mod-msg-print" registered
10:25:38.009        sip_transport.c  .Transport manager created.
10:25:38.009           pjsua_core.c  .PJSUA state changed: NULL --> CREATED
10:25:38.024           pjsua_core.c  .pjsua version 2.11.1 for Linux-6.1.34/x86_64 initialized
10:25:38.028            pjsua_app.c  .Turning sound device -99 -99 ON
10:25:38.029                 main.c  Ready: Success
10:25:38.030            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:172.30.33.10:5060;transport=TCP>: does not register
       Online status: Online
 *[ 2] sip:949******@telefonica.net: does not register
       Online status: Online
Buddy list:
 [ 1] <?>  sip:686******@telefonica.net
+=============================================================================+
|       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:686******@telefonica.net [CALLING]
>>> 10:25:39.028            pjsua_app.c  .Turning sound device -99 -99 OFF
10:26:10.030            pjsua_app.c  ....Call 0 is DISCONNECTED [reason=408 (Request Timeout)]
No current call
>>> 10:26:29.542                timer.c  .Dumping timer heap:
10:26:29.542                timer.c  .  Cur size: 0 entries, max: 3070
[Info] Call ended...
[Info] Listening for messages via stdin service call...

WITH–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 Home Assistant
-----------------------------------------------------------
 Add-on version: 4.0.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 10.3  (amd64 / generic-x86-64)
 Home Assistant Core: 2023.7.2
 Home Assistant Supervisor: 2023.07.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 = '--proxy=sip:10.31.255.134:5070;lr --no-tcp'
[Info] Registering as SIP Client...
PJSUA_CUSTOM_OPTIONS = '--proxy=sip:10.31.255.134:5070;lr --no-tcp'
-----------------------------------------------------------
                  SIP Client registered.

 Call <sip:949******@telefonica.net>/VoIP phone number
 to check system status.
 You'll find logs in /share/dss_voip/dss_autoanswer.log
-----------------------------------------------------------
[Info] Listening for messages via stdin service call...
[Info] Received messages {"call_sip_uri":"sip:686******@telefonica.net","message_tts":"Esto es una prueba"}
Converting audio file 'http://192.168.0.100:8123/api/tts_proxy/a609295021744033e92fd3fb5c758fc7f19ed697_es_-_google_translate.mp3'...
Audio succesfully converted...
Starting SIP Client and calling 'sip:686******@telefonica.net'...
This call will be terminated after '50' seconds.
10:38:31.270         os_core_unix.c !pjlib 2.11.1 for POSIX initialized
10:38:31.270         sip_endpoint.c  .Creating endpoint instance...
10:38:31.270                  pjlib  .select() I/O Queue created (0x7f004f48e100)
10:38:31.270         sip_endpoint.c  .Module "mod-msg-print" registered
10:38:31.271        sip_transport.c  .Transport manager created.
10:38:31.271           pjsua_core.c  .PJSUA state changed: NULL --> CREATED
10:38:31.285           pjsua_core.c  .pjsua version 2.11.1 for Linux-6.1.34/x86_64 initialized
10:38:31.290            pjsua_app.c  .Turning sound device -99 -99 ON
10:38:31.290                 main.c  Ready: Success
10:38:31.291            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:949******@telefonica.net: does not register
       Online status: Online
Buddy list:
 [ 1] <?>  sip:686******@telefonica.net
+=============================================================================+
|       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:686******@telefonica.net [CALLING]
>>> 10:38:31.308            pjsua_app.c  .....Call 0 is DISCONNECTED [reason=403 (Forbidden)]
10:38:32.289            pjsua_app.c  .Turning sound device -99 -99 OFF
No current call
>>> 10:39:22.801                timer.c  .Dumping timer heap:
10:39:22.801                timer.c  .  Cur size: 0 entries, max: 3070
[Info] Call ended...
[Info] Listening for messages via stdin service call...

I have managed to make calls with the following pjsua_custom_options:

--outbound=sip:10.31.255.134:5070;lr --no-tcp --registrar=sip:telefonica.net

I can hear the message with no issues. When it works… this is really cool!

However, for some reason, sometimes I get the “forbidden” response. Pasting below the addon logs after making an unsuccessful call and the logs after a successful one. I did not restarted the addon between both calls nor changed any option. For whatever reason, it works randomly:

UNSUCCESSFUL

[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: 4.0.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 10.3  (amd64 / generic-x86-64)
 Home Assistant Core: 2023.7.3
 Home Assistant Supervisor: 2023.07.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 = '--outbound=sip:10.31.255.134:5070;lr --no-tcp --registrar=sip:telefonica.net'
MAX_CALL_TIME = '25'
[Info] Listening for messages via stdin service call...
[Info] Received messages {"call_sip_uri":"sip:686******@telefonica.net","message_tts":"La alarma de Balimelón se ha disparado."}
Converting audio file 'http://[LAN_IP]:8123/api/tts_proxy/74c43dc98c4d15449961a96a996f757f4062754a_es_-_google_translate.mp3'...
Audio succesfully converted...
Starting SIP Client and calling 'sip:686******@telefonica.net'...
This call will be terminated after '25' seconds.
19:40:19.727         os_core_unix.c !pjlib 2.11.1 for POSIX initialized
19:40:19.728         sip_endpoint.c  .Creating endpoint instance...
19:40:19.728                  pjlib  .select() I/O Queue created (0x7f31dba73100)
19:40:19.728         sip_endpoint.c  .Module "mod-msg-print" registered
19:40:19.728        sip_transport.c  .Transport manager created.
19:40:19.728           pjsua_core.c  .PJSUA state changed: NULL --> CREATED
19:40:19.746           pjsua_core.c  .pjsua version 2.11.1 for Linux-6.1.34/x86_64 initialized
19:40:19.750            pjsua_app.c  .Turning sound device -99 -99 ON
19:40:19.751                 main.c  Ready: Success
19:40:19.751            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:949******@telefonica.net: 100/In Progress (expires=0)
       Online status: Online
Buddy list:
 [ 1] <?>  sip:686******@telefonica.net
+=============================================================================+
|       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:686******@telefonica.net [CALLING]
>>> 19:40:19.769            pjsua_app.c  .....Call 0 is DISCONNECTED [reason=403 (Forbidden)]
19:40:19.879            pjsua_acc.c  ....IP address change detected for account 1 (172.30.33.10:5060 --> 10.29.1.241:5060). Updating registration (using method 2)
19:40:20.092            pjsua_acc.c  ....sip:949******@telefonica.net: registration success, status=200 (OK), will re-register in 600 seconds
19:40:20.751            pjsua_app.c  .Turning sound device -99 -99 OFF
No current call
>>> 19:40:45.376            pjsua_acc.c  .....sip:949******@telefonica.net: unregistration success
19:40:46.251                timer.c  .Dumping timer heap:
19:40:46.251                timer.c  .  Cur size: 0 entries, max: 3070
[Info] Call ended...
[Info] Listening for messages via stdin service call...

SUCCESSFUL

[Info] Received messages {"call_sip_uri":"sip:686******@telefonica.net","message_tts":"La alarma de Balimelón se ha disparado."}
Converting audio file 'http://[LAN_IP]:8123/api/tts_proxy/74c43dc98c4d15449961a96a996f757f4062754a_es_-_google_translate.mp3'...
Audio succesfully converted...
Starting SIP Client and calling 'sip:686******@telefonica.net'...
This call will be terminated after '25' seconds.
19:42:12.911         os_core_unix.c !pjlib 2.11.1 for POSIX initialized
19:42:12.912         sip_endpoint.c  .Creating endpoint instance...
19:42:12.912                  pjlib  .select() I/O Queue created (0x7f05f719a100)
19:42:12.912         sip_endpoint.c  .Module "mod-msg-print" registered
19:42:12.912        sip_transport.c  .Transport manager created.
19:42:12.912           pjsua_core.c  .PJSUA state changed: NULL --> CREATED
19:42:12.928           pjsua_core.c  .pjsua version 2.11.1 for Linux-6.1.34/x86_64 initialized
19:42:12.933            pjsua_app.c  .Turning sound device -99 -99 ON
19:42:12.933                 main.c  Ready: Success
19:42:12.934            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:949******@telefonica.net: 100/In Progress (expires=0)
       Online status: Online
Buddy list:
 [ 1] <?>  sip:686******@telefonica.net
+=============================================================================+
|       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:686******@telefonica.net [CALLING]
>>> 19:42:12.945            pjsua_acc.c  ....IP address change detected for account 1 (172.30.33.10:5060 --> 10.29.1.241:5060). Updating registration (using method 2)
19:42:13.185            pjsua_acc.c  ....sip:949******@telefonica.net: registration success, status=200 (OK), will re-register in 600 seconds
19:42:13.792            pjsua_app.c  .....Call 0 state changed to EARLY (183 Session Progress)
19:42:13.933            pjsua_app.c  .Turning sound device -99 -99 OFF
19:42:14.085            pjsua_app.c  ........Turning sound device -99 -99 ON
19:42:14.085            pjsua_app.c  .....Call 0 state changed to EARLY (180 Ringing)
19:42:17.961            pjsua_app.c  .....Call 0 state changed to CONNECTING
19:42:17.968            pjsua_app.c  .....Call 0 state changed to CONFIRMED
19:42:20.094     pjsua_app_common.c  ........
  [DISCONNCTD] To: sip:686******@telefonica.net;tag=720238084-1690134133779

    Call time: 00h:00m:02s, 1st res in 859 ms, conn in 5035ms
    #0 audio PCMA @8kHz, sendrecv, peer=10.31.255.135:18894
       SRTP status: Not active Crypto-suite: 
       RX pt=8, last update:00h:00m:00.000s ago
          total 103pkt 16.4KB (20.6KB +IP hdr) @avg=61.8Kbps/77.2Kbps
          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.090   0.125   0.125   0.056
       TX pt=8, ptime=20, last update:never
          total 107pkt 17.1KB (21.4KB +IP hdr) @avg=64.2Kbps/80.2Kbps
          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
19:42:20.094            pjsua_app.c  ......Call 0 is DISCONNECTED [reason=200 (Normal call clearing)]
19:42:21.093            pjsua_app.c  .Turning sound device -99 -99 OFF
No current call
>>> 19:42:38.597            pjsua_acc.c  .....sip:949******@telefonica.net: unregistration success
19:42:39.596                timer.c  .Dumping timer heap:
19:42:39.596                timer.c  .  Cur size: 0 entries, max: 3070
[Info] Call ended...
[Info] Listening for messages via stdin service call...

Has anyone experienced such behaviour? Any clue on how to fix this so the calls always work?

is your account shared across multiple devices with same login/password? do you have some kind of firewall?

you can remove sip_server_uri: sip:telefonica.net:5060 if you don’t need to test calling your number and ear a dummy mp3 that confirm you that Hassio has registered

First of all, thanks for your feedback!

As mentioned in one of my posts, I have a SIP ATA device with the same account, although I disabled it for the purpose of testing the addon. Such device can receive and make calls with no issues at all. My fibre provider allows to share the account with different devices as long as they are connecting from the LAN where the fibre is installed. Actually, login/password strings are the line phone number.

As for the firewall question, I don’t have any filter to outbound connections. If there were any problem, the SIP ATA device would not work either. I have even tried to redirect 5060 incoming UDP port to the HASS LAN IP, although I believe it is not necessary as long as receiving calls is not necessary. Does it make sense?

I already removed it before the tests I did when I posted my latest message. :slight_smile:

Not sure how to move forward… :frowning:

I just realized that if I call the service twice in a row for placing a call, the second service call always work. In addition to the --registrar=URL option, is there any other PJSUA option that could be necessary for pre-registering or something that could help to override the 403 error?

This was not needed…

Try to use

–reg-timeout=SECONDS

Search pjSua man with Google for docs

For whatever reason, it seems it is needed for my provider. If I remove --registrar=sip:telefonica.net' option, calls never work. If I keep it, calls work every two times at least.

This option seems to make no difference.

Yup. I am testing with all the options listed here. Will see whether I can make this behaviour more stable and reliable.

Try to add port

I am afraid tt doesn’t make a difference. Behaviour is the same: one unsuccessful call and a successful one just afterwards:

[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: 4.0.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 10.3  (amd64 / generic-x86-64)
 Home Assistant Core: 2023.7.3
 Home Assistant Supervisor: 2023.07.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 = '--outbound=sip:10.31.255.134:5070;lr --no-tcp --registrar=sip:telefonica.net:5060'
MAX_CALL_TIME = '20'
[Info] Listening for messages via stdin service call...
[Info] Received messages {"call_sip_uri":"sip:686******@telefonica.net","message_tts":"La alarma se ha disparado."}
Converting audio file 'http://[LAN_IP]:8123/api/tts_proxy/74c43dc98c4d15449961a96a996f757f4062754a_es_-_google_translate.mp3'...
Audio succesfully converted...
Starting SIP Client and calling 'sip:686******@telefonica.net'...
This call will be terminated after '20' seconds.
12:28:43.652         os_core_unix.c !pjlib 2.11.1 for POSIX initialized
12:28:43.652         sip_endpoint.c  .Creating endpoint instance...
12:28:43.652                  pjlib  .select() I/O Queue created (0x7fc24ba64100)
12:28:43.653         sip_endpoint.c  .Module "mod-msg-print" registered
12:28:43.653        sip_transport.c  .Transport manager created.
12:28:43.653           pjsua_core.c  .PJSUA state changed: NULL --> CREATED
12:28:43.671           pjsua_core.c  .pjsua version 2.11.1 for Linux-6.1.34/x86_64 initialized
12:28:43.676            pjsua_app.c  .Turning sound device -99 -99 ON
12:28:43.676                 main.c  Ready: Success
12:28:43.677      tsx0x7fc24b8f46b8  ....Temporary failure in sending Request msg INVITE/cseq=25214 (tdta0x7fc24b8ede88), will try next server: Unsupported transport (PJSIP_EUNSUPTRANSPORT)
12:28:43.677            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:949******@telefonica.net: 100/In Progress (expires=0)
       Online status: Online
Buddy list:
 [ 1] <?>  sip:686******@telefonica.net
+=============================================================================+
|       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:686******@telefonica.net [CALLING]
>>> 12:28:43.691            pjsua_app.c  .....Call 0 is DISCONNECTED [reason=403 (Forbidden)]
12:28:43.774            pjsua_acc.c  ....IP address change detected for account 1 (172.30.33.10:5060 --> 10.29.1.241:5060). Updating registration (using method 2)
12:28:43.859            pjsua_acc.c  ....sip:949******@telefonica.net: registration success, status=200 (OK), will re-register in 600 seconds
12:28:44.676            pjsua_app.c  .Turning sound device -99 -99 OFF
No current call
>>> 12:29:04.348            pjsua_acc.c  .....sip:949******@telefonica.net: unregistration success
12:29:05.176                timer.c  .Dumping timer heap:
12:29:05.176                timer.c  .  Cur size: 0 entries, max: 3070
[Info] Call ended...
[Info] Listening for messages via stdin service call...
[Info] Received messages {"call_sip_uri":"sip:686******@telefonica.net","message_tts":"La alarma se ha disparado."}
Converting audio file 'http://[LAN_IP]:8123/api/tts_proxy/74c43dc98c4d15449961a96a996f757f4062754a_es_-_google_translate.mp3'...
Audio succesfully converted...
Starting SIP Client and calling 'sip:686******@telefonica.net'...
This call will be terminated after '20' seconds.
12:29:05.943         os_core_unix.c !pjlib 2.11.1 for POSIX initialized
12:29:05.943         sip_endpoint.c  .Creating endpoint instance...
12:29:05.944                  pjlib  .select() I/O Queue created (0x7f0dc27db100)
12:29:05.944         sip_endpoint.c  .Module "mod-msg-print" registered
12:29:05.944        sip_transport.c  .Transport manager created.
12:29:05.944           pjsua_core.c  .PJSUA state changed: NULL --> CREATED
12:29:05.961           pjsua_core.c  .pjsua version 2.11.1 for Linux-6.1.34/x86_64 initialized
12:29:05.965            pjsua_app.c  .Turning sound device -99 -99 ON
12:29:05.966                 main.c  Ready: Success
12:29:05.966            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:949******@telefonica.net: 100/In Progress (expires=0)
       Online status: Online
Buddy list:
 [ 1] <?>  sip:686******@telefonica.net
+=============================================================================+
|       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:686******@telefonica.net [CALLING]
Current call id=0 to sip:686******@telefonica.net [CALLING]
>>> 12:29:05.977            pjsua_acc.c  ....IP address change detected for account 1 (172.30.33.10:5060 --> 10.29.1.241:5060). Updating registration (using method 2)
12:29:06.220            pjsua_acc.c  ....sip:949******@telefonica.net: registration success, status=200 (OK), will re-register in 600 seconds
12:29:06.949            pjsua_app.c  .....Call 0 state changed to EARLY (183 Session Progress)
12:29:06.966            pjsua_app.c  .Turning sound device -99 -99 OFF
12:29:07.119            pjsua_app.c  ........Turning sound device -99 -99 ON
12:29:07.120            pjsua_app.c  .....Call 0 state changed to EARLY (180 Ringing)
12:29:10.323            pjsua_app.c  .....Call 0 is DISCONNECTED [reason=486 (Busy here)]
12:29:11.322            pjsua_app.c  .Turning sound device -99 -99 OFF
No current call
>>> 12:29:26.627            pjsua_acc.c  .....sip:949******@telefonica.net: unregistration success
12:29:27.465                timer.c  .Dumping timer heap:
12:29:27.465                timer.c  .  Cur size: 0 entries, max: 3070
[Info] Call ended...
[Info] Listening for messages via stdin service call...

Port also here

Means that TCP is not supported…

It’s strange, could you try another sip provider?

Attendee was busy

TCP is disabled with the --no-tcp option. I am not sure why this error is given, but it is true that it is displayed when the call is unsuccessful only.

As for the busy response, sorry for that. It happened because I rejected the call. In the latest tests, I just wait for the phone to ring and then I cancel it.

Just in case it helps for the purpose of assisting me with the issue, I am pasting below the ATA SIP device SIP dialog I have in my place upon making a call. When I enable it, all outbound calls work with no issues:

HT802 --- 2023-07-24 15:30:39.357 RECEIVING FROM 10.31.255.134:5070
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.*.*:5060;received=10.29.1.241;branch=z9hG4bK311551958;rport=1031
From: "949******" <sip:949******@telefonica.net>;tag=310507098
To: <sip:949******@telefonica.net>;tag=6d74da93015c0806013b9ecf1f97
Call-ID: [email protected]
CSeq: 2000 REGISTER
Content-Length: 0
Contact: <sip:949******@192.168.*.*:5060>;expires=70
Contact: <sip:949******@10.29.3.206:5060;transport=udp>;expires=2248
Contact: <sip:949******@192.168.119.9:5060;ob;endpoint=172.30.33.10:5060;firewall=10.29.1.241;transport=udp>;expires=3410
Service-Route: <sip:949******@10.31.255.134:5070;transport=udp;lr>
P-Associated-URI: <sip:949******@telefonica.net>
P-Associated-URI: <tel:+34949******>
P-Associated-URI: <sip:[email protected]>

HT802 --- 2023-07-24 15:30:59.550 SENDING TO 10.31.255.134:5070
INVITE sip:686******@telefonica.net SIP/2.0
Via: SIP/2.0/UDP 192.168.*.*:5060;branch=z9hG4bK197915359;rport
Route: <sip:10.31.255.134:5070;lr>
From: "949******" <sip:949******@telefonica.net>;tag=965463443
To: <sip:686******@telefonica.net>
Call-ID: [email protected]
CSeq: 10 INVITE
Contact: "949******" <sip:949******@192.168.*.*:5060>
Max-Forwards: 70
User-Agent: Grandstream HT802 1.0.45.2
Privacy: none
P-Preferred-Identity: "949******" <sip:949******@telefonica.net>
P-Access-Network-Info: IEEE-EUI-48;eui-48-addr=08-62-66-**-**-**
P-Emergency-Info: IEEE-EUI-48;eui-48-addr=00-0B-82-**-**-**
Supported: replaces, path, timer, eventlist
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE
Content-Type: application/sdp
Accept: application/sdp, application/dtmf-relay
Content-Length:   479

v=0
o=949****** 8000 8000 IN IP4 192.168.*.*
s=SIP Call
c=IN IP4 192.168.*.*
t=0 0
m=audio 5004 RTP/AVP 0 8 4 18 2 97 123 9 101
a=sendrecv
a=rtpmap:0 PCMU/8000
a=ptime:20
a=rtpmap:8 PCMA/8000
a=rtpmap:4 G723/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:2 G726-32/8000
a=rtpmap:97 iLBC/8000
a=fmtp:97 mode=20
a=rtpmap:123 opus/48000/2
a=fmtp:123 maxplaybackrate=16000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16,32-36,54

Full add-on logs
Screenshot of service call
Do you have enough credit to place call? Can you place a call with another sip phone? Do you call your mobile phone number or the same number of your CloudItaliaOrchestra account?

Hi,

I am try this addon as I want to use to make a sip call when alarmo is triggered. I am from Spain and I use Telefonica as SIP provider.

Checking the logs looks like the registration is succesfull but my phone never rings.

@Luisico or @sesardelaisla could you please share your finnaly configurations for sip server and script? I am not sure what I am doing wrong. I really appreciate.

I also share my configs:

caller_id_uri: sip:[email protected]:5060
realm: "*"
username: "986xxxxxx"
password: "986xxxxxx"
pjsua_custom_options: "--proxy=sip:10.31.255.134:5070;lr --no-tcp"
alias: Llamada SIP
sequence:
  - service: hassio.addon_stdin
    data_template:
      addon: 89275b70_dss_voip
      input:
        call_sip_uri: "sip:[email protected]:5060"
        message_tts: "Esto es una prueba de llamada SIP"

Can you also confirm if you need add any etc/host entry for ‘telefonica.net’?

Thanks

Hi there fellow Movistar client!

I managed to do calls, but this addon always gave an error with the first call attempt as you can see in one of my earlier posts above. Calls had to be dialed twice in order to be sure that call was going to be received, something that made me not to trust very much on whether the call was going to be really done or not. Due to this, I switched to Asterisk + Movistar PJSIP config (instead of the standard SIP) and everything works like a charm now.

I want to highlight that I am not blaming DSS VoIP addon. Perhaps, Movistar requires some non-standard thing which makes the addon not to work well with it. Pity that this addon doesn’t work well because it is easier to manage than Asterisk, which is more powerful but harder to learn, and I just needed to do a call upon alarm triggering. Actually, it would be great if some other Movistar clients ask for assistance on this. In such case, perhaps the developers will think that it is worth it to have a closer look to this specific telco specs, although I think PJSUA (the engine that this addon uses) have some limitations which I am not sure they are possible to go through.

Having said that, if you wish, this is the latest config I had (the one that made a second call in a row possible). Perhaps you want to try to move forward from there and you solve this problem! :slight_smile:

However, if you’d rather to try Asterisk, just have a look to this post I shared in the Movistar Community forum. You’ll find there a working config you can start with.

No need to do this (as far as I remember, I checked both options and I think it doesn’t make a difference). I also have an ATA SIP device in my place and it works with SIP without tweaking hosts files. However, do take into account that I have some IP routes in my main router because I have a neutral one, not the Movistar HGU, so maybe my scenary is not the same than yours.

1 Like

try to use pbxes.com. it’s more easy to configurate

1 Like