Last active
March 3, 2020 13:28
-
-
Save juliancorrea/2593721b861418a035e41374a182aa42 to your computer and use it in GitHub Desktop.
Register and Unregister on SIP - Linphone
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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