BelledonneCommunications / linphone-android

Linphone.org mirror for linphone-android (https://gitlab.linphone.org/BC/public/linphone-android)
https://linphone.org
GNU General Public License v3.0
1.13k stars 691 forks source link

How to setup a relay/proxy to linphone server? #2029

Closed basncy closed 11 months ago

basncy commented 1 year ago

The purpose is to build stable network connectivity with a third relay between linphone client and official linphone SIP server.

My network is very poor to sip.linphone.org official server, about 50% packets lost. and I have a server that acts as relay/proxy/middle server to provide excellent network connectivity between linphone client and official server. How could I set up that server to relay the SIP signal(INVITE/MESSAGE) to the linphone official server?

I tried port forwarding but failed, it asks me to re-enter the password due to credit failure when sending a new message.

my relay server side: method 1, with iptables: ip6tables -t nat -A PREROUTING -p tcp --dport 5221 -j DNAT --to '[2001:41d0:700:1080::bb]:5228' method 2, with nginx stream: stream { server { listen [::]:5221 ipv6only=off; proxy_pass sip.linphone.org:5228; } } client side: (credit error happens when sending message)

  1. On linphone client side, set outbound server to myrelay.domain.com:5221, and enable outbound proxy
  2. register success.
  3. linphone client can recieve message but failed to send.
  4. There is a TCP connection from sip.linphone.org to myrelay.domain.com:5221.(why this TCP connection exist?)
  5. If I reset the outbound server to sip.linphone.org, everything goes well.
basncy commented 11 months ago

As this issue is affected by the external network environment and push mechinism unchangeable on the iOS platform in a short time, close this issue. I mean the push-wakeup-connect-register mechinism and bad international network connectivity together result in the sip INVITE timeout.