-
Notifications
You must be signed in to change notification settings - Fork 72
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
WithClientAddr overwrite WithClientHostname (need to change the from domain) #64
Comments
I found some workaround:
|
@danielchristianschroeter I see your point. Currently those options are also used for routing or enforcing source IP, that should be in Via. Maybe here is probably confusion. WithClientAddr and WithClientHostname should not be used together. Yes you can always add custom any header and it will be skipped during Consider seperation of From and Source IP |
The current implemented logic for getting the correct source IPs and listening interfaces is not working very well on my Windows 11 development environment. It will listen by default on IPv6 interface. Even if I try to disable IPv6. Also this internal IP is not reachable from outside. IPv6 is also not supported by the remote SIP registrar and the external IP is not detected. I‘m now in the situation with IPv4 in a local Ubuntu VM to register and answer a call but no RTP media can be received. I think I will not have these issues when I‘m outside of a NAT but maybe it makes more sense to get a more flexible and consistent configuration for the internal and external IPs / listing interfaces / used ports. |
@danielchristianschroeter thnx for feedback. Can you only be a bit specific. This actually should be quick to fix. For client side I think it needs more work, but this is mostly because initially lib focus was on server. |
@danielchristianschroeter added In more customization needed, passing manually set headers as you here described is needed. Check main branch. |
My preferred external sip registrar Placetel need always in the FROM header @fpbx.de. I can change this by using sipgo.WithClientHostname("fpbx.de")
client, err := sipgo.NewClient(ua, sipgo.WithClientHostname("fpbx.de"), sipgo.WithClientNAT())
But If I need also to change the source IP and Port with WithClientAddr, the WithClientHostname value is no longer used. This means now the client ip is correct but it will decline the request because of the incorrect source domain.
client, err := sipgo.NewClient(ua, sipgo.WithClientAddr("192.168.0.118:5061"), sipgo.WithClientHostname("fpbx.de"), sipgo.WithClientNAT())
Maybe you have some idea how to change both (source ip and from domain)?
The text was updated successfully, but these errors were encountered: