Android SIP - 如何与SIP服务器断开连接

时间:2017-05-18 10:52:57

标签: android sip disconnection

我使用了here解释的代码(https://developer.android.com/guide/topics/connectivity/sip.html) 我的测试SIP服务器是OfficeSIP

连接正常,但是当我尝试断开与此行代码的连接时

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);
     }
}

服务器似乎没有断开帐户(即使它不再可用)。

enter image description here

我做错了什么?

1 个答案:

答案 0 :(得分:0)

只需在关闭之前调用unregister API:

mSipManager.unregister(mSipProfile,mylistener);
相关问题