diff --git a/.gitignore b/.gitignore index 51c1dce088f8e25d239bc1b1c5b0e3dac2bc66fe..57c836c5c211b02e3960af4abb74b0eb7f2b4ffb 100644 --- a/.gitignore +++ b/.gitignore @@ -63,6 +63,7 @@ sflphone-gtk/doc/html/* /sflphone-gtk/mkinstalldirs /sflphone-gtk/src/sflphone-gtk /sflphone-gtk/autom4te* +/sflphone-gtk/sflphone.desktop @@ -94,7 +95,7 @@ tools/portaudio /www/cache /www/config.inc.php /www/lighttpd.* - +/doc/images/graphics/* # Ignore platform packaging temp files /platform/debian/changelog diff --git a/src/account.h b/src/account.h index 1023cf3fb49962dcb56cffa84440ac815926873d..344e095a45f0a9dc24b5e3e59b4f56a52078cbb7 100644 --- a/src/account.h +++ b/src/account.h @@ -79,7 +79,7 @@ class Account{ inline VoIPLink* getVoIPLink() { return _link; } /** - * Register the underlying VoIPLink + * Register the underlying VoIPLink. Launch the event listener. * * This should update the getRegistrationState() return value. * @@ -88,7 +88,7 @@ class Account{ virtual void registerVoIPLink() = 0; /** - * Unregister the underlying VoIPLink + * Unregister the underlying VoIPLink. Stop the event listener. * * This should update the getRegistrationState() return value. * @@ -96,18 +96,6 @@ class Account{ */ virtual void unregisterVoIPLink() = 0; - /** - * Init the voiplink to run (event listener) - * @return false if an error occurs - */ - virtual bool init() = 0; - - /** - * Stop the voiplink to run (event listener) - * @return false is an error occurs - */ - virtual bool terminate() = 0; - /** * Tell if the account is enable or not. See doc for _enabled. */ diff --git a/src/iaxaccount.cpp b/src/iaxaccount.cpp index 146132d4ab2ec1c702a3bc88140cfc0cb28995d9..58c2fcb335a6317a083a3f71af2dedaad4790c16 100644 --- a/src/iaxaccount.cpp +++ b/src/iaxaccount.cpp @@ -38,7 +38,8 @@ IAXAccount::~IAXAccount() void IAXAccount::registerVoIPLink() { - init(); + _link->init(); + //unregisterAccount(); No need to unregister first. IAXVoIPLink* thislink = dynamic_cast<IAXVoIPLink*> (_link); if (thislink) { @@ -55,20 +56,7 @@ void IAXAccount::unregisterVoIPLink() { _link->sendUnregister(); -} - -bool -IAXAccount::init() -{ - _link->init(); - return true; -} - -bool -IAXAccount::terminate() -{ _link->terminate(); - return true; } void diff --git a/src/iaxaccount.h b/src/iaxaccount.h index b51d1740acb9cafc922db31e4d3405136a69b86c..5347df649c16f2f0477f0506cf7024bf421c9b86 100644 --- a/src/iaxaccount.h +++ b/src/iaxaccount.h @@ -30,16 +30,14 @@ class IAXAccount : public Account { public: - IAXAccount(const AccountID& accountID); + IAXAccount(const AccountID& accountID); - ~IAXAccount(); + ~IAXAccount(); /** Actually unuseful, since config loading is done in init() */ void loadConfig(); void registerVoIPLink(); void unregisterVoIPLink(); - bool init(); - bool terminate(); private: }; diff --git a/src/managerimpl.cpp b/src/managerimpl.cpp index 348f1a71f439c0e7011cb0f9a117fd5abac2d00b..4ca594b6669462ec2bbdcbcbb18248856714c1d1 100644 --- a/src/managerimpl.cpp +++ b/src/managerimpl.cpp @@ -456,7 +456,6 @@ ManagerImpl::registerAccount(const AccountID& accountId) while ( iter != _accountMap.end() ) { if ( iter->second ) { iter->second->unregisterVoIPLink(); - iter->second->terminate(); } iter++; } diff --git a/src/sipaccount.cpp b/src/sipaccount.cpp index e4235f6af5f52f8f7e6f55656c352a8fc6d4f48a..b696226ce7968eab886ceeb3f8e64865d3343aee 100644 --- a/src/sipaccount.cpp +++ b/src/sipaccount.cpp @@ -37,48 +37,32 @@ SIPAccount::~SIPAccount() void SIPAccount::registerVoIPLink() -{ - init(); // init if not enable - unregisterVoIPLink(); - SIPVoIPLink* thislink = dynamic_cast<SIPVoIPLink*> (_link); - if (thislink) { - // Stuff needed for SIP registration. - thislink->setProxy (Manager::instance().getConfigString(_accountID,SIP_PROXY)); - thislink->setUserPart(Manager::instance().getConfigString(_accountID,SIP_USER_PART)); - thislink->setAuthName(Manager::instance().getConfigString(_accountID,SIP_AUTH_NAME)); - thislink->setPassword(Manager::instance().getConfigString(_accountID,SIP_PASSWORD)); - } - - _link->sendRegister(); -} - -void -SIPAccount::unregisterVoIPLink() -{ - _link->sendUnregister(); -} - -bool -SIPAccount::init() { _link->setFullName(Manager::instance().getConfigString(_accountID,SIP_FULL_NAME)); _link->setHostName(Manager::instance().getConfigString(_accountID,SIP_HOST_PART)); int useStun = Manager::instance().getConfigInt(_accountID,SIP_USE_STUN); SIPVoIPLink* thislink = dynamic_cast<SIPVoIPLink*> (_link); - if (thislink) { - thislink->setStunServer(Manager::instance().getConfigString(_accountID,SIP_STUN_SERVER)); - thislink->setUseStun( useStun!=0 ? true : false); - } + + thislink->setStunServer(Manager::instance().getConfigString(_accountID,SIP_STUN_SERVER)); + thislink->setUseStun( useStun!=0 ? true : false); + _link->init(); - return true; + + // Stuff needed for SIP registration. + thislink->setProxy (Manager::instance().getConfigString(_accountID,SIP_PROXY)); + thislink->setUserPart(Manager::instance().getConfigString(_accountID,SIP_USER_PART)); + thislink->setAuthName(Manager::instance().getConfigString(_accountID,SIP_AUTH_NAME)); + thislink->setPassword(Manager::instance().getConfigString(_accountID,SIP_PASSWORD)); + + _link->sendRegister(); } -bool -SIPAccount::terminate() +void +SIPAccount::unregisterVoIPLink() { + _link->sendUnregister(); _link->terminate(); - return true; } void diff --git a/src/sipaccount.h b/src/sipaccount.h index 8c532fa5813675dd1db9ffa0475be219dbdcd649..37f3f5aad57b8cb5491fb534afa9f0b0a96a6271 100644 --- a/src/sipaccount.h +++ b/src/sipaccount.h @@ -24,7 +24,7 @@ /** - * A Sip Account specify SIP specific functions and object (SIPCall/SIPVoIPLink) + * A SIP Account specify SIP specific functions and object (SIPCall/SIPVoIPLink) * @author Yan Morin <yan.morin@gmail.com> */ class SIPAccount : public Account @@ -38,11 +38,8 @@ public: void loadConfig(); void registerVoIPLink(); void unregisterVoIPLink(); - bool init(); - bool terminate(); private: - }; #endif