-
-
Notifications
You must be signed in to change notification settings - Fork 228
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
Add support for two-way audio for SIP based video doorbell #1355
base: latest
Are you sure you want to change the base?
Conversation
… same port for TX and RX (symmetric RTP)
For example my config was ``` "source": "-i rtsp://192.168.1.3/h264_stream", ``` and the FFmpeg command was executed as ``` ffmpeg.exe -i rtsp://192.168.1.3/h264_stream-hide_banner -protocol_whitelist pipe,udp,rtp,file,crypto... ``` which leads to an error since `rtsp://192.168.1.3/h264_stream-hide_banner` is not the correct stream URL.
Fixes issue with my 2N SIP doorbell not correctly responding to the INVITE if it receives an empty `tag` in the `to:` header. For example ``` to: "SIP doorbell client" <sip:192.168.1.3>;tag ``` would not work correctly whereas ``` to: "SIP doorbell client" <sip:192.168.1.3> ``` works
I installed this PR today. I added the following for the camera config. Camera stream works but no audio nor the talk button at bottom. Going to dig a little more if there are some things I need to set inside the added new code. Not sure if I need to still check the Enable Audio checkbox. I think previously I didn't have.
|
@ryan99alero how did you manage to install this pr? |
Yes you still need the |
@mrMiimo Not sure how much you work with git. One of the other guys pointed out using "npm link" but I'm not sure if you can get to PR's with that or not. With Git you have to first clone the repository, Then fetch the PR by its ID, Then Checkout "IE step into the PR", Grab all the required packages for the build, Run the build command to prepare the package for install. Next I pack it up and then use the NPM command to install the compressed tgz file. You'll need to pay attention to the outputs of the commands and make sure they aren't failing. Below is the basic. This will work for this particular GitHub and particular PR. Go into a direction you want to download the program. Often the home folder via. cd ~ Then download and do all the things I listed above with commands below. Anyone feel free to point out how I'm doing this wrong and provide correct way. The "npm outdated -g --depth=1" command should hopefully come back empty. If not run it again after running the npm update command. If still returning a package it could be because it's a global package. Those you can fix with "npm install -g PackageName@latest". The area named PackageName is the name of the package that gets shown in result/s from npm outdated -g --depth=1 command. The @latest will install latest build of said package. Otherwise you can do @BuildNumber that is returned in the Wanted column. Hope I haven't confused you. git clone https://github.com/Sunoo/homebridge-camera-ffmpeg.git sudo npm install -g homebridge-camera-ffmpeg-3.1.4.tgz |
@longzheng > > I installed this PR today. I added the following for the camera config. Camera stream works but no audio nor the talk button at bottom. Going to dig a little more if there are some things I need to set inside the added new code. Not sure if I need to still check the Enable Audio checkbox. I think previously I didn't have.
SIP not working but I didn't see any attempts via TCPDump. Haven't dug to much yet. I haven't installed yet but I assume I still need to install baresip and alsa loopback? I didn't see them in the nod_modules folder so they don't appear to be packaged with the project or listed in package.json. |
Not infront of my computer but you shouldn't need any more dependencies. I think those are dependency of |
@longzheng In log I get the errors below. I've tested with LinPhone for Peer to Peer and Axis Device works. Going to try between LinPhone and HomeBridge to get some additional logs. Next will be to mirror switch port for Axis and see what additional data I can gather. From my wireshark I see nothing going to or from ports 5060 or 5061. I'd imagine you'd see traffic on those ports on your working environment. Anyway you can post your whole homebridge config xml like I posted above. So I can make sure I'm not doing something wrong. [11/13/2022, 8:21:31 PM] [Camera FFmpeg] [DoorBellSIP] [error] Output file #1 does not contain any stream |
@ryan99alero My config is
|
I would expect to see something listing on port 5060 or 5061 for VOIP ports so when one pushes the button on the doorbell. Thats the port the homebridge has a port listener running. Can you show what your output is from sudo ss -tulpn of linux or windows netstat -an. I'd also be curious if you have a notification action set on your doorbell for when the button is pushed or if it's just set to dial a SIP. I'd imagine it has to be more than just SIP so you'd get a notification event plus get video feed. I originally had it working with your previous work around but it used baresip service that was running and listening for incoming connection to fire things off and kick of the alsa loopback. I did some reading and the kirm/sip.js module doesn't use baresip or alsa loopback. So it'd have to somehow be listening for incoming sip connections. |
Sorry I think there's some confusion with what the functionality of the original PR is. It does not run a SIP server/keep the port 5060/5061 open and wait for the doorbell to dial it, that was not the intention of the original issue either. Instead, it only initiates a SIP call to the device/intercom when you open the camera view so you get two-way audio, so the microphone audio from your iOS device can be sent to the SIP intercom. To trigger the actual doorbell, you need to use the existing |
@longzheng Ok I understand. I was just think multiple steps ahead. Not sure whats going on. It doesn't initiate any kinda outbound SIP call for me currently. Think I will wipe my VM and redo. This time I'm going to take snapshots along path so I can revert. I think I'll first try nanosonde initial fork when I had it working the first time on a different doorbell and if it works take a snapshot and revert back to clean build and try yours again. Only thing I can think of is my npm build while its compiling isn't building right or something. |
That or it's something to do with enabling audio support as thats when it craps out. Maybe something to do with the feed or kind of stream my doorbell sends since it throws an error: "Output file #1 does not contain any stream" Then it closes the stream out. So its likely this is my issue I need to resolve as its not getting to the SIP portion of the integration. |
Which device do you have? |
Currently testing against an Axis Q8105E but i also have an Axis a8207-ve. Currently installed is a DoorBird D101 and it's working via the HomeBridge DoorBird plugin. I could test against the door bird as it supports sip as well. I wish they'd implement webRTC for these things. Would be way easier. |
"sipConfig": {
"to": "sip:192.168.1.3",
"from": "sip:127.0.0.1"
} Mhmm. This looks suspicious. I do not see any user/extension part in the SIP URI. "sipConfig": {
"to": "sip:11@<ip_of_my_doorbell>",
"from": "sip:user1@<ip_of_homebridge_instance>"
} Without the "11" as user it does not work as the doorbell is configured to use this extension when somebody presses the doorbell button. |
"sipConfig": { |
I'm pretty sure for direct SIP the user/extension is not required. I can make a direct call to my Intercom with just |
@longzheng @Sunoo Are there any plans to merge this pull request into the master branch? It would be great to have it included as part of the official plugin, as I’m having a hard time getting it installed on my own. Thank you for your work on this project! |
Sorry I haven't progressed any further with this branch and I won't be able to support it as I've moved from |
I can merge this, I just cannot test it, so I can't say for sure it'll work right. |
Understood. I’m happy to test it with my doorbell setup once merged and report back. In the meantime, I may check out Scrypted’s SIP support as @longzheng suggests. |
If you wanted to, you could install this PR directly without it being merged first
|
@longzheng However, maybe you find my new project useful: https://github.com/nanosonde/sip2rtsp It is docker container that uses baresip, pulseaudio and gstreamer RTSP server to provide a solution that connects to a SIP peer (audio only) and a video camera to present an ONVIF profile T video doorbell with two-way audio support. There is also a block diagram which shows how the components interact. So basically you can use the ONVIF plugin from scrypted and let the above docker container do the rest. |
@Sunoo Hello! Any plans to merge this PR and other in line? Thanks! |
Yearly friendly reminder to merge this PR.... |
This PR incorporates @nanosonde's PR #1253 and includes various fixes I proposed to address some potential bugs with SIP clients like my 2N doorbell.