Home Assistant SIP Gateway

I’ve created my first home assistant plugin. It’s a HA/SIP gateway which allows to call a phone number in an automation and interact with HA through dial tones in a mailbox like system.

I use it to get a call on my home phone if the door bell rings and then can open the door from the phone itself. It’s based on pjsip2 and written in python.

Currently I only tested it with my fritz.box so I don’t know how compatible it is to other SIP providers.

You can find it here: GitHub - arnonym/ha-plugins: Home-Assistant SIP Gateway

Edit: As of now all of this is possible:

  • allows the dialing and hanging up of phone numbers through a SIP end-point
  • triggering of services through dial tones (DTMF) after the call was established.
  • listens for incoming calls and can trigger actions through a web-hook (the call is not picked up)
  • accepting calls (optionally filtered by number)
  • handle PIN input before triggering actions
  • send DTMF digits to an established call (incoming or outgoing)
14 Likes

Hi Arne,
would like to play with it, but can you elaborate what to set up respectively where to put what? Do I need docker?

Hi Joerg,

this is basically an add-on for the OS or Supervised installations methods mentioned in Installation - Home Assistant

With that you can install third party add-ons like described here: Common Tasks - Operating System - Home Assistant

Arne

I see, thanks.
I run Home Assistant Core (Python env)

Great, i think this is the first SIP project in HA…

Is it also actually possible to answer a call, doorbell scenario? I have a hikvison doorbell, I’m playing around with freepbx now , so i don’t need their cloud app anymore

Not at all.

Plenty more.

1 Like

No, that’s not possible. It will call a phone number in an automation and from that call you can call services from home-assistant, e.g. open the door. As I currently do not own a sip phone disguised as a door bell that was not the goal of the project.

But with pjsip you have a rather complete stack, and the docs state that you can call multiple phone numbers and merge/connect audio and video between those calls. So if your doorbell is able to automatically answer phone calls, it might be possible to have a solution without an complex asterisk setup. But I’m just brainstorming, and currently I do not plan to buy a suitable device.

1 Like

thats indeed the issue, my doorbell is not able to pickup calls, it can only dial out
ok, then i need to look for another solution :slight_smile:

I think that would also be possible, as this add-on could also answer phone calls from it’s registered sip endpoint. After that it would need to call another number and merge those calls. Sounds really interesting, but not on my agenda right now.

ok, no problem :slight_smile:

I got an error when I try to install it
The command ‘/bin/bash -o pipefail -c apt-get install -y build-essential git swig python3 python3-dev python3-pip ffmpeg’ returned a non-zero code: 100

Which architecture/device are you installing on? I just fixed an error with aarch64, where I specified a wrong base image.

I’m running a Home Assistant blue - Odroid N2+

Looks like an aarch64 architecture to me. Did you try again?

Hi Arne, thanks for the reply. I try again, the same error.

@volkus I was offline for a few days, but actually no idea what’s going wrong. Sorry!

Anybody else reading that have that problem?

This would be huge. I have a Siedle door bell, which is already connected to fritzbox to make phone calls. I would like to register a sip device that registers incoming calls, answers the calls and sends dial tones to open the door.

I tried to install on a raspi4 with home assistant os. Installer spins forever, but never finishes.

@sevorl Can you please check the supervisor log? There should be an error logged. And the installation takes some time, as pjsip is compiled on the raspi.

Hi! This is great! Can it also act as a softphone within HA? I have a SIP doorbell and I want to be able to detect when the door is ringing (maybe also see some video) and then answer, talk and send DTMF is needed. Can this be done with this plugin?

many thanks!