arnonym / ha-plugins

Home-Assistant SIP Gateway
Apache License 2.0
157 stars 19 forks source link

Hi not sure what i'm doing wrong. #24

Closed nielsnl68 closed 1 year ago

nielsnl68 commented 1 year ago

Hello @arnonym,

For some time not i have installed your "add-on" running on a RPi4b 2GB and i have my system setup as you shown on the main page. I added the automation to call my dect phone as well like you have shown. Sadly my phone is not being called,

In the add-on log log i see the following messages:

15:21:41.954           pjsua_core.c  .TX 513 bytes Request msg REGISTER/cseq=25401 (tdta0x2ec29998) to UDP 192.168.178.1:5060:
REGISTER sip:fritz.box SIP/2.0
Via: SIP/2.0/UDP 192.168.178.49:5060;rport;branch=z9hG4bKPj1kx6M2IJGqmSsvCtC07fQv3WrnNSzTOU
Max-Forwards: 70
From: <sip:homeassistant@fritz.box>;tag=aNERO89mIhifqETHj78u.LBrDplL4xyA
To: <sip:homeassistant@fritz.box>
Call-ID: SPEPR-8xLjuWNUJVU48wvEzTxJhzRjV5
CSeq: 25401 REGISTER
Contact: <sip:homeassistant@192.168.178.49:5060;ob>;+sip.ice
Expires: 300
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Content-Length:  0

--end msg--

every 4 seconds and when i try to call i see:

5:25:56.593           pjsua_core.c  .TX 1702 bytes Request msg INVITE/cseq=15482 (tdta0x2ec32978) to UDP 192.168.178.1:5060:
INVITE sip:**611@fritz.box SIP/2.0
Via: SIP/2.0/UDP 192.168.178.49:5060;rport;branch=z9hG4bKPjMuGiUKbBRSiTUz3rkwPvMJYE6UXvoKC1
Max-Forwards: 70
From: sip:homeassistant@fritz.box;tag=8ublClS08Xgzbq6Qd-p7QzTHnFPi-uWW
To: sip:**611@fritz.box
Contact: <sip:homeassistant@192.168.178.49:5060;ob>;+sip.ice
Call-ID: C9rDQGJOwslLEWV88PNbbW3.9Ej1.QHM
CSeq: 15482 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
Content-Type: application/sdp
Content-Length:  1096

v=0
o=- 3880103149 3880103149 IN IP4 192.168.178.49
s=pjmedia
b=AS:84
t=0 0
a=X-nat:0
m=audio 4005 RTP/AVP 96 97 98 99 3 0 8 9 120 121 122
c=IN IP4 192.168.178.49
b=TIAS:64000
a=rtcp:4034 IN IP4 192.168.178.49
a=sendrecv
a=rtpmap:96 speex/16000
a=rtpmap:97 speex/8000
a=rtpmap:98 speex/32000
a=rtpmap:99 iLBC/8000
a=fmtp:99 mode=30
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:9 G722/8000
a=rtpmap:120 telephone-event/16000
a=fmtp:120 0-16
a=rtpmap:121 telephone-event/8000
a=fmtp:121 0-16
a=rtpmap:122 telephone-event/32000
a=fmtp:122 0-16
a=ssrc:625480157 cname:53a1fecf5b3591b7
a=ice-ufrag:2970b647
a=ice-pwd:3fae5d3f5594acb4432232b2
a=candidate:Hc0a8b231 1 UDP 2130706431 192.168.178.49 4005 typ host
a=candidate:Hac11e801 1 UDP 2130706175 172.17.232.1 4005 typ host
a=candidate:Hac1e2001 1 UDP 2130705919 172.30.32.1 4005 typ host
a=candidate:Hc0a8b231 2 UDP 2130706430 192.168.178.49 4034 typ host
a=candidate:Hac11e801 2 UDP 2130706174 172.17.232.1 4034 typ host
a=candidate:Hac1e2001 2 UDP 2130705918 172.30.32.1 4034 typ host
--end msg--

not sure what it all means. so i hope you can help out? thanks

arnonym commented 1 year ago

I cannot see an actual error in the log snippets you posted. From my experience the logging of many messages in a short amount of time could be an authentication problem. So the first thing I would do is to re-check the sip user and password created on the fritz.box.

Other than that you can decrease the log level in the add-on config to 2 or 3 to remove some of the noise and post a complete log again.

nielsnl68 commented 1 year ago

Okay, after checking again i found a small issue, with the authentication idd. Now it works cleanly. Thanks for your time.

PS. between taking up the phone and hearing the message can take a will, do you have an idea to get the message faster or add some static noise before the message is played?

arnonym commented 1 year ago

First thing you can try is to set settle_time: 0 in the sip config. The other thing that takes time is to get the TTS message and convert that to wav format. May I ask what your internet connection bandwith is?