-
Notifications
You must be signed in to change notification settings - Fork 573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic SIP server for doorbells #409
Comments
I knows nothing about SIP technologies and didn't have any hardware that using it. |
That's sad, but thank you. I know very little of Golang, but nevertheless I'll try to build something. |
It does not look very difficult according to the examples of https://github.com/emiago/sipgo. However, my doorbell is in a very inaccessible place which makes it very hard for me to work with it. But I will try to build something when I get a chance. |
Can your doorbell works with this integration? |
I don't think so. That does not even look like SIP also. I think that integration only works with the Grandstream conversor for old analog phones. I don't think that integration talks to the conversor over SIP either. Maybe I'm wrong. Off topic, SIP itself could be used as a 2-way audio source provider. In fact, even as a video source. But what I'm suggesting is way simpler than that, which is to make go2rtc to expose a SIP server on port like 5060. Then I would configure my doorbell to use go2rtc as the SIP server. On the go2rtc side, apart from exposing the SIP TCP server on port 5060, it would:
I currently use the Asterisk add-on https://github.com/TECH7Fox/asterisk-hass-addons with the SIP card to be able to call with my doorbell from Home Assistant https://github.com/TECH7Fox/sip-hass-card. Cc @pergolafabio @nanosonde which are the most experienced people I know about SIP. (Sorry to ping you both, if you don't care about this please unsubscribe) Any opinion is appreciated. I don't know if the approach I suggest actually makes sense or is feasible. Maybe I'm just crazy. |
Oh wait! The VoIP integration for Home Assistant seems to be SIP indeed. I'll do some testing with it. |
Yes, the voip is indeed a sip, but be careful, it only works with opus codec, and remember to change port to something else then 5060 if you have asterisk running... But anyway, I don't see the point for calling to HA to speak to assist anyway :-) |
But I can easily read code of voip integration and reproduce it with go2rtc. I saw how they accept connection on 5060 port and answer to it. You right. They using OPUS/48000/2. I can change it to PCM/16000/1 |
As realized in rroller/dahua#359 (comment), the Dahua VTO is useless when NOT CONNECTED to a SIP server. Even the most basic function of button press event will not work when it's not connected to a SIP server. I detailed my VTO setup on Home Assistant (https://github.com/felipecrs/dahua-vto-on-home-assistant) and I use go2rtc for 2-way audio communication, but I still need to run the full Asterisk add-on just to have a SIP server for my VTO to connect to and therefore allow me to capture the button press event to run automations on. After these realizations, just to reiterate, if go2rtc could expose a simple SIP server for the doorbell to connect to, I could get rid of Asterisk in my setup which would make things a lot easier. |
By the way, I tried making it work with that integration and I could not. No matter what, the doorbell would not connect to it. I don't have much details though. |
I will try making some tests with: |
OMG! I can't believe, it worked in the first attempt! ~\repos\sipgo\example\register main ❯ go run ./server -u "8001:somepass" -ip 0.0.0.0:5060
May 30 11:53:33.797517 INF Listening on addr=0.0.0.0:5060
May 30 11:53:42.670412 INF New client registered source=192.168.1.40:5060 username=8001
May 30 11:57:34.866194 WRN Server > SIP request handler not found
May 30 11:57:34.888231 WRN Server > SIP request handler not found
May 30 11:57:34.976455 WRN Server > SIP request handler not found 192.168.1.40 is my VTO. It registered in gosip immediatelly with no issue. And everything worked as expected. The button press event is emitted and I don't need SIP for anything else. @AlexxIT, it would be awesome if you could bundle this in go2rtc. What do you think? |
I'll try when have time for my two doorbells |
hi, I join in here. I have a Loxone smarthome and use Hikvision DS-K1T342MFWX Door Stations. Using go2rtc I was able to grab the video of the door stations and transcode them to the mjpeg stream loxone needs. I wrote a small udp listener (container with python script parsing the udp sip frame) waiting for the sip call of the door station and trigger the doorbell/loxone app with it. this works fine. Unfortunately the Door Station is not listening for SIP-Invites - the only possibility to talk to visitors is using ISAPI/Two-Way-Audio. On the other hand, the only possibility for Loxone to connect to Door Stations is doing an outbound SIP-Call. So if I read this issue right go2rtc might be able to be the missing glue. Would it somehow be possible to connect to a go2rtc SIP-Listener which connects audio to the two-way audio stream? If someone is interested in the python script I can clean it up a bit and share it. |
im' interested i also use the two way audio for my hikvisvion device |
Ty, will have a look after |
That will only work probably without indoor station? Don't think you can call callcenter and indoor center at same time |
if you have an indoor station it should be easier afaik - as you can use it to set up sip. - and maybe configure the indoor station to forward the call to the udp listener for the mqtt processing. I don't have an indoor station and would prefer to just use a tablet with Loxone App (or home assistant app if Loxone doesn't work out). |
Yeah, but I want to avoid SIP, I have an sip script to use a script to register as extension, so I can forward the call from indoor... |
i see.. as the outdoor station can always only call one ip this is hard. possible solutions - proxy from helper to indoor station or mirror and inspect traffic to indoor station - both solutions not really viable. your current solution seems much better. |
This project never stops surprising me. It is like the always missing glue for cameras and smart homes. And I have another suggestion.
An embedded and very basic SIP server that doorbells like Dahua VTO or Hikvision can connect to.
go2rtc has 2-way audio support for doorbells, which is awesome. But that's not enough for a fully functional doorbell setup. In other words, a SIP server is still required even though go2rtc can do 2-way audio.
That's because the doorbell still needs to signal and receive signals to react on certain events like:
In my understanding, if go2rtc could expose a basic SIP server in which the doorbell could connect to, no other project like the Asterisk add-on would be required (Asterisk is VERY hard to manage, and overkill for the purpose).
go2rtc as a SIP server would:
Luckily, there seems to be some good SIP servers written in golang out there:
So, what do you think?
Refs #49
The text was updated successfully, but these errors were encountered: