Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save juliancorrea/2593721b861418a035e41374a182aa42 to your computer and use it in GitHub Desktop.
Save juliancorrea/2593721b861418a035e41374a182aa42 to your computer and use it in GitHub Desktop.
Register and Unregister on SIP - Linphone
private void sendUnregister() {
try {
Core core = LinphoneManager.getCore();
if (core != null) {
ProxyConfig[] proxyConfigs = core.getProxyConfigList();
for (ProxyConfig config : proxyConfigs) {
if (config != null) {
config.edit();
config.enablePublish(true);
config.setPublishExpires(0);
config.enableRegister(false);
config.done();
while (config.getState() != RegistrationState.Cleared) {
core.iterate();
Thread.sleep(500);
}
}
}
}
} catch (Exception e) {
Toast.makeText(this, e.getLocalizedMessage(), Toast.LENGTH_LONG);
}
}
private void sendRegister() {
Core core = LinphoneManager.getCore();
if (core != null) {
ProxyConfig[] proxyConfigs = core.getProxyConfigList();
for (ProxyConfig config : proxyConfigs) {
if (config != null) {
config.edit();
config.enableRegister(true);
config.done();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment