SIP client card, as intercom

After I didn’t manage to connect asterisk or via FreePBX to my doorbell, FritzBox and FreePBX and this card, I finally managed to do it with FusionPBX. It is possible to call the Dashboard. But if i want to accept the call i get this error:

Call: newRTCSession: Originator: remote
sipjs-card.ts:691 ICE gathering timeout: 5 seconds
sipjs-card.ts:725 Call: peerconnection(incoming)
2RTCSession.js:542 Uncaught (in promise) INVALID_STATE_ERROR: Invalid status: 5
    at e.answer (http://homeassistant:8123/hacsfiles/sip-hass-card/sipjs-card.js?hacstag=414692790200:2:119595)
    at oe._answer (http://homeassistant:8123/hacsfiles/sip-hass-card/sipjs-card.js?hacstag=414692790200:766:1222)
    at J.handleEvent (http://homeassistant:8123/hacsfiles/sip-hass-card/sipjs-card.js?hacstag=414692790200:2:240163)

And also no video is working with that card.

Here is my config:

type: custom:sipjs-card
server: 192.168.86.93
autoAnswer: false
video: true
ringtone: /local/ringtones/ringtone.mp3
button_size: '67'
custom:
  - name: doorbell
    number: 100
    icon: mdi:doorbell-video
  - name: iphone
    number: 300
    icon: mdi:doorbell-video
dtmfs:
  - name: Door
    signal: 00*
    icon: mdi:door
port: '8089'
extensions:
  - person: person.home
    name: Dashboard
    extension: 200
    secret: 200
    icon: mdi:tablet-dashboard
    entity: person.home
    camera: ''
state_color: true
ringbacktone: /local/ringtones/backtone.mp3
custom_title: ''

Has somebody else have this problem? How can i fix it?

When calling out, it is normal, but when calling in, there is only sound and no video.

yes, we are busy on that issue

multiple users reported already that we are unable to call the card from a sofphone
the other way works… calling from card to softphone
@TECHFox is aware, but we are not able to find the cause yet, since for some users it works for some not … verry strange

Thank you very much.
Sorry, I thought with your original post you meant that you got this card working with 3CX.

Websocket would not work, but connecting via SIP should work. However, it looks like this card can connect via websocket only?

@TECHFox ::: This card is really, really amazing! So first of all thank you!

I did setup this card completely manual, because I’m using HA Core, a dedicated Asterisk instance and my own PKI infrastructure, but the card is that versatile (please keep it that way ;-)).

There’s only one feature I would really like to cover my use-case, which is the support of SIP extensions for “normal” HA users instead of only “persons”.

I’m using three wall mounted IPad’s on each floor that are using “normal” HA accounts (Local Network Login Only). I want to use the SIP card to create a Intercom between those three iPad’s and connect my SIP doorbell (Axis).

Is there any (technical) reason why extensions for “normal” HA users shouldn’t be possible in the future ?

Nice to hear! Hope you like it. :slight_smile:

Is there any (technical) reason why extensions for “normal” HA users shouldn’t be possible in the future ?

I tried to use users first, but it’s not possible to get the users via API. The card and add-on both need to know every person to know which one is used or to create extensions for, so that’s why.

I created a person for my wall mounted tablet, which sounds a bit weird but it’s a technical workaround.

Hope HA will add a API call to get the users, but for now this was the only way I got it working.

Ah, that makes sense… Hoping for the API indeed, make things a little bit cleaner for the iPad use-case. But will use a “person” for now, it isn’t that bad.

BTW, the audio visualization is definitely the icing on the cake…
Keep up the good work!

1 Like

Hi guys,

I’m trying to get started with the SIP card. Right now HACS is saying that certain resources are not loaded up for this card. What is the path to the resources I need to add from the hacsfiles folder?

Also has anyone figured out if this works with the Amcrest AD410 doorbell?

Hi

Is it possible to configure that cars for SIP connection? Not ‘wss’, but legacy SIP on 5060 port? Just like linphone client?

No, that’s sadly not possible inside a browser.

You can redownload it in HACS, and HACS will add it to resources for you.
Path is /www/community/sip-hass-card/sipjs-card.js

Don’t know about your doorbell, but if it’s a normal SIP doorbell, it will work. (But you will need a PBX of course)

Btw, the new docs is online. You can find more info there. Also on adding doorbells.

Thanks that solved my issue with the resources error message. I’ll do some more research on my doorbell

Had a nice weekend playing around with this card and SIP in general ;-). Tweaked my manual setup a bit and pretty happy so far, calling from card-to-card with MacOS/Firefox to iPad/HA-App works flawlessly both audio and (webcam) video. Can’t be more exited :smiley:

Last thing to find out is “getting focus” when receiving a call to the card, my card is on some view in some dashboard that isn’t the primary dashboard. Guess I finally need to do something with the browser-mod stuff, or are there any other tricks to get focus on the SIP card when called ???

Guys i am really confused here…

i have 3 links and and i am not sure which one i need from above.

what is the link that i need to add to HA in order to connect it with my already-installed Asterisk?
and how can i have entities - events?

for example… i want to be able to do something in HA when an incoming call is triggered in Asterisk.
can i do that?

for example someone calls… and my Google Home announces the number or the name of the caller

thanks

You need the Add-On to install Asterisk (managed)
You need the Integration to integrate Asterisk in HA
You need the Card to create a SIP client in your dashboards

If you’re using your own Asterisk server (so not using the Add-On) the best way is to dive into the GitHub source code and understand how the above components are pre-configured. You can find things like the websocket configuration, extensions and dialplan that should be a good example to change your current Asterisk setup.

It seems that the issue with 3cx is they pass some credentials for websockets (Found by monitoring the ws tab in network tab of chrome dev tools)

wss://example.3cx.us/ws/webclient?sessionId={SESSION_ID}&pass={PASS}

I grabbed these from developer tools when logging in. Even if you do have this url the problem is if you put it into the server field it all gets parsed out and the sip card still tries

wss://example.3cx.us/ws

Seems like a simple work around would be to look for values after the domain/ip and if they are present take it as given. @TECHFox ?


Which configuration file should I put the above paragraph into?

PUSH is only for custom extensions for a softphone app.

So in pjsip_custom.conf in the endpoint.

Ah. Guessing because the way the url is constructed.
var socket = new WebSocketInterface("wss://" + this.config.server + ":" + this.config.port + "/ws");
Source

The card also needs a normal address for the SIP URI.

Maybe a option for a custom socket address? And if none is given, create it using the server address and port.

That would be ideal, bound to run into other configurations with custom paths etc. Maybe just a check for the protocol ie

if "://" in this.config.server:
  socket = new WebSocketInterface(this.config.server);
else:
  socket = new WebSocketInterface("wss://" + this.config.server + ":" + this.config.port + "/ws");