-
I'm using the add on with a SIP door phone and linphone on my phone. Everything works great as long as the phone is on my home wifi network. However, when I leave home I automatically connect to the home network over the cellular network using wireguard client on the phone and the wireguard add-on on Home Assistant. Under this scenario when I dial to the door phone (or vice versa), my voice is heard on the door phone but I don't get the audio or video from the door phone to my mobile phone app. I'm pretty sure this is caused by NAT issues on the RTP stream and there are several layers of NAT involved here:
In Linphone the SIP account is registered with the external address of the host (192.168.x.x) however, when connecting over the VPN I see in the asterisk console that the connection is registered as coming from 172.33.x.x (the external address of the wireguard container). I guess it makes sense because both containers are running on the same host, so the external address of wireguard doesn't get NATed in this case. Now the problem is that the door phone is trying to send the RTP stream to the 172.33.x.x address but it doesn't have any route to it. The other direction, from the mobile phone to the door phone is working fine because there are no NAT issues with the door phone, hence the uni-directional A/V. Any ideas how to solve this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
It took me nearly two full days of going down the deepest network rabbit hole to figure this one out, so I'll share my solution to save other people the time. Asterisk Add-On ConfigurationIn the pjsip_custom.conf file add this section:
In the same file modify the extension template section:
WireGuard Add-On ConfigurationAdd the following to the "Server" section in the add-on config page:
Notes:
Home Assistant ConfigurationAdd the following to your configuration.yaml file then restart Home Assistant:
Then create the following automation in Home Assistant UI:
That's it, you should now be able to have fully functional audio and video even when connecting remotely over WireGuard VPN. |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for sharing! Do you mind if I put your findings in the sip hass docs? |
Beta Was this translation helpful? Give feedback.
It took me nearly two full days of going down the deepest network rabbit hole to figure this one out, so I'll share my solution to save other people the time.
Asterisk Add-On Configuration
In the pjsip_custom.conf file add this section: