|
From: | Eli Burke |
Subject: | Re: [Linphone-developers] Implemented Logout but app crashed on calling with other user name |
Date: | Fri, 1 Aug 2014 11:19:57 -0400 |
If you are switching between user accounts, there is a much less destructive way to log in and out. The Linphone core keeps linked lists of proxy information and auth information. Search linphonecore.h for linphone_core_create_proxy_config and linphone_core_create_auth_info for the full API. To log in to an account, create and add auth info and proxy config, and it will automatically start registration: linphone_core_add_auth_info(lc, _authInfo); linphone_core_add_proxy_config(lc, _proxyCfg); When you want to log out, simply remove the proxy config and the auth info: linphone_core_remove_proxy_config(lc, _proxyCfg); linphone_core_remove_auth_info(lc, _authInfo); (as you can see, I have my accounts encapsulated in an Objective C class and do not use the LinphoneCoreSettingsStore) Pro-tip: Linphone supports multiple simultaneous registrations. When making an outgoing call linphone_core_set_default_proxy determines which registration is used. You may experience issues if you use linphone to persist your accounts; the linphonerc setting "store_auth_info=0" turns off the one, and a small patch to coreapi/proxy.c linphone_proxy_config_write_to_config_file() to add a corresponding “store_proxy_info” flag will take care of the problem. Or you could call linphone_core_clear_proxy_config and linphone_core_clear_all_auth_info when you launch your app each time. -Eli On Aug 1, 2014, at 4:04 AM, address@hidden wrote: Date: Fri, 01 Aug 2014 15:26:58 +0800 |
signature.asc
Description: Message signed with OpenPGP using GPGMail
[Prev in Thread] | Current Thread | [Next in Thread] |