BelledonneCommunications / linphone-sdk

Mirror for linphone-sdk (https://gitlab.linphone.org/BC/public/linphone-sdk.git)
GNU Affero General Public License v3.0
107 stars 81 forks source link

[Bug]: Registration error with iOS device if several transports present #327

Open eskov-ea opened 1 year ago

eskov-ea commented 1 year ago

Context

I use the linphone-sdk in the iOS/android app with flexisip server for my company. I want to do a simple call between two clients. Flexisip is served under our domain, latest version.

General information

Expected behaviour

Client registers on the server via set transport protocol.

To Reproduce

For linphone-sdk I follow the iOS tutorial LoginTutorial. I followed the flexisip instructions for TLS use on the server side: transports=sips: sip: (I also tried specify the ports and domain)

After I try to connect to the sip server from iOS device it is trying to connect to the both addresses it creates infinite loop. If I leave only one option for server transport (TCP/TLS) it works as expected.

There is no such behavier with android linphone-sdk / android device. MicroSIP app also works fine

Additional context

I have confugured flexisip and I decided to use TLS so in my config file I set transports=sips: sip: tls-cartificate-file=path/to/file tls-cartificate-private-key=path/to/key tls-cartificate-ca-file=path/to/ca/file

I also tried to specify ports for TLS/TCP connection, specify domen - result's the same.

The problem is when iOS device is connecting it does it infinite times despite the first connection is successful. In device log I can see it a thousand times per minute. The server log shows it also. The log is drowned with these events.

On client side I use the login function as it described in the docs. iOS linphon-sdk version is latest 5.2.95 (also tried 5.1.73). Transport config part: let transport = TransportType.TLS try address.setTransport(transport)

On Android it works perfectly between TLS and TCP uses correct set transport.

Server logs: Flexisip logs when I try to connect with iOS device:

2023-08-17 16:35:38:234 flexisip-debug-nta: sent 200 Registration successful for REGISTER (27) 2023-08-17 16:35:38:235 flexisip-debug-nta: sent 200 Registration successful for REGISTER (27) 2023-08-17 16:35:38:235 flexisip-debug-nta: sent 200 Registration successful for REGISTER (27) 2023-08-17 16:35:38:235 flexisip-debug-nta: sent 200 Registration successful for REGISTER (27) 2023-08-17 16:35:38:236 flexisip-debug-nta: sent 200 Registration successful for REGISTER (27) 2023-08-17 16:35:38:237 flexisip-debug-nta: sent 200 Registration successful for REGISTER (27) 2023-08-17 16:35:38:238 flexisip-debug-nta: sent 200 Registration successful for REGISTER (27)

Also it refreshes user's contact non-stop: 2023-08-17 16:35:38:233 flexisip-debug-Sending updated content to REDIS for key [user's contact]

Also I can see something like that: 2023-08-17 16:35:38:231 flexisip-debug-Replying Request SIP message: 200 Registration successful 2023-08-17 16:35:38:231 flexisip-debug-tport_tsend(0x558db2ebcb10) tpn = TCP/92.242.62.72:51023 2023-08-17 16:35:38:233 flexisip-debug-tport_tsend(0x558db2ebcb10) tpn = TCP/92.242.62.72:51023 2023-08-17 16:35:38:233 flexisip-debug-tport_vsend returned 763

