SIP client card, as intercom

I can’t login there, as I said. If I create an account, I don’t have any numbers in there.

I live in an apartment and our provider gives us numbers (basically number and password) for intercom to receive calls from concierge and outdoor unit using iOS app and unit inside my apartment.

So every apartment has its own number and we can’t add new or change them, because our provider issuing them.

Normally if you have bas devices, you can setup 5 free accounts for each hardware product here: BAS-IP - Member login

You need to scan the QR of your indoor device to create them

Can you change the number on your unit in your apartment? Then you could use that number for Asterisk, and Asterisk dials your unit and HA extensions. Don’t think you can still use the app, but you can use a standard SIP app like Linphone that also gets called by Asterisk.

You can follow this guide to add a custom endpoint to Asterisk. Make sure to copy the pjsip_custom.conf to /config/asterisk/custom

You said that you have credentials for your iphone device , you can also use them for a trunk in asterisk

So yeah, I don’t need the app actually, if I can use the number in HA. The problem is that I can’t find where to put domain in the pjsip_custom.conf

[auth8000]
type=auth
auth_type=userpass
password=mypassword
username=8000

This is the only place I can find to put credentials, but no domain

I see. Like Fabio said, you should use a trunk in that case. Here is a example from my config:

[mytrunk]
type=registration
outbound_auth=mytrunk
server_uri=sip:voip.cheapconnect.net
client_uri=sip:[email protected]
retry_interval=60
 
[mytrunk]
type=auth
auth_type=userpass
password=REDACTED
username=REDACTED
 
[mytrunk]
type=aor
contact=sip:voip.cheapconnect.net:5060
qualify_frequency = 160

[mytrunk]
type=endpoint
direct_media=no
disallow = all
allow = opus,alaw,ulaw,g729
context=from-external
outbound_auth=mytrunk
aors=mytrunk
from_domain=myhapbx
 
[mytrunk]
type=identify
endpoint=mytrunk
match=voip.cheapconnect.net

This should be used in pjsip_custom.conf, not using the code you linked earlier, right? Maybe there’s a guide on how to setup trunk? Because I couldn’t find it

Yes. There isn’t a guide from us on trunks, but you can find them for Asterisk like this one: res_pjsip Configuration Examples - Asterisk Documentation

But in short, set the code I send in your pjsip_custom.conf, change those settings for your intercom, and restart the add-on. There may be some trial & error involved.

Video is a bit harder. Your phone might not support the video codec being used in HA. Best to get it working in Linphone or something else to make sure that all works before getting it to work in HA. It’s quite complicated right now, especially video, but I’m currently trying to streamline it all in the new V2 setup that’s coming soon.

Thanks, I will try. Hopefully it’ll work

Video should work too, bas-ip uses h264 and vp8

Hi all! I’m trying to setup HA to receive the calls from the building’s SIP doorbell.

The doorbell is on a common network 10.2.0.x. I can see its SIP account is not registered. When the button is pressed, it just calls [email protected]. This IP address is NATed by a router to the existing home automation system which I’m trying to replace.

I suppose I should:

  • change the NAT to point to the Asterisk add-on IP
  • setup a dialplan for 101 which will call the extension I want (101 in this case)

This part is clear (at least theorically).

What I don’t get: when I setup the card in a dashboard, is it supposed to register its extension with the Asterisk add-on? In my case I always see the icon in red and I don’t see any registration in the asterisk logs when I display the dashboard. Of course, dialing 101 does not work in Asterisk. What am I missing?

Do you see any errors in the browser console? You may be missing the prefix option. Try adding prefix: '' to the card config.

1 Like

Thanks, it did the trick - the card is now registered!

Now on to the configuration of PJSIP with NAT and no atuhentication and I’ll be done.

Thanks a lot for the code and the help!

2 Likes

Well, it took me a while, but it’s working :slight_smile: Thanks a lot again for publishing this code!

Next objective: display the video from the doorbell before the call is picked up (video preview). I understand this can be done with RTSP and conferencing in the dialplan. Do you have experience with this?

I started messing with this recently and got things working between my Home Assistant users, but have some questions.

I also run go2rtc and frigate. My doorbell does not have SIP support by itself so I don’t think I can follow the normal doorbell guides here because I have no way to tell the doorbell to register and connect. Is it possible to create the extension for it and somehow have the extension connect to the webrtc feed created from go2rtc for two way audio? I have two way audio working directly with go2rtc so that part already works as expected. I know I can set the camera in the sip card, but I’m unclear if that actually ends up bridging my audio from the caller over to the webrtc feed.

Basically what I’m trying to accomplish is to SIP enable all my cameras that don’t support it natively.

Was this added for pi builds? It looks like there is a workaround to fix it.

Answering my own question, it looks like no asterisk-hass-addons/asterisk/Dockerfile at d93fffdf5c8bf5c8b070d97b845e1958d518d8df · TECH7Fox/asterisk-hass-addons · GitHub

It probably won’t take much to add those two #defines to the app_rtsp_sip.c file to the docker build process with a dependency on the arch. The one person who said the fix worked for them was using an rpi4 model B which I believe is an aarch64, so should work for that arch. I’m just not sure about armhf and armv7.

[EDIT] A fix has been put in place for ARM based builds starting 4.2.0 (see post below)

1 Like

Looks like we just had to ask for it: an update of the add-on is available and app_rtsp_sip is included :slight_smile:

Wondering if anyone knows why when I go to where the card is I get a blank page and this is in developer view?

Screenshot 2024-03-11 at 21.19.14

I’m using RasPBX and very much hoping I’ll be able to use this to do this. Sounds like it should be possible!! :slight_smile:

Just RasPBX lacks the certificate management of the fully fledged FreePBX…

I’m unclear if I’d need to run RasPBX as fully HTTPS to use it with this?