Search code examples
androidlinphonesip-server

Linphone reregistering to Sip server using Android


I am creating an Android application which uses Linphone to enable Voip calls.

When the connection is lost, I'm attempting to reconnect to the Sip server like this:

@Override
public void reregister()
{
    handler.post(new Runnable()
    {
        @Override
        public void run()
        {
            linphoneCore.getDefaultProxyConfig().edit();
            linphoneCore.getDefaultProxyConfig().enableRegister(true);
            linphoneCore.getDefaultProxyConfig().done();
        }
    });
}

The problem is that many times when using it, the onRegisterFailed, onRegisterSucceeded and even onRegisterProcessing are not getting called, even though the internet connection is fine.

Is the way I'm trying to reregister correct?


Solution

  • to attempt a reconnection with the same register informations, you can used:

    linphone_core_refresh_registers()

    So in your case in Java:

    linphoneCore.refreshRegisters()