Android SIP - How disconnect from SIP Server

577 Views Asked by At

I'm using the code explained here (https://developer.android.com/guide/topics/connectivity/sip.html) and my test SIP server is OfficeSIP

The connection is ok, but whe i try to make disconnection with this lines code

public void closeLocalProfile() {
    if (mSipManager == null) {
       return;
    }
    try {
       if (mSipProfile != null) {
          mSipManager.close(mSipProfile.getUriString());
       }
     } catch (Exception ee) {
       Log.d("WalkieTalkieActivity/onDestroy", "Failed to close local profile.", ee);
     }
}

The server seems that doesn't disconnect the account (even if it is no longer reachable).

enter image description here

what am I doing wrong?

1

There are 1 best solutions below

2
On

Just call the unregister API before to close:

mSipManager.unregister(mSipProfile,mylistener);