Linphone库示例:SIP注册

6
我想使用Linphone库开发一款应用程序。
我已经搜索了一些教程和示例,但在Github的示例中,并没有解释如何注册到sip服务器,或者可能是我没有理解这些示例?
我找到了这个网址:http://www.linphone.org/docs/liblinphone-javadoc/ 但这对我不起作用,或者我漏掉了什么?
我在哪里可以找到一些关于如何注册到SIP服务器/呼叫管理器的示例?
提前感谢。
1个回答

2

为了更好地理解,我建议您下载Linphone的源代码并检查代码:BelledonneCommunications

您可以使用以下代码在SIP服务器上注册:

 Core core = LinphoneManager.getCore();
    if (core != null) {
        Log.i("[Generic Connection Assistant] Reloading configuration with default");
        reloadDefaultAccountCreatorConfig();
    }

    AccountCreator accountCreator = getAccountCreator();
    accountCreator.setUsername(mUsername.getText().toString());
    accountCreator.setDomain(mDomain.getText().toString());
    accountCreator.setPassword(mPassword.getText().toString());
    accountCreator.setDisplayName(mDisplayName.getText().toString());
    accountCreator.setTransport(TransportType.Udp);//Tls,Tcp,Dtls
    createProxyConfigAndLeaveAssistant(true);

 void reloadDefaultAccountCreatorConfig() {
    Log.i("[Assistant] Reloading configuration with default");
    reloadAccountCreatorConfig(LinphonePreferences.instance().getDefaultDynamicConfigFile());
}

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接