iOS device logs: 2023-08-18 10:34:00.555419+1000 Runner[25558:23720779] New registration state is Progress .Transport used is Tcp 2023-08-18 10:34:00.556016+1000 Runner[25558:23720779] New registration state is Progress .Transport used is Tcp 2023-08-18 10:34:00.556619+1000 Runner[25558:23720779] New registration state is Progress .Transport used is Tcp 2023-08-18 10:34:00.562445+1000 Runner[25558:23720779] New registration state is Ok .Transport used is Tls 2023-08-18 10:34:00.582138+1000 Runner[25558:23720779] New registration state is Ok .Transport used is Tls 2023-08-18 10:34:00.603200+1000 Runner[25558:23720779] New registration state is Ok .Transport used is Tls 2023-08-18 10:34:00.623296+1000 Runner[25558:23720779] New registration state is Ok .Transport used is Tls 2023-08-18 10:34:00.643309+1000 Runner[25558:23720779] New registration state is Ok .Transport used is Tls 2023-08-18 10:34:00.664349+1000 Runner[25558:23720779] New registration state is Ok .Transport used is Tls 2023-08-18 10:34:00.684236+1000 Runner[25558:23720779] New registration state is Ok .Transport used is Tls 2023-08-18 10:34:00.706017+1000 Runner[25558:23720779] New registration state is Ok .Transport used is Tls 2023-08-18 10:34:00.726357+1000 Runner[25558:23720779] New registration state is Ok .Transport used is Tls 2023-08-18 10:34:01.026964+1000 Runner[25558:23720779] New registration state is Ok .Transport used is Tls 2023-08-18 10:34:01.045425+1000 Runner[25558:23720779] New registration state is Ok .Transport used is Tls 2023-08-18 10:34:01.063490+1000 Runner[25558:23720779] New registration state is Ok .Transport used is Tls 2023-08-18 10:34:01.085674+1000 Runner[25558:23720779] New registration state is Ok .Transport used is Tls 2023-08-18 10:34:01.110384+1000 Runner[25558:23720779] New registration state is Ok .Transport used is Tls 2023-08-18 10:34:01.125632+1000 Runner[25558:23720779] New registration state is Ok .Transport used is Tls 2023-08-18 10:34:01.145866+1000 Runner[25558:23720779] New registration state is Ok .Transport used is Tls 2023-08-18 10:34:01.166436+1000 Runner[25558:23720779] New registration state is Ok .Transport used is Tls 2023-08-18 10:34:01.187033+1000 Runner[25558:23720779] New registration state is Ok .Transport used is Tls 2023-08-18 10:34:01.207607+1000 Runner[25558:23720779] New registration state is Ok .Transport used is Tls 2023-08-18 10:34:01.606102+1000 Runner[25558:23720779] New registration state is Progress .Transport used is Tls 2023-08-18 10:34:01.609537+1000 Runner[25558:23720779] New registration state is Progress .Transport used is Tls 2023-08-18 10:34:01.611915+1000 Runner[25558:23720779] New registration state is Progress .Transport used is Tls 2023-08-18 10:34:01.614429+1000 Runner[25558:23720779] New registration state is Progress .Transport used is Tls 2023-08-18 10:34:01.616443+1000 Runner[25558:23720779] New registration state is Progress .Transport used is Tls 2023-08-18 10:34:01.618222+1000 Runner[25558:23720779] New registration state is Progress .Transport used is Tls 2023-08-18 10:34:01.619976+1000 Runner[25558:23720779] New registration state is Progress .Transport used is Tls 2023-08-18 10:34:01.621436+1000 Runner[25558:23720779] New registration state is Progress .Transport used is Tls 2023-08-18 10:34:01.622662+1000 Runner[25558:23720779] New registration state is Progress .Transport used is Tls 2023-08-18 10:34:01.623881+1000 Runner[25558:23720779] New registration state is Progress .Transport used is Tls 2023-08-18 10:34:01.625102+1000 Runner[25558:23720779] New registration state is Progress .Transport used is Tls 2023-08-18 10:34:01.626362+1000 Runner[25558:23720779] New registration state is Progress .Transport used is Tls 2023-08-18 10:34:01.627458+1000 Runner[25558:23720779] New registration state is Progress .Transport used is Tls 2023-08-18 10:34:01.628649+1000 Runner[25558:23720779] New registration state is Progress .Transport used is Tls 2023-08-18 10:34:01.629870+1000 Runner[25558:23720779] New registration state is Progress .Transport used is Tls 2023-08-18 10:34:01.630815+1000 Runner[25558:23720779] New registration state is Progress .Transport used is Tls 2023-08-18 10:34:01.631740+1000 Runner[25558:23720779] New registration state is Progress .Transport used is Tls 2023-08-18 10:34:01.632660+1000 Runner[25558:23720779] New registration state is Progress .Transport used is Tls 2023-08-18 10:34:01.633544+1000 Runner[25558:23720779] New registration state is Progress .Transport used is Tls 2023-08-18 10:34:01.634440+1000 Runner[25558:23720779] New registration state is Progress .Transport used is Tls 2023-08-18 10:34:01.654706+1000 Runner[25558:23720779] New registration state is Ok .Transport used is Tcp 2023-08-18 10:34:01.655792+1000 Runner[25558:23720779] New registration state is Ok .Transport used is Tcp 2023-08-18 10:34:01.656778+1000 Runner[25558:23720779] New registration state is Ok .Transport used is Tcp 2023-08-18 10:34:01.657749+1000 Runner[25558:23720779] New registration state is Ok .Transport used is Tcp 2023-08-18 10:34:01.658734+1000 Runner[25558:23720779] New registration state is Ok .Transport used is Tcp 2023-08-18 10:34:01.659705+1000 Runner[25558:23720779] New registration state is Ok .Transport used is Tcp 2023-08-18 10:34:01.660674+1000 Runner[25558:23720779] New registration state is Ok .Transport used is Tcp 2023-08-18 10:34:01.661639+1000 Runner[25558:23720779] New registration state is Ok .Transport used is Tcp

SDK logs URL

No response