SIP client card, as intercom

Thank you for an amazing project. I have been trying to make it work for some time. I am making some progress. My new problem is I am getting the code: 1006 Websocket error. I am using DNS rewrites and Nginx. When I type in the address into the browser I get the upgrade required, but a certificate error. I thought my certificates are up to date due to Nginx. Should I worry about this message?

Seems like your certificate is indeed 4 days expired.

Also, can you share your card config? Because a wrong certificate should give a 9006 error if i’m correct.

Thank you Jordy for your help. I am not sure where it is looking for the certificate? Because I can see the certificate is current when I go to hassio?
image

Did you restart the add-on? Then it will update the certificate.

No I didn’t restart. I just did, and can see the following in the Log?

Turns out it was probably because I hadn’t enabled microphone access on the iPad. So the SIP session was likely breaking, which then caused some UI issues. So if you have issues on iOS - check you have granted microphone permissions to the HA app.

While I was troubleshooting that I ended up building my own version (thanks to the amazing card from TECHFox). It is just a single button which when pressed dials the SIP intercom (and then if pressed again hangs up). There is an always on RTSP feed of the camera above it, and unlock door/gate buttons next to it.

This way, when someone pushes the doorbell button it pops up an alert on my wall mounted iPad and phones (and plays a chime). Browser mod navigates to the view showign the camera stream.

Then, you can choose to talk to the person (by calling the intercom), unlock the gate, or ignore. And it doesn’t use a popup - just an always-on view.

2 Likes

Thank you for this great project.
Unfortunately I can’t get it to work and I wanted to ask you for help.
I installed the Add-on, the plugin and integrated Asterisk.
Everything seems to work, but when I send a call nothing happens.
Device A calls, device B does nothing.
What am I doing wrong?



Check the Asterisk log (the add-on) and the browser console (F12) for any errors.

Does it work when you use the local IP and accept the certificate manually?

i have the same problem.

Upgrade Required. Asterisk/18.10.1

Another question: the integration instructions say

After a couple seconds, click on devices and you should see the server, and one or more PJSIP devices.

But I have only the Asterisk server in the integration, there are no other persons from the pjsip_default.conf and pjsip_custom.conf files. I’ve reinstalled the integration several times. What could be the problem?

i have the same problem.

Check the Home Assistant logs and the add-on logs. For the integration with the add-on, set username to admin, password to the one you set in the add-on (AMI_password) and the port the default 5038.

That’s working fine, it always says that.

This isn’t a “problem”, the instruction to point your browser to the Asterisk SIP HTTPS server is for importing the certificate into your browser if you’re using non-valid, incomplete and/or self signed certificate. This is because you’re going to use SIP over a (secure) websocket with the SIP-HASS stuff which only works over TLS (as explained in detail some posts above). The upgrade required message is there because you’re sending a regular HTTP GET to this websocket, again, this is only for importing the certificate.

As already asked by TECHFox

Does it work when you use the local IP and accept the certificate manually?

If it does you probably trying to use SIP-HASS in an internal network with an external HA (& Asterisk) endpoint (Could be anything like DUCKDNS or other stuff to publish your HA instance to the Internet). If so you need NAT Reflection configured on your router, which in most cases isn’t supported by ISP modem/routers or low-end consumer models. This should be done for both SIP as RTP traffic.

Another way is using a split-dns setup with both internal (LAN) and external (Internet) DNS zones, so you can resolve your SIP server with local addresses.

did it all. And the integration worked to the server. But there are no persons

reinstalled the integration again and here are the logs

Logger: homeassistant.util.async_
Source: util/async_.py:150
First occurred: 22:14:39 (2 occurrences)
Last logged: 22:16:54

Detected blocking call to sleep inside the event loop. This is causing stability issues. Please report issue to the custom component author for asterisk doing blocking calls at custom_components/asterisk/__init__.py, line 101: sleep(5)

I found my problem. I run Nginx. It saved the SSL certificates under folders. I changed my configuration to below and now the certificates work.
image