Home:ALL Converter>Integrate Liblinphone 4 in android project

Integrate Liblinphone 4 in android project

Ask Time:2018-10-08T08:19:28         Author:Hunter

Json Formatter

I am looking to develop a voice communication application, I set up an asterisk server and I want to integrate a sip client in my android application. After intensive research on the net, I found no documentation to integrate liblinphone 4 in an android project. Does anyone have an idea? Currently I have integrated this code trying to understand a little example in C of an old version of liblinphone: (But i have this error : Linphone: Contact has not been fixed, stack will do, i think that if i can fixed contact, I could make registration)

        Core core = Factory.instance().createCore(null, null, this);
        ProxyConfig proxyConfig = core.createProxyConfig();

        Factory.instance().setDebugMode(true, "Linphone");
        AuthInfo authInfos;
        Address from = Factory.instance().createAddress("sip:112@**.*.*.*");

        proxyConfig.setIdentityAddress(from);
        proxyConfig.setServerAddr(from.getDomain());
        proxyConfig.enableRegister(true);
        proxyConfig.setRealm("**.*.*.*");
        proxyConfig.setContactParameters("**.*.*.*");
        proxyConfig.done();

        Address to = Factory.instance().createAddress("sip:105@*.*.*.*");
        authInfos = Factory.instance().createAuthInfo(from.getUsername(), null, "*****", null, null, null);
        // You must provide the Android app context as createCore last param !
        authInfos.setDomain("**.*.*.*");
        authInfos.setUsername("112");
        authInfos.setPassword("*****");
        authInfos.setUserid("112");

        core.addAuthInfo(authInfos);
        core.setPrimaryContact("sip:112@**.*.*.*");
        core.addProxyConfig(proxyConfig);

        core.start();

        core.inviteAddress(to);
        System.out.println("initialization is ok???");

Author:Hunter,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/52694020/integrate-liblinphone-4-in-android-project
yy