Closed ktiniatros closed 4 years ago
I ended up to listen for ip changes (via the network monitor broadcast receiver) and when the current ip changes, then I recreate the listening point and the sip provider:
sipManager.removeSipListener()
getListeningPoints().forEach(sipStack::deleteListeningPoint)
getSipProviders().forEach(sipStack::deleteSipProvider)
val sipProfile = SipProfile(host)
val listeningPoint = sipStack.createListeningPoint(sipProfile.getLocalIp(), sipProfile.getLocalPort(), sipProfile.getTransport())
val sipProvider = sipStack.createSipProvider(listeningPoint)
sipManager.updateSipProfile(sipProfile)
sipManager.updateSipProvider(sipProvider)
On Android, when you switch from WiFi to 3g and vice versa, the tcp socket closes (which makes sense since you get a new ip address).
What's the proper way of handling this scenario with jain-sip? Should I restart the sipstack?