Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linphone library example sip registration

I would like to develop an application using Linphone library.

I have searched some tutorials and examples but in the example in Github it doesn’t explain how exactly to register to a sip server or maybe I didn’t understood these examples ?

I have found this : http://www.linphone.org/docs/liblinphone-javadoc/

But it doesn’t work for me or maybe I have miss something ?

Where can I find some examples with registration to a sip servers / call manager ?

Thanks in advance

like image 898
Napsters Desmars Avatar asked Nov 27 '15 09:11

Napsters Desmars


1 Answers

For more understanding, I suggest you download the source code of Linphone and check the codes: BelledonneCommunications

You can register in Sip servers with the following code :

 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());
}
like image 157
Arian Ahmadifard Avatar answered Oct 21 '22 18:10

Arian Ahmadifard