Home Assistant SIP Gateway

Hello,

First of all, I have to say that I’m a complete beginner with Home Assistant (HA). I’ve only worked with ioBroker so far and now I want to learn HA, but unfortunately, quite a few things are completely different.

My first project is:

My doorbell uses SIP and currently rings a Grandstream VoIP phone as the indoor device.

I want to change this so that HA-SIP is called, and the camera image appears on a tablet, allowing me to open the door (via DTMF) with a button.

It would be fantastic if I could also communicate with the doorbell from the tablet using the microphone and speaker.

What I already have is that HA-SIP is registered in my Fritz!Box and can be called with an internal number. That works fine.

However, I’m stuck now, which is also due to my lack of knowledge about HA.

I would like to create an automation that, when HA-SIP receives an incoming call, a different dashboard is opened via Fully Kiosk. Calling the URL isn’t a problem, but I need to set a trigger under Automation, and HA-SIP isn’t in my trigger selection list.

How and where do I do that?

Do I need to write the “incoming call” action as a script under Scripts, referencing a unique ID from a webhook?
And can I then use this webhook ID as a trigger?

Or how do I handle the incoming call?
The call doesn’t need to be answered for the URL request.

To open the door, I would then create a button in the dashboard that, when clicked, makes an outgoing call and sends the DTMF code to open the door.

I don’t think communication between the tablet and the doorbell is possible, if I’m interpreting the issue correctly: Is It Possible to Use Microphone and Speaker for Real-Time Voice Calls via SIP?

Perhaps someone can help me, and please bear in mind that I’m not yet 100% sure where to put each YAML script.

Thank you in advance.

For anyone trying to use sipgate.de this is a working configuration for the service including Home Assistant Cloud TTS:

ha-sip

sip_global:
  port: 5060
  log_level: 5
  name_server: ""
  cache_dir: ""
  global_options: "--udp enabled --tcp disabled --tls disabled"
sip:
  enabled: true
  registrar_uri: sip:sipgate.de
  id_uri: sip:[email protected]
  realm: sipgate.de
  user_name: "XXXXXXXeX"
  password: XXX
  answer_mode: listen
  settle_time: 1
  incoming_call_file: ""
  options: >-
    --ice disabled --use-stun-for-sip disabled --use-stun-for-media disabled
    --use-sip-outbound enabled
tts:
  engine_id: tts.home_assistant_cloud
  platform: ""
  language: de-DE
  voice: ""
  debug_print: false
webhook:
  id: sip_call_webhook_id

and automation:

alias: ha-sip Sipgate
mode: single
trigger: []

action:
  - service: hassio.addon_stdin
    data:
      addon: c7744bff_ha-sip
      input:
        command: dial
        number: "sip:[email protected]"
        ring_timeout: 30
        sip_account: 1
        menu:
          message: "Test"
          post_action: hangup
1 Like

Thank you, this is great. I tried it a few months back and it always stayed quiet on the line. Did you try to receive a call and react to it?

EDIT: I tried it with your options: >-
–ice disabled --use-stun-for-sip disabled --use-stun-for-media disabled
–use-sip-outbound enabled

And receiving calls works!

EDIT2: Actually the magic switch for me is only this:

global_options: “–tcp off”

All other options are empty/default. That way I can receive and place calls just fine.

does anyone have experience adding a standard SIP connection

i have an external provider and also an internal extenssion on my asterisk server
both are provisioned via sip server address / username / password

i dont need anything special
just to login

I assumed it would have been the same as loging in on an ATA but it does not seem to be the case

Try using global_options: “–tcp off” setting.

the above settings combined with other examples did help
the startup was getting further in the logs
however it was still not starting
it was erroring on address already in use
but it was actually the port
if you have the HA VOIP Integration its already operating on 5060
I changed to 5061 and it fired up

Im trying to connect this add-on to use with my freepbx system installed locally.
I keep on getting error

The requested URL could not be retrieved

Can someone guide me what to put into config.

global:

port: 5060
    log_level: 5 
    name_server: 
    cache_dir: 

sip:
    enabled: true
    registrar_uri: sip:192.168.5.50
    id_uri: sip:[email protected]
    realm: '*'
    user_name: 10
    password: secure
    answer_mode: listen
    settle_time: 1 
    incoming_call_file: ""
   options: ''

@Wolf-dotcom

if you are using the HA voip integration
you will have the same issue i did
and 5060 is already in use
try just using 5061

seems strange that the log does not indicate that as the issue, but it is