如何通知SIP服务器注销?

时间:2018-07-20 07:38:36

标签: android amazon-ec2 sip linphone linphone-sdk

我正在使用linphone在 AWS 服务器上注册。在使用SIP注册时,我将获得用于新注册的日志,但是当我未注册的凭据时,将不会获得未注册的日志。

注销代码:

        String identify = "sip:" + name + "@" + host;
        String proxy = "sip:" + host;
        LinphoneAddress proxyAddr = LinphoneCoreFactory.instance().createLinphoneAddress(proxy);
        LinphoneAddress identifyAddr = LinphoneCoreFactory.instance().createLinphoneAddress(identify);
        LinphoneAuthInfo authInfo = LinphoneCoreFactory.instance().createAuthInfo(name, null, password,
                null, null, host);
        LinphoneProxyConfig prxCfg = mLinphoneCore.createProxyConfig(identifyAddr.asString(),
                proxyAddr.asStringUriOnly(), proxyAddr.asStringUriOnly(), true);

        if(prxCfg != null){

            getLc().removeProxyConfig(prxCfg);

            if (getLc().getProxyConfigList().length != 0) {
//                resetDefaultProxyConfig();
            } else {
                getLc().setDefaultProxyConfig(null);
            }

            if (authInfo != null) {
                getLc().removeAuthInfo(authInfo);
            }

            getLc().refreshRegisters();
    }

0 个答案:

没有答案
相关问题