简体   繁体   中英

Integrate Liblinphone 4 in android project

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???");

Finally, I followed another track. Doubango, the examples concerning imsdroid. It was necessary to solve problems of dependence but I reassure you that it is better than all the lost time to look for simple bookstores. At the time when I answer my post, I was able to make a call on my server, I will test the other features shortly. But already, the actual joy that I have .... I was starting to be desperate with all the paid bookstores on the market and the lack of liblinphone documentation. Thank you Doubango, if I have enough time, I will write a tutorial on it. Here is the github repository: https://github.com/DoubangoTelecom

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM