Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
d555cd5f
Commit
d555cd5f
authored
16 years ago
by
Jérémy Quentin
Browse files
Options
Downloads
Patches
Plain Diff
make daemon find the account, added userMatch
parent
54afba69
No related branches found
No related tags found
No related merge requests found
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
sflphone-common/src/managerimpl.cpp
+22
-2
22 additions, 2 deletions
sflphone-common/src/managerimpl.cpp
sflphone-common/src/sipaccount.cpp
+2
-0
2 additions, 0 deletions
sflphone-common/src/sipaccount.cpp
sflphone-common/src/sipvoiplink.cpp
+2627
-2410
2627 additions, 2410 deletions
sflphone-common/src/sipvoiplink.cpp
with
2651 additions
and
2412 deletions
sflphone-common/src/managerimpl.cpp
+
22
−
2
View file @
d555cd5f
...
...
@@ -2533,24 +2533,44 @@ ManagerImpl::getAccountIdFromNameAndServer(const std::string& userName, const st
{
AccountMap
::
iterator
iter
;
SIPAccount
*
account
;
_debug
(
"getAccountIdFromNameAndServer : username = %s , server = %s
\n
"
,
userName
.
c_str
(),
server
.
c_str
());
// Try to find the account id from username and server name by full match
for
(
iter
=
_accountMap
.
begin
();
iter
!=
_accountMap
.
end
();
++
iter
)
{
_debug
(
"for : account = %s
\n
"
,
iter
->
first
.
c_str
());
account
=
dynamic_cast
<
SIPAccount
*>
(
iter
->
second
);
_debug
(
"account != NULL = %i
\n
"
,
(
account
!=
NULL
));
if
(
account
!=
NULL
){
if
(
account
->
fullMatch
(
userName
,
server
))
{
_debug
(
"fullMatch
\n
"
);
return
iter
->
first
;
}
}
}
// We failed! Then only match the hostname
for
(
iter
=
_accountMap
.
begin
();
iter
!=
_accountMap
.
end
();
++
iter
)
{
account
=
dynamic_cast
<
SIPAccount
*>
(
iter
->
second
);
if
(
account
!=
NULL
)
{
if
(
account
->
hostnameMatch
(
server
))
{
_debug
(
"hostnameMatch
\n
"
);
return
iter
->
first
;
}
}
}
// We failed! Then only match the username
for
(
iter
=
_accountMap
.
begin
();
iter
!=
_accountMap
.
end
();
++
iter
)
{
account
=
dynamic_cast
<
SIPAccount
*>
(
iter
->
second
);
if
(
account
!=
NULL
)
{
if
(
account
->
userMatch
(
userName
))
{
_debug
(
"userMatch
\n
"
);
return
iter
->
first
;
}
}
}
// Failed again! return AccountNULL
return
AccountNULL
;
...
...
This diff is collapsed.
Click to expand it.
sflphone-common/src/sipaccount.cpp
+
2
−
0
View file @
d555cd5f
...
...
@@ -92,11 +92,13 @@ bool SIPAccount::fullMatch(const std::string& username, const std::string& hostn
bool
SIPAccount
::
userMatch
(
const
std
::
string
&
username
)
{
_debug
(
"username = %s , getUserName() = %s, == : %i
\n
"
,
username
.
c_str
(),
getUsername
().
c_str
()
,
username
==
getUsername
());
return
(
username
==
getUsername
());
}
bool
SIPAccount
::
hostnameMatch
(
const
std
::
string
&
hostname
)
{
_debug
(
"hostname = %s , getHostname() = %s, == : %i
\n
"
,
hostname
.
c_str
(),
getHostname
().
c_str
()
,
hostname
==
getHostname
());
return
(
hostname
==
getHostname
());
}
This diff is collapsed.
Click to expand it.
sflphone-common/src/sipvoiplink.cpp
+
2627
−
2410
View file @
d555cd5f
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment