The whole function is in attachemt. I didn't change anything else which might be connected with this problem. I also changed the wengo account creation window, screenshot in attachement.
P.S. All settings are hardcoded, to make customer's life easier. I also hardcoded my jabber ID (except password), so feel free to change it. Darshaka Pathirana napsal(a): > On 07.08.2008 16:30, Jan Kaláb wrote: >> I made a little progress! Jabber account is finally added to >> profile, but it crashes QuteCom. I use this code in >> QtAddWengoAccount.cpp: >> >> UserProfile userProfile; >> userProfile.setSipAccount(sipAccount, false); >> userProfile.addIMAccount(jabberAccount); >> UserProfileFileStorage userProfileStorage(userProfile); >> userProfileStorage.save(sipAccount.getFullIdentity()); >> _cUserProfileHandler.setCurrentUserProfile(sipAccount.getFullIdentity(), >> sipAccount); >> >> It executes all this code, so sip and jabber accounts are created >> and current sip account is used. But after about 3 seconds, it >> crashes. But if you are fast enough, you can see the sip connected >> and jabber trying to connect in profile bar above contact list. If >> you start qutecom again, everything is fine, jabber and sip connects >> and jabber roster is loaded. Just as it should be. >> >> I tried commenting out the last line setCurrentUserProfile() to avod >> the crash and play with it a little. These are the results: >> >> 1. remove ~/.qutecom, start qutecom, create account >> 2. Select Log on from menu and choose just created account >> 3. Crash! >> 4. Start qutecom again, everything is ok >> >> 1. remove ~/.qutecom, start qutecom, create account >> 2. Close qutecom manually >> 3. Start qutecom again >> 4. Select Log on from menu and choose just created account >> 5. Everything is ok >> >> I don't understand this behaviour... any idea what might cause the >> crash? (And how to avoid it or fix it?) > > We also have the same problem here! I don't think anybody can help > with modified QuteCom-code. So the first step is to reproduce the > problem in (native) QuteCom. Can you reproduce the problem? > > Here we can reproduce the problem but instead of crashing the client > is just not able to connect. We also have to restart qutecom again > and everything is ok then... > > We're tracing the problem but any help would be highly welcome! > > Greetings, > - Darsha > > _______________________________________________ > QuteCom-dev mailing list > [email protected] > http://lists.qutecom.org/mailman/listinfo/qutecom-dev
<<inline: Obrazovka-VoIPEX - spojení.png>>
void QtAddWengoAccount::loginClicked() {
/* Get and check login */
std::string login = _ui->email->text().toStdString();
if (login.length() < 9) {
QMessageBox::warning(this, tr("@product@ - Connexion"), tr("Invalid login number."), QMessageBox::Ok, QMessageBox::NoButton);
return;
}
/* Get and check passwords */
std::string voipexPassword = _ui->password->text().toStdString();
std::string jabberPassword = _ui->jabberPassword->text().toStdString();
if (voipexPassword.empty() || jabberPassword.empty()) {
QMessageBox::warning(this, tr("@product@ - Connexion"), tr("Password is required."), QMessageBox::Ok, QMessageBox::NoButton);
return;
}
/* Get JID */
std::string JID = _ui->jabber->text().toStdString();
/* Debug output */
/*
std::clog << "VoIPEX login: " << login << std::endl;
std::clog << "VoIPEX heslo: " << voipexPassword << std::endl;
std::clog << "Jabber login: " << JID << std::endl;
std::clog << "Jabber heslo: " << jabberPassword << std::endl;
*/
/* Set hidden SIP & Jabber parameters */
Config & config = ConfigManager::getInstance().getCurrentConfig();
std::string accountname = "VoIPEX";
std::string realm = "sip.ipex.cz";
std::string displayname = login;
std::string registerServer = realm;
int registerPort = config.getSipRegisterPort();
std::string proxyServer = realm;
int proxyPort = 5060;
bool rememberSIPPassword = true;
bool SIP_SIMPLE = false;
std::string resource = "voipex";
/* Create SIP account */
SipAccount sipAccount(login, login, voipexPassword, realm, registerServer, registerPort, proxyServer, proxyPort, rememberSIPPassword, SIP_SIMPLE);
sipAccount.setDisplayName(displayname);
sipAccount.setVisibleName(accountname);
/* Configure Jabber */
IMAccount jabberAccount = IMAccount(EnumIMProtocol::IMProtocolJabber);
std::string jabberAccountParametersData = UserProfileFileStorage::loadSystemIMAccountParametersData();
IMAccountParametersXMLSerializer serializer(jabberAccount.getIMAccountParameters());
serializer.unserializeSystemSettings(jabberAccountParametersData);
JID += '/' + resource;
//jabberAccount.setLogin(JID);
jabberAccount.setLogin("[EMAIL PROTECTED]/voipex");
jabberAccount.setPassword(jabberPassword);
static const std::string connectserver = "jabber.cz";
IMAccountParameters & params = jabberAccount.getIMAccountParameters();
params.set(IMAccountParameters::JABBER_USE_TLS_KEY, true);
params.set(IMAccountParameters::JABBER_REQUIRE_TLS_KEY, true);
params.set(IMAccountParameters::JABBER_USE_OLD_SSL_KEY, false);
params.set(IMAccountParameters::JABBER_AUTH_PLAIN_IN_CLEAR_KEY, false);
params.set(IMAccountParameters::JABBER_CONNECTION_SERVER_KEY, connectserver);
params.set(IMAccountParameters::JABBER_PORT_KEY, 5222);
/* Save to profile */
UserProfile userProfile;
userProfile.setSipAccount(sipAccount, false /* needInitialization */);
userProfile.addIMAccount(jabberAccount);
UserProfileFileStorage userProfileStorage(userProfile);
userProfileStorage.save(sipAccount.getFullIdentity());
_cUserProfileHandler.setCurrentUserProfile(sipAccount.getFullIdentity(), sipAccount);
/* Close */
_loginDialog->accept();
}
signature.asc
Description: OpenPGP digital signature
_______________________________________________ QuteCom-dev mailing list [email protected] http://lists.qutecom.org/mailman/listinfo/qutecom-dev
