![]()
That's my code in java android :
(I have no registration failed or success log in my pbx asterisk)
Factory.instance().setDebugMode(true, "Linphone");
Core core = Factory.instance().createCore(null, null, this);
ProxyConfig proxyConfig = core.createProxyConfig();
// Create Authentication object
Address from = Factory.instance().createAddress("sip:112@X.X.X.X");
AuthInfo authInfos;
authInfos = Factory.instance().createAuthInfo(from.getUsername(), null, "xxxx", null, null, null);
core.addAuthInfo(authInfos);
/* authInfos.setDomain("13.232.95.126");
authInfos.setUsername("112");
authInfos.setPassword("secretjd");
authInfos.setUserid("112");*/
proxyConfig.edit();
proxyConfig.setIdentityAddress(from);
System.out.println("Domain from.getDomain "+from.getDomain());
proxyConfig.setServerAddr(from.getDomain());
proxyConfig.enableRegister(true);
proxyConfig.done();
core.addProxyConfig(proxyConfig);
core.setDefaultProxyConfig(proxyConfig);
String[] dnsServer = new String[1];
dnsServer[0]="8.8.8.8";
core.setDnsServers(dnsServer);
// core.setPrimaryContact("sip:address@hidden");
Address to = Factory.instance().createAddress("sip:address@hidden");
core.invite("sip:105@X.X.X.X");
// You must provide the Android app context as createCore last param !
// core.setPrimaryContact("sip:address@hidden");
core.start();
// core.inviteAddress(to);
System.out.println("initialization is ok???");
} catch (Exception theException) {
System.out.println("Exception in call : " + theException.getMessage());
}
|
Sender notified by
Mailtrack
08/10/18 à 02:26:22
|
|