Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
dd407a6b
Commit
dd407a6b
authored
Oct 02, 2007
by
Alexandre Bourget
Browse files
Remove all duplicate init/registerVoIPLink and terminate/unregister calls and methods.
parent
65690e30
Changes
7
Show whitespace changes
Inline
Side-by-side
.gitignore
View file @
dd407a6b
...
...
@@ -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
...
...
src/account.h
View file @
dd407a6b
...
...
@@ -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.
*/
...
...
src/iaxaccount.cpp
View file @
dd407a6b
...
...
@@ -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
...
...
src/iaxaccount.h
View file @
dd407a6b
...
...
@@ -38,8 +38,6 @@ public:
void
loadConfig
();
void
registerVoIPLink
();
void
unregisterVoIPLink
();
bool
init
();
bool
terminate
();
private:
};
...
...
src/managerimpl.cpp
View file @
dd407a6b
...
...
@@ -456,7 +456,6 @@ ManagerImpl::registerAccount(const AccountID& accountId)
while
(
iter
!=
_accountMap
.
end
()
)
{
if
(
iter
->
second
)
{
iter
->
second
->
unregisterVoIPLink
();
iter
->
second
->
terminate
();
}
iter
++
;
}
...
...
src/sipaccount.cpp
View file @
dd407a6b
...
...
@@ -38,16 +38,22 @@ SIPAccount::~SIPAccount()
void
SIPAccount
::
registerVoIPLink
()
{
init
();
// init if not enable
unregisterVoIPLink
();
_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
);
_link
->
init
();
// 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
();
}
...
...
@@ -56,29 +62,7 @@ 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
);
}
_link
->
init
();
return
true
;
}
bool
SIPAccount
::
terminate
()
{
_link
->
terminate
();
return
true
;
}
void
...
...
src/sipaccount.h
View file @
dd407a6b
...
...
@@ -24,7 +24,7 @@
/**
* A S
ip
Account specify SIP specific functions and object (SIPCall/SIPVoIPLink)
* A S
IP
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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment