sdesalve / hassio-addons

MIT License
85 stars 21 forks source link

DISCONNECTED [reason=408 (Request Timeout)] #65

Closed wptracy closed 1 year ago

wptracy commented 1 year ago

I can't get it to work.

I have 10 Euro on the account.

I also disabled the firewall: LAN-to-WAN : Allow all. WAN-to-LAN : Allow all.

MY Configuration with phony usr/pwd for this post:
caller_id_uri: sip:xxx@sip.freevoipdeal.com
realm: "*"
username: xxx
password: yyy
pjsua_custom_options: "--no-tcp"

CALL MADE BY Developer Tools SERVICES:
service: hassio.addon_stdin
data:
  addon: 89275b70_dss_voip
  input: {"call_sip_uri":"sip:+xxx@sip.freevoipdeal.com","message_tts":"Write here your message"}

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: 4.0.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 9.4  (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2023.1.7
 Home Assistant Supervisor: 2022.12.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...
[Info] Listening for messages via stdin service call...
[Info] Received messages {"call_sip_uri":"sip:+xxx@sip.freevoipdeal.com","message_tts":"Write here your message"}
Converting audio file 'http://10.0.0.233:8123/api/tts_proxy/3bb4cd06a7898fc0a33665f241cb48f2f2a192ac_en_-_google_translate.mp3'...
Audio succesfully converted...
Starting SIP Client and calling 'sip:+xxx@sip.freevoipdeal.com'...
This call will be terminated after '50' seconds.
11:22:53.271         os_core_unix.c !pjlib 2.11.1 for POSIX initialized
11:22:53.271         sip_endpoint.c  .Creating endpoint instance...
11:22:53.272                  pjlib  .select() I/O Queue created (0x7fad456100)
11:22:53.272         sip_endpoint.c  .Module "mod-msg-print" registered
11:22:53.272        sip_transport.c  .Transport manager created.
11:22:53.272           pjsua_core.c  .PJSUA state changed: NULL --> CREATED
11:22:53.295           pjsua_core.c  .pjsua version 2.11.1 for Linux-5.15.76/aarch64 initialized
11:22:53.303            pjsua_app.c  .Turning sound device -99 -99 ON
11:22:53.304                 main.c  Ready: Success
11:22:53.306            pjsua_app.c  .......Call 0 state changed to CALLING
>>>>
Account list:
  [ 0] <sip:172.30.33.7:5060>: does not register
       Online status: Online
  [ 1] <sip:172.30.33.7:5060;transport=TCP>: does not register
       Online status: Online
 *[ 2] sip:wptracy@sip.freevoipdeal.com: does not register
       Online status: Online
Buddy list:
 [ 1] <?>  sip:+xxx@sip.freevoipdeal.com
+=============================================================================+
|       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:+xxx@sip.freevoipdeal.com [CALLING]
>>> 11:22:54.303            pjsua_app.c  .Turning sound device -99 -99 OFF
11:23:25.450            pjsua_app.c  ....Call 0 is DISCONNECTED [reason=408 (Request Timeout)]
No current call
>>> 11:23:44.804                timer.c  .Dumping timer heap:
11:23:44.804                timer.c  .  Cur size: 0 entries, max: 3070
[Info] Call ended...
[Info] Listening for messages via stdin service call...
sdesalve commented 1 year ago

[Info] Listening for messages via stdin service call...

please hide your number

have you enabled SIP calls within FreeVoipDeal settings?

image

wptracy commented 1 year ago

Yes, It was already enabled, but I pushed save settings anyway, because I read a previous similar issue where you said check that setting.

Does this app need a stun server setting option?

n: detect NAT type ?

I don't think I'm registered on their sip server.

sdesalve commented 1 year ago

Does this app need a stun server setting option?

Only if you can't hear anything after call was picked up

I don't think I'm registered on their sip server.

You will not be registered with that configuration. And definitely you don't need to be registered to place a call

System: Home Assistant OS 9.4 (aarch64 / raspberrypi4-64)

Damns! Please install ARM version

wptracy commented 1 year ago

I installed Home Assistant OS version arm7l on the Rpi.

https://github.com/home-assistant/operating-system/releases/download/9.4/haos_rpi4-64-9.4.img.xz

I added your repository, but found no App for DSS VoIP Notifier.

  OS Version:               Home Assistant OS 9.4
  Home Assistant Core:      2023.1.7

  Home Assistant URL:       http://homeassistant.local:8123
  Observer URL:             http://homeassistant.local:4357
[core-ssh ~]$ arch
armv7l

SDeSalve add-ons for Hassio
SDeSalve <me@sdesalve.it>
https://github.com/sdesalve/hassio-addons
wptracy commented 1 year ago

why did you close this. I've tried both arm 32 and 64 bit.

I see you have dss_voip and dss_voipARM

Is sdd_voip for 64 bit and dss_voipARM for 32 bit ?

I'm still having trouble getting this working.

sdesalve commented 1 year ago

Arm version is with old Hassio image base. It's same script. For some unknown reason new base image don't place calls in arm.

Where did you add my repository? It's for Supervised Home Assistant and should add it from Hassio GUI...

https://theprivatesmarthome.com/how-to/add-community-add-on-repository-in-home-assistant/#:~:text=Click%20on%20the%20menu%20button,to%20finish%20adding%20the%20repository.

wptracy commented 1 year ago

I get a SIP 404 Unauthorized when I try to make a call from my IP phone to my home land line. I have my freevoipdeal user and password configured.

SIP/2.0 401 Unauthorized Via: SIP/2.0/UDP 98.43.186.186:3073;branch=z9hG4bK-yrp3m4kqjnc2;rport From: "freevoipdeal" sip:xxx@sip.freevoipdeal.com;tag=uqttkatfjc

I did an ARP Spoof on home assistant and captured the SIP messages going from home assistant to the router and back.

Your app is sending out the SIP messages and freevoipdeal is sending 401 unauthorized.

I have the correct user and password configured in both my IP phone and your App.

I'm using the same user and password of my login account at freevoipdeal.

Is it the USA phone number that's unauthorized, or my user password that's unauthorized.

My IP phone is registered with freevoipdeal so I must be using the correct user and password.

I can send you the SIP trace if you like.

I found these settings on their web site, I tried them, It still doesn't work.

  | SIP port : 5060
  | Registrar : sip.freevoipdeal.com
  | Proxy server : sip.freevoipdeal.com
  | Outbound proxy server : leave empty
  | Account name : your FreeVoipDeal username
  | Password : your FreeVoipDeal password
  | Display name/number : your FreeVoipDeal username or voipnumber
  | Stunserver (option) : stun.freevoipdeal.com

I gave up trying to use freevoipdeal. I submitted 4 trouble tickets and they never responded.

I got my money back and went elsewhere.

I found another SIP provider and I'm trying to make the app work there.

The call won't go through. Here is the SIP INVITE message, my App configuration, hassio.addon_stdin, and log file

If I send a call_sip_uri: without a port, I see SIP messages.
service: hassio.addon_stdin
data:
  addon: 89275b70_dss_voip
  input:
    call_sip_uri: sip:13039339035@sip.provider.com
    message_tts: Write here your message

If I send a call_sip_uri: with a port, I don't see SIP messages.
service: hassio.addon_stdin
data:
  addon: 89275b70_dss_voip
  input:
    call_sip_uri: 'sip:13039339035@sip.provider.com:5008'
    message_tts: Write here your message

Here is my configuration file:
caller_id_uri: sip:user@sip.provider.com:5008
realm: "*"
username: "user"
password: 'password'
pjsua_custom_options: "--no-tcp"

The app doesn't send the required port on the URL, but if I put the credentials and sip provider in my IP phone, it does send the port.

dss_voip App's Invite message:

INVITE sip:13039339035@sip.provider.com SIP/2.0
Via: SIP/2.0/UDP 172.30.33.5:5060;rport;branch=z9hG4bKPjIgp4xPwpn4rxNKnkwiv1rVMFbq9z-2EL
Max-Forwards: 70
From: sip:username@sip.provider.com;tag=YaZG4I-UzV0d6B1fKm5-oEDOobVElWOd
To: sip:13039339035@sip.provider.com
Contact: <sip:username@172.30.33.5:5060;ob>
Call-ID: VPE8OhPfU7EVOTiLG8s1aau0S9vm6UHd
CSeq: 15221 INVITE
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Supported: replaces, 100rel, timer, norefersub
Session-Expires: 1800
Min-SE: 90
User-Agent: PJSUA v2.11.1 Linux-5.15.76/aarch64
Content-Type: application/sdp
Content-Length:   626

My SNOM IP phone User-Agent Invite message.

INVITE [sip:3039339035@sip.provider.com:5008;user=phone](mailto:sip:3039339035@sip.provider.com:5008;user=phone) SIP/2.0
Via: SIP/2.0/UDP 98.43.186.186:3073;branch=z9hG4bK-8e128z6h7a0e;rport
From: "HomeAssistant.sip.provider.com" [<sip:6859810135@sip.provider.com:5008>](mailto:sip:6859810135@sip.provider.com:5008);tag=t2hjnib6bj
To: [<sip:3039339035@sip.provider.com:5008;user=phone>](mailto:sip:3039339035@sip.provider.com:5008;user=phone)
Call-ID: 313637343835303434303338373138-9y7dzebfqzq2
CSeq: 1 INVITE
Max-Forwards: 70
User-Agent: snom821/8.7.5.35
Contact: [<sip:6859810135@98.43.186.186:3073;line=1t35fiwd>](mailto:sip:6859810135@98.43.186.186:3073;line=1t35fiwd);reg-id=1
X-Serialnumber: 00041348D068
P-Key-Flags: resolution="31x13", keys="4"
Accept: application/sdp
Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, SUBSCRIBE, PRACK, MESSAGE, INFO, UPDATE
Allow-Events: talk, hold, refer, call-info
Supported: timer, 100rel, replaces, from-change
Session-Expires: 3600
Min-SE: 90
Content-Type: application/sdp
Content-Length: 516

LOG File:
[Info] Listening for messages via stdin service call...
[Info] Received messages {"call_sip_uri":"sip:13039339035@sip.provider.com","message_tts":"Write here your message"}
Converting audio file 'http://10.0.0.233:8123/api/tts_proxy/3bb4cd06a7898fc0a33665f241cb48f2f2a192ac_en_-_google_translate.mp3'...
Audio succesfully converted...
Starting SIP Client and calling 'sip:13039339035@sip.provider.com'...
This call will be terminated after '50' seconds.
14:59:50.905         os_core_unix.c !pjlib 2.11.1 for POSIX initialized
14:59:50.906         sip_endpoint.c  .Creating endpoint instance...
14:59:50.907                  pjlib  .select() I/O Queue created (0x7f9ef4b100)
14:59:50.907         sip_endpoint.c  .Module "mod-msg-print" registered
14:59:50.907        sip_transport.c  .Transport manager created.
14:59:50.907           pjsua_core.c  .PJSUA state changed: NULL --> CREATED
14:59:50.931           pjsua_core.c  .pjsua version 2.11.1 for Linux-5.15.76/aarch64 initialized
14:59:50.940            pjsua_app.c  .Turning sound device -99 -99 ON
14:59:50.940                 main.c  Ready: Success
14:59:50.944            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:6859810135@sip.provider.com:5008: does not register
       Online status: Online
Buddy list:
 [ 1] <?>  sip:13039339035@sip.provider.com
+=============================================================================+
|       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:13039339035@sip.provider.com [CALLING]
>>> 14:59:50.991       tcpc0x7f9e1d0518 !TCP connect() error: [code=120111]: Connection refused
14:59:50.991        tsx0x7f9e1e3c18  Temporary failure in sending Request msg INVITE/cseq=19575 (tdta0x7f9e1dbaa8), will try next server: Connection refused
14:59:50.992            pjsua_app.c  SIP TCP transport is disconnected from 67.231.2.13:5060: Connection refused [status=120111]
14:59:51.049       tcpc0x7f9e1ce528  TCP connect() error: [code=120111]: Connection refused
14:59:51.049        tsx0x7f9e1e3c18  Temporary failure in sending Request msg INVITE/cseq=19575 (tdta0x7f9e1dbaa8), will try next server: Connection refused
14:59:51.049            pjsua_app.c  SIP TCP transport is disconnected from 216.82.238.135:5060: Connection refused [status=120111]
14:59:51.941            pjsua_app.c  .Turning sound device -99 -99 OFF
15:00:23.049            pjsua_app.c  ....Call 0 is DISCONNECTED [reason=408 (Request Timeout)]
No current call
>>> 15:00:42.442                timer.c  .Dumping timer heap:
15:00:42.442                timer.c  .  Cur size: 0 entries, max: 3070
[Info] Call ended...
[Info] Listening for messages via stdin service call...
sdesalve commented 1 year ago

[Info] Starting addon... [Info] Listening for messages via stdin service call... [Info] Received messages {"call_sip_uri":"sip:+xxx@sip.freevoipdeal.com","message_tts":"Write here your message"}

Damns! Here I should have checked that your pjsua_custom_options was not recognized. Sorry

Happy that you've resolved your issues