void AccountSettingsModel::setUsername(const QString& username) { if (!_authInfo || !_proxyConfig) { return; } LinphoneAuthInfo *ai = linphone_auth_info_clone(_authInfo); linphone_auth_info_set_username(ai, username.toUtf8().constData()); linphone_core_remove_auth_info(LinphoneManager::getInstance()->getLc(), _authInfo); linphone_core_add_auth_info(LinphoneManager::getInstance()->getLc(), ai); _authInfo = ai; const char *identity = linphone_proxy_config_get_identity(_proxyConfig); LinphoneAddress *addr = linphone_core_create_address(LinphoneManager::getInstance()->getLc(), identity); linphone_address_set_username(addr, username.toUtf8().constData()); linphone_proxy_config_edit(_proxyConfig); linphone_proxy_config_set_identity_address(_proxyConfig, addr); linphone_proxy_config_done(_proxyConfig); linphone_address_destroy(addr); }
void AuthInfoAPI::setUsername(StringPtr const &username) { CORE_MUTEX FBLOG_DEBUG("AuthInfoAPI::setUsername", "this=" << this << "\t" << "username=" << username); linphone_auth_info_set_username(mAuthInfo, STRING_TO_CHARPTR(username)); }