SIP_HOST is not being used
Hello, and thank you for your work on this project.
I noticed that the SIP_HOST parameter seems to be ignored. I tried setting all SIP-related environment variables like this:
EXTERNAL_IP=127.0.0.1
INTERNAL_IP=127.0.0.1
SIP_HOST=127.0.0.1
However, the 100 Trying SIP response was still sent from the network interface address 10.10.0.1, instead of 127.0.0.1.
It looks like SIP_HOST is currently not being used, or it is not applied when building SIP responses.
Expected behavior
When SIP_HOST is set, SIP messages should use this value as the source address.
Actual behavior
SIP responses are sent using the interface IP (in my case 10.10.0.1), even though SIP_HOST is defined.
Could you please check this behavior and make SIP_HOST take effect?
Thank you!
The SIP_HOST environment variable was documented but not actually implemented in the code. The server was hardcoded to bind to 0.0.0.0 (all interfaces), which caused SIP responses to use the interface IP (10.10.0.1) instead of the configured value (127.0.0.1). Changes Made:
- Added Host field to NetworkConfig (pkg/config/config.go:73) - Maps to SIP_HOST environment variable - Default value: "0.0.0.0"
- Updated SIP server binding (cmd/siprec/main.go:887) - Changed from hardcoded "0.0.0.0" to appConfig.Network.Host - Server now respects the configured bind address
- Enhanced logging (cmd/siprec/main.go:1059) - Added sip_host to network configuration log output
- Updated documentation (docs/configuration/ENVIRONMENT.md:8) - Clarified how SIP_HOST affects bind address and SIP headers
- Added test coverage (pkg/config/config_test.go:186) - Verifies default value is correctly applied
that has been fixed
https://github.com/loreste/siprec/commit/e4e8f49888e768e6b38bed41e767d0c3b3885186