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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
94cc6fdb
Commit
94cc6fdb
authored
12 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
#14615: Fix compilation without iax
parent
300d1438
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
daemon/src/managerimpl.cpp
+38
-3
38 additions, 3 deletions
daemon/src/managerimpl.cpp
daemon/src/managerimpl.h
+2
-0
2 additions, 0 deletions
daemon/src/managerimpl.h
with
40 additions
and
3 deletions
daemon/src/managerimpl.cpp
+
38
−
3
View file @
94cc6fdb
...
...
@@ -43,11 +43,17 @@
#include
"dbus/callmanager.h"
#include
"global.h"
#include
"fileutils.h"
#include
"sip/sipvoiplink.h"
#include
"sip/sipaccount.h"
#include
"sip/sipcall.h"
#include
"im/instant_messaging.h"
#if HAVE_IAX
#include
"iax/iaxaccount.h"
#include
"iax/iaxcall.h"
#include
"iax/iaxvoiplink.h"
#endif
#include
"numbercleaner.h"
#include
"config/yamlparser.h"
#include
"config/yamlemitter.h"
...
...
@@ -55,8 +61,6 @@
#include
"audio/sound/tonelist.h"
#include
"audio/sound/audiofile.h"
#include
"audio/sound/dtmf.h"
#include
"sip/sipvoiplink.h"
#include
"iax/iaxvoiplink.h"
#include
"history/historynamecache.h"
#include
"manager.h"
...
...
@@ -874,10 +878,12 @@ ManagerImpl::getCallFromCallID(const std::string &callID)
Call
*
call
=
NULL
;
call
=
SIPVoIPLink
::
getSipCall
(
callID
);
#if HAVE_IAX
if
(
call
!=
NULL
)
return
call
;
call
=
IAXVoIPLink
::
getIaxCall
(
callID
);
#endif
return
call
;
}
...
...
@@ -1260,8 +1266,10 @@ void ManagerImpl::saveConfig()
iter
!=
SIPVoIPLink
::
getInternalAccountMap
().
end
();
++
iter
)
iter
->
second
->
serialize
(
emitter
);
#if HAVE_IAX
for
(
AccountMap
::
iterator
iter
=
IAXVoIPLink
::
getInternalAccountMap
().
begin
();
iter
!=
IAXVoIPLink
::
getInternalAccountMap
().
end
();
++
iter
)
iter
->
second
->
serialize
(
emitter
);
#endif
preferences
.
serialize
(
emitter
);
voipPreferences
.
serialize
(
emitter
);
...
...
@@ -2446,7 +2454,9 @@ void ManagerImpl::removeAccount(const std::string& accountID)
if
(
remAccount
!=
NULL
)
{
remAccount
->
unregisterVoIPLink
();
SIPVoIPLink
::
getInternalAccountMap
().
erase
(
accountID
);
#if HAVE_IAX
IAXVoIPLink
::
getInternalAccountMap
().
erase
(
accountID
);
#endif
// http://projects.savoirfairelinux.net/issues/show/2355
// delete remAccount;
}
...
...
@@ -2529,7 +2539,11 @@ namespace {
return
id
==
"IP2IP"
;
}
#if HAVE_IAX
void
loadAccount
(
const
Conf
::
YamlNode
*
item
,
AccountMap
&
sipAccountMap
,
AccountMap
&
iaxAccountMap
)
#else
void
loadAccount
(
const
Conf
::
YamlNode
*
item
,
AccountMap
&
sipAccountMap
)
#endif
{
if
(
!
item
)
{
ERROR
(
"Could not load account"
);
...
...
@@ -2650,20 +2664,29 @@ void ManagerImpl::loadAccountMap(Conf::YamlParser &parser)
// Each valid account element in sequence is a new account to load
// std::for_each(seq->begin(), seq->end(),
// std::tr1::bind(loadAccount, _1, std::tr1::ref(accountMap_)));
#if HAVE_IAX
std
::
for_each
(
seq
->
begin
(),
seq
->
end
(),
std
::
tr1
::
bind
(
loadAccount
,
_1
,
std
::
tr1
::
ref
(
SIPVoIPLink
::
getInternalAccountMap
()),
std
::
tr1
::
ref
(
IAXVoIPLink
::
getInternalAccountMap
())));
#else
std
::
for_each
(
seq
->
begin
(),
seq
->
end
(),
std
::
tr1
::
bind
(
loadAccount
,
_1
,
std
::
tr1
::
ref
(
SIPVoIPLink
::
getInternalAccountMap
())));
#endif
}
void
ManagerImpl
::
registerAllAccounts
()
{
std
::
for_each
(
SIPVoIPLink
::
getInternalAccountMap
().
begin
(),
SIPVoIPLink
::
getInternalAccountMap
().
end
(),
registerAccount
);
#if HAVE_IAX
std
::
for_each
(
IAXVoIPLink
::
getInternalAccountMap
().
begin
(),
IAXVoIPLink
::
getInternalAccountMap
().
end
(),
registerAccount
);
#endif
}
void
ManagerImpl
::
unregisterAllAccounts
()
{
std
::
for_each
(
SIPVoIPLink
::
getInternalAccountMap
().
begin
(),
SIPVoIPLink
::
getInternalAccountMap
().
end
(),
unregisterAccount
);
#if HAVE_IAX
std
::
for_each
(
IAXVoIPLink
::
getInternalAccountMap
().
begin
(),
IAXVoIPLink
::
getInternalAccountMap
().
end
(),
unregisterAccount
);
#endif
}
void
ManagerImpl
::
unloadAccountMap
()
...
...
@@ -2671,8 +2694,10 @@ void ManagerImpl::unloadAccountMap()
std
::
for_each
(
SIPVoIPLink
::
getInternalAccountMap
().
begin
(),
SIPVoIPLink
::
getInternalAccountMap
().
end
(),
unloadAccount
);
SIPVoIPLink
::
getInternalAccountMap
().
clear
();
#if HAVE_IAX
std
::
for_each
(
IAXVoIPLink
::
getInternalAccountMap
().
begin
(),
IAXVoIPLink
::
getInternalAccountMap
().
end
(),
unloadAccount
);
IAXVoIPLink
::
getInternalAccountMap
().
clear
();
#endif
}
bool
ManagerImpl
::
accountExists
(
const
std
::
string
&
accountID
)
...
...
@@ -2680,10 +2705,14 @@ bool ManagerImpl::accountExists(const std::string &accountID)
bool
ret
=
false
;
ret
=
SIPVoIPLink
::
getInternalAccountMap
().
find
(
accountID
)
!=
SIPVoIPLink
::
getInternalAccountMap
().
end
();
#if HAVE_IAX
if
(
ret
)
return
ret
;
return
IAXVoIPLink
::
getInternalAccountMap
().
find
(
accountID
)
!=
IAXVoIPLink
::
getInternalAccountMap
().
end
();
ret
=
IAXVoIPLink
::
getInternalAccountMap
().
find
(
accountID
)
!=
IAXVoIPLink
::
getInternalAccountMap
().
end
();
#endif
return
ret
;
}
SIPAccount
*
...
...
@@ -2705,9 +2734,11 @@ ManagerImpl::getAccount(const std::string& accountID) const
if
(
account
!=
NULL
)
return
account
;
#if HAVE_IAX
account
=
getIaxAccount
(
accountID
);
if
(
account
!=
NULL
)
return
account
;
#endif
return
NULL
;
}
...
...
@@ -2722,6 +2753,7 @@ ManagerImpl::getSipAccount(const std::string& accountID) const
return
NULL
;
}
#if HAVE_IAX
IAXAccount
*
ManagerImpl
::
getIaxAccount
(
const
std
::
string
&
accountID
)
const
{
...
...
@@ -2731,11 +2763,14 @@ ManagerImpl::getIaxAccount(const std::string& accountID) const
return
NULL
;
}
#endif
void
ManagerImpl
::
fillConcatAccountMap
(
AccountMap
&
concatMap
)
const
{
concatMap
.
insert
(
SIPVoIPLink
::
getInternalAccountMap
().
begin
(),
SIPVoIPLink
::
getInternalAccountMap
().
end
());
#if HAVE_IAX
concatMap
.
insert
(
IAXVoIPLink
::
getInternalAccountMap
().
begin
(),
IAXVoIPLink
::
getInternalAccountMap
().
end
());
#endif
}
std
::
string
...
...
This diff is collapsed.
Click to expand it.
daemon/src/managerimpl.h
+
2
−
0
View file @
94cc6fdb
...
...
@@ -1080,12 +1080,14 @@ class ManagerImpl {
*/
SIPAccount
*
getSipAccount
(
const
std
::
string
&
accontID
)
const
;
#if HAVE_IAX
/**
* Get an IAX account pointer
* @param accountID account ID to get
* @return IAXAccount* The account pointer or 0
*/
IAXAccount
*
getIaxAccount
(
const
std
::
string
&
accountID
)
const
;
#endif
/**
* Get a pointer to the IP2IP account
...
...
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