From a66bfcbf2e8b8df2c1010c12df7854eeb2f09a35 Mon Sep 17 00:00:00 2001 From: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> Date: Fri, 20 Mar 2009 17:05:45 -0400 Subject: [PATCH] Fix ticket #964 --- po/fr.po | 2 +- sflphone-gtk/src/configwindow.c | 2 +- src/managerimpl.cpp | 2 +- src/sipaccount.cpp | 16 ++++++++-------- src/sipvoiplink.cpp | 16 ++++++---------- src/user_cfg.h | 2 +- 6 files changed, 18 insertions(+), 22 deletions(-) diff --git a/po/fr.po b/po/fr.po index 95c7c9f0c8..0d95e0cefa 100644 --- a/po/fr.po +++ b/po/fr.po @@ -45,7 +45,7 @@ msgstr "Réseau non trouvé" #: ../sflphone-gtk/src/accountlist.c:176 msgid "Host unreachable" -msgstr "_Serveur introuvable" +msgstr "Serveur introuvable" #: ../sflphone-gtk/src/accountlist.c:179 msgid "Stun configuration error" diff --git a/sflphone-gtk/src/configwindow.c b/sflphone-gtk/src/configwindow.c index 81063f99aa..73c6d86eb0 100644 --- a/sflphone-gtk/src/configwindow.c +++ b/sflphone-gtk/src/configwindow.c @@ -479,7 +479,7 @@ void update_registration( void ) GtkWidget* create_stun_tab() { GtkWidget * tableNat; - gchar * stun_server= "stun.fwdnet.net:3478"; + gchar * stun_server= "stun.ekiga.net:3478"; gchar * stun_enabled = "FALSE"; GtkWidget * label; diff --git a/src/managerimpl.cpp b/src/managerimpl.cpp index 16d22b136a..01a8cbbaca 100644 --- a/src/managerimpl.cpp +++ b/src/managerimpl.cpp @@ -2520,7 +2520,7 @@ void ManagerImpl::registerCurSIPAccounts(VoIPLink *link) current = iter->second; if (current) { - if ( current->isEnabled() && current->getType() == "sip") { + if (current->isEnabled() && current->getType() == "sip") { //current->setVoIPLink(link); current->registerVoIPLink(); } diff --git a/src/sipaccount.cpp b/src/sipaccount.cpp index fc77c0450d..0dceb51243 100644 --- a/src/sipaccount.cpp +++ b/src/sipaccount.cpp @@ -69,14 +69,14 @@ int SIPAccount::registerVoIPLink() int SIPAccount::unregisterVoIPLink() { - _debug("unregister account %s\n" , getAccountID().c_str()); - - _regc = NULL; - - if(_link->sendUnregister( _accountID )) - return true; - else - return false; + _debug("unregister account %s\n" , getAccountID().c_str()); + + if(_link->sendUnregister( _accountID )){ + setRegistrationInfo (NULL); + return true; + } + else + return false; } diff --git a/src/sipvoiplink.cpp b/src/sipvoiplink.cpp index b5372eb585..037686ab0f 100644 --- a/src/sipvoiplink.cpp +++ b/src/sipvoiplink.cpp @@ -314,14 +314,12 @@ int SIPVoIPLink::sendRegister( AccountID id ) /* Get the client registration information for this particular account */ regc = account->getRegistrationInfo(); - /* If the registration already exists, delete it */ - if(regc) { - + /* TODO If the registration already exists, delete it */ + /*if(regc) { status = pjsip_regc_destroy(regc); regc = NULL; PJ_ASSERT_RETURN( status == PJ_SUCCESS, 1 ); - } - + }*/ account->setRegister(true); @@ -331,7 +329,6 @@ int SIPVoIPLink::sendRegister( AccountID id ) /* Update the state of the voip link */ account->setRegistrationState(Trying); - if (!validStunServer) { account->setRegistrationState(ErrorExistStun); account->setRegister(false); @@ -387,7 +384,6 @@ int SIPVoIPLink::sendRegister( AccountID id ) return false; } - status = pjsip_regc_send(regc, tdata); if (status != PJ_SUCCESS) { _debug("UserAgent: Unable to send regc request.\n"); @@ -403,7 +399,7 @@ int SIPVoIPLink::sendRegister( AccountID id ) } int -SIPVoIPLink::sendUnregister( AccountID id ) +SIPVoIPLink::sendUnregister (AccountID id) { pj_status_t status = 0; pjsip_tx_data *tdata = NULL; @@ -435,7 +431,7 @@ SIPVoIPLink::sendUnregister( AccountID id ) return false; } - account->setRegistrationInfo(regc); + //account->setRegistrationInfo(regc); account->setRegister(false); return true; @@ -1799,11 +1795,11 @@ void call_on_tsx_changed(pjsip_inv_session *inv, pjsip_transaction *tsx, pjsip_e */ _debug("UserAgent: The error is: %d\n", param->code); switch(param->code) { - case 408: case 606: account->setRegistrationState(ErrorConfStun); break; case 503: + case 408: account->setRegistrationState(ErrorHost); break; case 401: diff --git a/src/user_cfg.h b/src/user_cfg.h index 62bb5579e7..8cddc81400 100644 --- a/src/user_cfg.h +++ b/src/user_cfg.h @@ -79,7 +79,7 @@ #define ADDRESSBOOK_DISPLAY_PHONE_MOBILE "Addressbook.phone_mobile" #define EMPTY_FIELD "" /** Default value for empty field */ -#define DFT_STUN_SERVER "stun.fwdnet.net:3478" /** Default STUN server address */ +#define DFT_STUN_SERVER "stun.ekiga.net" /** Default STUN server address */ #define YES_STR "1" /** Default YES value */ #define NO_STR "0" /** Default NO value */ #define DFT_PULSE_LENGTH_STR "250" /** Default DTMF lenght */ -- GitLab