SIP client card, as intercom

Goodmorning all! @pergola.fabio threw me inside the black hole of Asterisk and SIP card, to get Hikvision intercom 2-way audio working…
So as I am reading the hundreds of posts in the topic, I thought I should thank him and the creator @TECHFox and say hi, before I hit you with questions! :slight_smile:

3 Likes

Eventually I have found the problem. You have to set a person 1st and than give him login rights so a proper user is being created.
Nevertheless, I am still stuck with all definitions as per your instruction yet no dialing takes place.
I have no idea but did not have time yet to look it up or ask for help.
My goal is to hook things up to my Hikvision 8003 intercom to a SIP system. I am not sure if this can take place by using a SIp extension to the main panel or the hole Hikvision must be used with a SIP server.
I will be happy to answers to this issue or link to the discussion around this idea.

Hi, welcome!

There is a Discord server if you need help. Also people with a Hikvision there. HA-SIP

Good luck! :smiley:

Could you post your asterisk and browser logs in the Discord server?

Easiest would probably be to connect it directly to Asterisk.

At the moment the Asterisk odd on refuses to load (it was working and I did not touch it for a while).
I will have to fix this 1st but I am busy in another issue with HA (faulty geo-location and groups behavior). I will fix this and return to the HA-SIP.
Update - I have rebooted and now it works. I have no idea why it behaves like this but it happens from time to time.
I have a huge setup with about 100 KNX device and another 100 IoT devices installed around the house.

Hi all, really amazing project! It will make everything that everyone looks for an intercom as a reality.

I have one question, does it only works with wss: ? Does not work with native sip (udp 5060?) cos this will restrict the sip servers to be used (dahua internal for me).

Thanks :smiley:

Only wss works. Browsers don’t support sip directly. You can however use trunks to connect 2 pbx’s together.

1 Like

Hi everyone

I got and issue adding the custom sip card to the dashboard. it appears and I can put all of the details in but when I saved and closed it. it doesn’t show up in the dashboard


If anyone could help me with this please.

thanks

hello, same problem here, I just installed a fresh version from HACS.

I have the same problem from time to time, usually the fix is to close that browser tab and open HA again in a new tab, OR press Ctrl+F5 to refresh. Also helps to press F12 to bring up the browser console to see the errors.

@TECHFox Thanks for this project, although I’ve been pulling my hair for about a week now and finally I got it to call between 2 browsers/users.

However, may I request that you add the error below into your Trouble Shooting section of the SIP Client Card? Even though its a real rookie mistake but I didn’t think I needed a microphone in order to test the connection/calling, but yeah it was all good once I realized and plugged in a USB Webcam (has microphone). Mama mia!! Hahahaa!

ERROR FROM BROWSER CONSOLE:

Call failed. Originator: local [sipjs-card.ts:805:24](webpack://ha-sip/src/sipjs-card.ts)
getUserMedia() failed: NotFoundError: The object can not be found here.

FIX: => This is because computer/browser has no MICROPHONE!!! :laughing: And thats why getUserMedia() failed, and all you see is the call screen flash really quickly like a split second.

Any idea how to create a SIP trunk between the add-on and a SIP PBX?

The addon is already a PBX , if you really need a sip trunk, just google for pjsip auth trunk, lots of examples

anyway, if you want a trunk based on AUTH, use this example, i use it for registering on my hikvision indoor panel

[mytrunk-auth]
type=auth
auth_type=userpass
password=PASSWORD
username=10000000005
 
[mytrunk-aor]
type=aor
contact=sip:192.168.0.71:5060
;qualify_frequency=300

[mytrunk-registration]
type=registration
outbound_auth=mytrunk-auth
server_uri=sip:192.168.0.71:5060
client_uri=sip:[email protected]:5060
retry_interval=10
contact_user=10000000005
expiration=600
 
[mytrunk]
type=endpoint
context=default
disallow=all
allow=ulaw,alaw
allow=h264
outbound_auth=mytrunk-auth
aors=mytrunk-aor
rewrite_contact=yes
from_domain=asterisk.com
 
[mytrunk]
type=identify
endpoint=mytrunk
match=192.168.0.71

I you just want a trunk based on IP auth, no outgoing username/password, then use this example:

[hikvision]
type=aor
contact=sip:[email protected]:5060

[hikvision]
type=endpoint
context=default
disallow=all
allow=ulaw,alaw
allow=h264,vp8
aors=hikvision
direct_media=no

[hikvision]
type=identify
endpoint=hikvision
match=192.168.0.71

Could be because of a cache issue like @sf901 said, or a error from a invalid config. In that case check the browser console (F12).

Edit: now I see @sf901 also said that. Whoops. :sweat_smile:

Good that you got it working. :+1:

Thought that I added that error to the docs. Might also add it to the readme.

Like @pergola.fabio said. ^

1 Like

Thanks a lot for the help! I guess standard SIP, not PJSIP, is not supported in the add-on, maybe this is my problem.

indeed, chan_sip is deprecated , addon is based on pjsip

Yeah, I’m considering bringing back the option to enable the chan_sip module. But you will need to configure it yourself then.