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
10319d91
Commit
10319d91
authored
Jul 17, 2012
by
Alexandre Savard
Browse files
Merge branch 'master' into pcre-optional
parents
b766c7f4
15e64364
Changes
223
Hide whitespace changes
Inline
Side-by-side
daemon/configure.ac
View file @
10319d91
...
...
@@ -256,7 +256,7 @@ AC_DEFUN([BB_ENABLE_DOXYGEN],
# Acutally perform the doxygen check
BB_ENABLE_DOXYGEN
CXXFLAGS="${CXXFLAGS} -g -Wno-return-type -Wall -Wextra -Wnon-virtual-dtor -Weffc++
-Wfatal-errors
"
CXXFLAGS="${CXXFLAGS} -g -Wno-return-type -Wall -Wextra -Wnon-virtual-dtor -Weffc++"
dnl What to generate
AC_CONFIG_FILES([Makefile])
...
...
daemon/man/Makefile.am
View file @
10319d91
SECTION
=
"1"
TEMPLATES
=
\
sflphoned.pod
TEMPLATES
=
sflphoned.pod
man_MANS
=
sflphoned.1
man_MANS
=
sflphoned.1
POD2MAN
=
pod2man
EXTRA_DIST
=
$(man_MANS)
EXTRA_DIST
=
$(man_MANS)
$(TEMPLATES)
all
:
$(MANPAGES)
all
:
$(MANPAGES)
SUFFIXES
=
.pod .1
...
...
daemon/src/Makefile.am
View file @
10319d91
...
...
@@ -54,7 +54,9 @@ noinst_HEADERS = \
cc_thread.h
\
cc_config.h
\
sfl_types.h
\
array_size.h
array_size.h
\
account_schema.h
\
registration_states.h
if
SFL_VIDEO
SFL_VIDEO_LIB
=
./video/libvideo.la
...
...
daemon/src/account.cpp
View file @
10319d91
...
...
@@ -29,26 +29,53 @@
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#ifdef HAVE_CONFIG_H
#include
"config.h"
#endif
#include
"account.h"
#include
"manager.h"
#include
"dbus/configurationmanager.h"
#include
<algorithm>
#ifdef SFL_VIDEO
#include
"video/
video_endpoint
.h"
#include
"video/
libav_utils
.h"
#endif
Account
::
Account
(
const
std
::
string
&
accountID
,
const
std
::
string
&
type
)
:
#include
"logger.h"
#include
"manager.h"
#include
"dbus/configurationmanager.h"
const
char
*
const
Account
::
AUDIO_CODECS_KEY
=
"audioCodecs"
;
// 0/9/110/111/112/
const
char
*
const
Account
::
VIDEO_CODECS_KEY
=
"videoCodecs"
;
const
char
*
const
Account
::
VIDEO_CODEC_ENABLED
=
"enabled"
;
const
char
*
const
Account
::
VIDEO_CODEC_NAME
=
"name"
;
const
char
*
const
Account
::
VIDEO_CODEC_BITRATE
=
"bitrate"
;
const
char
*
const
Account
::
RINGTONE_PATH_KEY
=
"ringtonePath"
;
const
char
*
const
Account
::
RINGTONE_ENABLED_KEY
=
"ringtoneEnabled"
;
const
char
*
const
Account
::
DISPLAY_NAME_KEY
=
"displayName"
;
const
char
*
const
Account
::
ALIAS_KEY
=
"alias"
;
const
char
*
const
Account
::
TYPE_KEY
=
"type"
;
const
char
*
const
Account
::
ID_KEY
=
"id"
;
const
char
*
const
Account
::
USERNAME_KEY
=
"username"
;
const
char
*
const
Account
::
AUTHENTICATION_USERNAME_KEY
=
"authenticationUsername"
;
const
char
*
const
Account
::
PASSWORD_KEY
=
"password"
;
const
char
*
const
Account
::
HOSTNAME_KEY
=
"hostname"
;
const
char
*
const
Account
::
ACCOUNT_ENABLE_KEY
=
"enable"
;
const
char
*
const
Account
::
MAILBOX_KEY
=
"mailbox"
;
using
std
::
map
;
using
std
::
string
;
using
std
::
vector
;
Account
::
Account
(
const
string
&
accountID
,
const
string
&
type
)
:
accountID_
(
accountID
)
,
username_
()
,
hostname_
()
,
alias_
()
,
enabled_
(
true
)
,
type_
(
type
)
,
registrationState_
(
U
nregistered
)
,
registrationState_
(
U
NREGISTERED
)
,
audioCodecList_
()
,
videoCodecList_
()
,
audioCodecStr_
()
,
videoCodecStr_
()
,
ringtonePath_
(
"/usr/share/sflphone/ringtones/konga.ul"
)
,
ringtoneEnabled_
(
true
)
,
displayName_
(
""
)
...
...
@@ -79,7 +106,7 @@ void Account::loadDefaultCodecs()
// CodecMap codecMap = Manager::instance ().getCodecDescriptorMap ().getCodecsMap();
// Initialize codec
std
::
vector
<
std
::
string
>
result
;
vector
<
string
>
result
;
result
.
push_back
(
"0"
);
result
.
push_back
(
"3"
);
result
.
push_back
(
"8"
);
...
...
@@ -90,31 +117,90 @@ void Account::loadDefaultCodecs()
setActiveAudioCodecs
(
result
);
#ifdef SFL_VIDEO
setActiveVideoCodecs
(
sfl_video
::
getCodecList
());
// we don't need to validate via setVideoCodecs, since these are defaults
videoCodecList_
=
libav_utils
::
getDefaultCodecs
();
#endif
}
void
Account
::
setActiveVideoCodecs
(
const
std
::
vector
<
std
::
string
>
&
list
)
#ifdef SFL_VIDEO
namespace
{
bool
isPositiveInteger
(
const
string
&
s
)
{
string
::
const_iterator
it
=
s
.
begin
();
while
(
it
!=
s
.
end
()
and
std
::
isdigit
(
*
it
))
++
it
;
return
not
s
.
empty
()
and
it
==
s
.
end
();
}
bool
isBoolean
(
const
string
&
s
)
{
return
s
==
"true"
or
s
==
"false"
;
}
template
<
typename
Predicate
>
bool
isFieldValid
(
const
map
<
string
,
string
>
&
codec
,
const
char
*
field
,
Predicate
p
)
{
map
<
string
,
string
>::
const_iterator
key
(
codec
.
find
(
field
));
return
key
!=
codec
.
end
()
and
p
(
key
->
second
);
}
bool
isCodecValid
(
const
map
<
string
,
string
>
&
codec
,
const
vector
<
map
<
string
,
string
>
>
&
defaults
)
{
map
<
string
,
string
>::
const_iterator
name
(
codec
.
find
(
Account
::
VIDEO_CODEC_NAME
));
if
(
name
==
codec
.
end
())
{
ERROR
(
"Field
\"
name
\"
missing in codec specification"
);
return
false
;
}
// check that it's in the list of valid codecs and that it has all the required fields
for
(
vector
<
map
<
string
,
string
>
>::
const_iterator
i
=
defaults
.
begin
();
i
!=
defaults
.
end
();
++
i
)
{
map
<
string
,
string
>::
const_iterator
defaultName
=
i
->
find
(
Account
::
VIDEO_CODEC_NAME
);
if
(
defaultName
->
second
==
name
->
second
)
{
return
isFieldValid
(
codec
,
Account
::
VIDEO_CODEC_BITRATE
,
isPositiveInteger
)
and
isFieldValid
(
codec
,
Account
::
VIDEO_CODEC_ENABLED
,
isBoolean
);
}
}
ERROR
(
"Codec %s not supported"
,
name
->
second
.
c_str
());
return
false
;
}
bool
isCodecListValid
(
const
vector
<
map
<
string
,
string
>
>
&
list
)
{
const
vector
<
map
<
string
,
string
>
>
defaults
(
libav_utils
::
getDefaultCodecs
());
if
(
list
.
size
()
!=
defaults
.
size
())
{
ERROR
(
"New codec list has a different length than the list of supported codecs"
);
return
false
;
}
// make sure that all codecs are present
for
(
vector
<
map
<
string
,
string
>
>::
const_iterator
i
=
list
.
begin
();
i
!=
list
.
end
();
++
i
)
{
if
(
not
isCodecValid
(
*
i
,
defaults
))
return
false
;
}
return
true
;
}
}
#endif
void
Account
::
setVideoCodecs
(
const
vector
<
map
<
string
,
string
>
>
&
list
)
{
#ifdef SFL_VIDEO
// first clear the previously stored codecs
videoCodecList_
.
clear
();
videoCodecList_
=
!
list
.
empty
()
?
list
:
sfl_video
::
getCodecList
();
// update the codec string according to new codec selection
videoCodecStr_
=
ManagerImpl
::
join_string
(
list
);
if
(
isCodecListValid
(
list
))
videoCodecList_
=
list
;
#else
(
void
)
list
;
#endif
}
void
Account
::
setActiveAudioCodecs
(
const
std
::
vector
<
std
::
string
>
&
list
)
void
Account
::
setActiveAudioCodecs
(
const
vector
<
string
>
&
list
)
{
// first clear the previously stored codecs
audioCodecList_
.
clear
();
// list contains the ordered payload of active codecs picked by the user for this account
// we used the CodecOrder vector to save the order.
for
(
std
::
vector
<
std
::
string
>::
const_iterator
iter
=
list
.
begin
();
iter
!=
list
.
end
();
for
(
vector
<
string
>::
const_iterator
iter
=
list
.
begin
();
iter
!=
list
.
end
();
++
iter
)
{
int
payload
=
std
::
atoi
(
iter
->
c_str
());
audioCodecList_
.
push_back
(
payload
);
...
...
@@ -124,7 +210,7 @@ void Account::setActiveAudioCodecs(const std::vector<std::string> &list)
audioCodecStr_
=
ManagerImpl
::
join_string
(
list
);
}
std
::
string
Account
::
mapStateNumberToString
(
RegistrationState
state
)
string
Account
::
mapStateNumberToString
(
RegistrationState
state
)
{
static
const
char
*
mapStateToChar
[]
=
{
"UNREGISTERED"
,
...
...
@@ -138,8 +224,31 @@ std::string Account::mapStateNumberToString(RegistrationState state)
"ERRORCONFSTUN"
};
if
(
state
>
N
umberOfStates
)
if
(
state
>
N
UMBER_OF_STATES
)
return
"ERROR"
;
return
mapStateToChar
[
state
];
}
vector
<
map
<
string
,
string
>
>
Account
::
getAllVideoCodecs
()
const
{
return
videoCodecList_
;
}
namespace
{
bool
is_inactive
(
const
map
<
string
,
string
>
&
codec
)
{
map
<
string
,
string
>::
const_iterator
iter
=
codec
.
find
(
Account
::
VIDEO_CODEC_ENABLED
);
return
iter
==
codec
.
end
()
or
iter
->
second
!=
"true"
;
}
}
vector
<
map
<
string
,
string
>
>
Account
::
getActiveVideoCodecs
()
const
{
// FIXME: validate video codec details first
vector
<
map
<
string
,
string
>
>
result
(
videoCodecList_
);
result
.
erase
(
std
::
remove_if
(
result
.
begin
(),
result
.
end
(),
is_inactive
),
result
.
end
());
return
result
;
}
daemon/src/account.h
View file @
10319d91
...
...
@@ -35,10 +35,10 @@
#include
<string>
#include
<vector>
#include
"global.h"
#include
"noncopyable.h"
#include
"config/sfl_config.h"
#include
"config/serializable.h"
#include
"registration_states.h"
class
VoIPLink
;
...
...
@@ -49,102 +49,6 @@ class VoIPLink;
* It contains account, configuration, VoIP Link and Calls (inside the VoIPLink)
*/
/** Contains all the state an Voip can be in */
enum
RegistrationState
{
Unregistered
,
Trying
,
Registered
,
Error
,
ErrorAuth
,
ErrorNetwork
,
ErrorHost
,
ErrorExistStun
,
ErrorNotAcceptable
,
NumberOfStates
};
// Account identifier
static
const
char
*
const
CONFIG_ACCOUNT_ID
=
"Account.id"
;
// Common account parameters
static
const
char
*
const
CONFIG_ACCOUNT_TYPE
=
"Account.type"
;
static
const
char
*
const
CONFIG_ACCOUNT_ALIAS
=
"Account.alias"
;
static
const
char
*
const
CONFIG_ACCOUNT_MAILBOX
=
"Account.mailbox"
;
static
const
char
*
const
CONFIG_ACCOUNT_ENABLE
=
"Account.enable"
;
static
const
char
*
const
CONFIG_ACCOUNT_REGISTRATION_EXPIRE
=
"Account.registrationExpire"
;
static
const
char
*
const
CONFIG_ACCOUNT_REGISTRATION_STATUS
=
"Account.registrationStatus"
;
static
const
char
*
const
CONFIG_ACCOUNT_REGISTRATION_STATE_CODE
=
"Account.registrationCode"
;
static
const
char
*
const
CONFIG_ACCOUNT_REGISTRATION_STATE_DESC
=
"Account.registrationDescription"
;
static
const
char
*
const
CONFIG_CREDENTIAL_NUMBER
=
"Credential.count"
;
static
const
char
*
const
CONFIG_ACCOUNT_DTMF_TYPE
=
"Account.dtmfType"
;
static
const
char
*
const
CONFIG_RINGTONE_PATH
=
"Account.ringtonePath"
;
static
const
char
*
const
CONFIG_RINGTONE_ENABLED
=
"Account.ringtoneEnabled"
;
static
const
char
*
const
CONFIG_KEEP_ALIVE_ENABLED
=
"Account.keepAliveEnabled"
;
static
const
char
*
const
CONFIG_ACCOUNT_HOSTNAME
=
"Account.hostname"
;
static
const
char
*
const
CONFIG_ACCOUNT_USERNAME
=
"Account.username"
;
static
const
char
*
const
CONFIG_ACCOUNT_ROUTESET
=
"Account.routeset"
;
static
const
char
*
const
CONFIG_ACCOUNT_PASSWORD
=
"Account.password"
;
static
const
char
*
const
CONFIG_ACCOUNT_REALM
=
"Account.realm"
;
static
const
char
*
const
CONFIG_ACCOUNT_DEFAULT_REALM
=
"*"
;
static
const
char
*
const
CONFIG_ACCOUNT_USERAGENT
=
"Account.useragent"
;
static
const
char
*
const
CONFIG_LOCAL_INTERFACE
=
"Account.localInterface"
;
static
const
char
*
const
CONFIG_PUBLISHED_SAMEAS_LOCAL
=
"Account.publishedSameAsLocal"
;
static
const
char
*
const
CONFIG_LOCAL_PORT
=
"Account.localPort"
;
static
const
char
*
const
CONFIG_PUBLISHED_PORT
=
"Account.publishedPort"
;
static
const
char
*
const
CONFIG_PUBLISHED_ADDRESS
=
"Account.publishedAddress"
;
static
const
char
*
const
CONFIG_DISPLAY_NAME
=
"Account.displayName"
;
static
const
char
*
const
CONFIG_DEFAULT_ADDRESS
=
"0.0.0.0"
;
// SIP specific parameters
static
const
char
*
const
CONFIG_SIP_PROXY
=
"SIP.proxy"
;
static
const
char
*
const
CONFIG_STUN_SERVER
=
"STUN.server"
;
static
const
char
*
const
CONFIG_STUN_ENABLE
=
"STUN.enable"
;
// SRTP specific parameters
static
const
char
*
const
CONFIG_SRTP_ENABLE
=
"SRTP.enable"
;
static
const
char
*
const
CONFIG_SRTP_KEY_EXCHANGE
=
"SRTP.keyExchange"
;
static
const
char
*
const
CONFIG_SRTP_ENCRYPTION_ALGO
=
"SRTP.encryptionAlgorithm"
;
// Provided by ccRTP,0=NULL,1=AESCM,2=AESF8
static
const
char
*
const
CONFIG_SRTP_RTP_FALLBACK
=
"SRTP.rtpFallback"
;
static
const
char
*
const
CONFIG_ZRTP_HELLO_HASH
=
"ZRTP.helloHashEnable"
;
static
const
char
*
const
CONFIG_ZRTP_DISPLAY_SAS
=
"ZRTP.displaySAS"
;
static
const
char
*
const
CONFIG_ZRTP_NOT_SUPP_WARNING
=
"ZRTP.notSuppWarning"
;
static
const
char
*
const
CONFIG_ZRTP_DISPLAY_SAS_ONCE
=
"ZRTP.displaySasOnce"
;
static
const
char
*
const
CONFIG_TLS_LISTENER_PORT
=
"TLS.listenerPort"
;
static
const
char
*
const
CONFIG_TLS_ENABLE
=
"TLS.enable"
;
static
const
char
*
const
CONFIG_TLS_CA_LIST_FILE
=
"TLS.certificateListFile"
;
static
const
char
*
const
CONFIG_TLS_CERTIFICATE_FILE
=
"TLS.certificateFile"
;
static
const
char
*
const
CONFIG_TLS_PRIVATE_KEY_FILE
=
"TLS.privateKeyFile"
;
static
const
char
*
const
CONFIG_TLS_PASSWORD
=
"TLS.password"
;
static
const
char
*
const
CONFIG_TLS_METHOD
=
"TLS.method"
;
static
const
char
*
const
CONFIG_TLS_CIPHERS
=
"TLS.ciphers"
;
static
const
char
*
const
CONFIG_TLS_SERVER_NAME
=
"TLS.serverName"
;
static
const
char
*
const
CONFIG_TLS_VERIFY_SERVER
=
"TLS.verifyServer"
;
static
const
char
*
const
CONFIG_TLS_VERIFY_CLIENT
=
"TLS.verifyClient"
;
static
const
char
*
const
CONFIG_TLS_REQUIRE_CLIENT_CERTIFICATE
=
"TLS.requireClientCertificate"
;
static
const
char
*
const
CONFIG_TLS_NEGOTIATION_TIMEOUT_SEC
=
"TLS.negotiationTimeoutSec"
;
static
const
char
*
const
CONFIG_TLS_NEGOTIATION_TIMEOUT_MSEC
=
"TLS.negotiationTimemoutMsec"
;
// General configuration keys for accounts
static
const
char
*
const
ALIAS_KEY
=
"alias"
;
static
const
char
*
const
TYPE_KEY
=
"type"
;
static
const
char
*
const
ID_KEY
=
"id"
;
static
const
char
*
const
USERNAME_KEY
=
"username"
;
static
const
char
*
const
AUTHENTICATION_USERNAME_KEY
=
"authenticationUsername"
;
static
const
char
*
const
PASSWORD_KEY
=
"password"
;
static
const
char
*
const
HOSTNAME_KEY
=
"hostname"
;
static
const
char
*
const
ACCOUNT_ENABLE_KEY
=
"enable"
;
static
const
char
*
const
MAILBOX_KEY
=
"mailbox"
;
static
const
char
*
const
AUDIO_CODECS_KEY
=
"audioCodecs"
;
// 0/9/110/111/112/
static
const
char
*
const
VIDEO_CODECS_KEY
=
"videoCodecs"
;
static
const
char
*
const
RINGTONE_PATH_KEY
=
"ringtonePath"
;
static
const
char
*
const
RINGTONE_ENABLED_KEY
=
"ringtoneEnabled"
;
static
const
char
*
const
DISPLAY_NAME_KEY
=
"displayName"
;
class
Account
:
public
Serializable
{
public:
...
...
@@ -225,17 +129,16 @@ class Account : public Serializable {
std
::
string
getAlias
()
const
{
return
alias_
;
}
void
setAlias
(
const
std
::
string
&
alias
)
{
alias_
=
alias
;
}
/**
* Accessor to data structures
* @return std::vector<std::string>& The list that reflects the user's choice
*/
std
::
vector
<
std
::
string
>
getActiveVideoCodecs
()
const
{
return
videoCodecList_
;
}
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>
>
getAllVideoCodecs
()
const
;
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>
>
getActiveVideoCodecs
()
const
;
/* Accessor to data structures
* @return CodecOrder& The list that reflects the user's choice
...
...
@@ -249,7 +152,7 @@ class Account : public Serializable {
* SDP offer and configuration respectively
*/
void
setActiveAudioCodecs
(
const
std
::
vector
<
std
::
string
>&
list
);
void
set
Active
VideoCodecs
(
const
std
::
vector
<
std
::
string
>&
list
);
void
setVideoCodecs
(
const
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>
>
&
codecs
);
std
::
string
getRingtonePath
()
const
{
return
ringtonePath_
;
...
...
@@ -280,6 +183,9 @@ class Account : public Serializable {
mailBox_
=
mb
;
}
static
const
char
*
const
VIDEO_CODEC_ENABLED
;
static
const
char
*
const
VIDEO_CODEC_NAME
;
static
const
char
*
const
VIDEO_CODEC_BITRATE
;
private:
NON_COPYABLE
(
Account
);
...
...
@@ -289,6 +195,23 @@ class Account : public Serializable {
void
loadDefaultCodecs
();
protected:
friend
class
ConfigurationTest
;
// General configuration keys for accounts
static
const
char
*
const
AUDIO_CODECS_KEY
;
static
const
char
*
const
VIDEO_CODECS_KEY
;
static
const
char
*
const
RINGTONE_PATH_KEY
;
static
const
char
*
const
RINGTONE_ENABLED_KEY
;
static
const
char
*
const
DISPLAY_NAME_KEY
;
static
const
char
*
const
ALIAS_KEY
;
static
const
char
*
const
TYPE_KEY
;
static
const
char
*
const
ID_KEY
;
static
const
char
*
const
USERNAME_KEY
;
static
const
char
*
const
AUTHENTICATION_USERNAME_KEY
;
static
const
char
*
const
PASSWORD_KEY
;
static
const
char
*
const
HOSTNAME_KEY
;
static
const
char
*
const
ACCOUNT_ENABLE_KEY
;
static
const
char
*
const
MAILBOX_KEY
;
static
std
::
string
mapStateNumberToString
(
RegistrationState
state
);
/**
...
...
@@ -336,9 +259,9 @@ class Account : public Serializable {
std
::
vector
<
int
>
audioCodecList_
;
/**
* Vector containing the
order of the
video codecs
* Vector containing the video codecs
in order
*/
std
::
vector
<
std
::
string
>
videoCodecList_
;
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>
>
videoCodecList_
;
/**
* List of audio codecs obtained when parsing configuration and used
...
...
@@ -346,12 +269,6 @@ class Account : public Serializable {
*/
std
::
string
audioCodecStr_
;
/**
* List of video codecs obtained when parsing configuration and used
* to generate codec order list
*/
std
::
string
videoCodecStr_
;
/**
* Ringtone .au file used for this account
*/
...
...
daemon/src/account_schema.h
0 → 100644
View file @
10319d91
/*
* Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010, 2011 Savoir-Faire Linux Inc.
* Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
* Author: Yan Morin <yan.morin@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#ifndef ACCOUNT_SCHEMA_H
#define ACCOUNT_SCHEMA_H_
/**
* @file account_schema.h
* @brief Account specfic keys/constants that must be shared in daemon and clients.
*/
// Account identifier
static
const
char
*
const
CONFIG_ACCOUNT_ID
=
"Account.id"
;
// Common account parameters
static
const
char
*
const
CONFIG_ACCOUNT_TYPE
=
"Account.type"
;
static
const
char
*
const
CONFIG_ACCOUNT_ALIAS
=
"Account.alias"
;
static
const
char
*
const
CONFIG_ACCOUNT_MAILBOX
=
"Account.mailbox"
;
static
const
char
*
const
CONFIG_ACCOUNT_ENABLE
=
"Account.enable"
;
static
const
char
*
const
CONFIG_ACCOUNT_REGISTRATION_EXPIRE
=
"Account.registrationExpire"
;
static
const
char
*
const
CONFIG_ACCOUNT_REGISTRATION_STATUS
=
"Account.registrationStatus"
;
static
const
char
*
const
CONFIG_ACCOUNT_REGISTRATION_STATE_CODE
=
"Account.registrationCode"
;
static
const
char
*
const
CONFIG_ACCOUNT_REGISTRATION_STATE_DESC
=
"Account.registrationDescription"
;
static
const
char
*
const
CONFIG_CREDENTIAL_NUMBER
=
"Credential.count"
;
static
const
char
*
const
CONFIG_ACCOUNT_DTMF_TYPE
=
"Account.dtmfType"
;
static
const
char
*
const
CONFIG_RINGTONE_PATH
=
"Account.ringtonePath"
;
static
const
char
*
const
CONFIG_RINGTONE_ENABLED
=
"Account.ringtoneEnabled"
;
static
const
char
*
const
CONFIG_KEEP_ALIVE_ENABLED
=
"Account.keepAliveEnabled"
;
static
const
char
*
const
CONFIG_ACCOUNT_HOSTNAME
=
"Account.hostname"
;
static
const
char
*
const
CONFIG_ACCOUNT_USERNAME
=
"Account.username"
;
static
const
char
*
const
CONFIG_ACCOUNT_ROUTESET
=
"Account.routeset"
;
static
const
char
*
const
CONFIG_ACCOUNT_PASSWORD
=
"Account.password"
;
static
const
char
*
const
CONFIG_ACCOUNT_REALM
=
"Account.realm"
;
static
const
char
*
const
CONFIG_ACCOUNT_DEFAULT_REALM
=
"*"
;
static
const
char
*
const
CONFIG_ACCOUNT_USERAGENT
=
"Account.useragent"
;
static
const
char
*
const
CONFIG_LOCAL_INTERFACE
=
"Account.localInterface"
;
static
const
char
*
const
CONFIG_PUBLISHED_SAMEAS_LOCAL
=
"Account.publishedSameAsLocal"
;
static
const
char
*
const
CONFIG_LOCAL_PORT
=
"Account.localPort"
;
static
const
char
*
const
CONFIG_PUBLISHED_PORT
=
"Account.publishedPort"
;
static
const
char
*
const
CONFIG_PUBLISHED_ADDRESS
=
"Account.publishedAddress"
;
static
const
char
*
const
CONFIG_DISPLAY_NAME
=
"Account.displayName"
;
static
const
char
*
const
CONFIG_DEFAULT_ADDRESS
=
"0.0.0.0"
;
// SIP specific parameters
static
const
char
*
const
CONFIG_SIP_PROXY
=
"SIP.proxy"
;
static
const
char
*
const
CONFIG_STUN_SERVER
=
"STUN.server"
;
static
const
char
*
const
CONFIG_STUN_ENABLE
=
"STUN.enable"
;
// SRTP specific parameters
static
const
char
*
const
CONFIG_SRTP_ENABLE
=
"SRTP.enable"
;
static
const
char
*
const
CONFIG_SRTP_KEY_EXCHANGE
=
"SRTP.keyExchange"
;
static
const
char
*
const
CONFIG_SRTP_ENCRYPTION_ALGO
=
"SRTP.encryptionAlgorithm"
;
// Provided by ccRTP,0=NULL,1=AESCM,2=AESF8
static
const
char
*
const
CONFIG_SRTP_RTP_FALLBACK
=
"SRTP.rtpFallback"
;
static
const
char
*
const
CONFIG_ZRTP_HELLO_HASH
=
"ZRTP.helloHashEnable"
;
static
const
char
*
const
CONFIG_ZRTP_DISPLAY_SAS
=
"ZRTP.displaySAS"
;
static
const
char
*
const
CONFIG_ZRTP_NOT_SUPP_WARNING
=
"ZRTP.notSuppWarning"
;
static
const
char
*
const
CONFIG_ZRTP_DISPLAY_SAS_ONCE
=
"ZRTP.displaySasOnce"
;
static
const
char
*
const
CONFIG_TLS_LISTENER_PORT
=
"TLS.listenerPort"
;
static
const
char
*
const
CONFIG_TLS_ENABLE
=
"TLS.enable"
;
static
const
char
*
const
CONFIG_TLS_CA_LIST_FILE
=
"TLS.certificateListFile"
;
static
const
char
*
const
CONFIG_TLS_CERTIFICATE_FILE
=
"TLS.certificateFile"
;
static
const
char
*
const
CONFIG_TLS_PRIVATE_KEY_FILE
=
"TLS.privateKeyFile"
;
static
const
char
*
const
CONFIG_TLS_PASSWORD
=
"TLS.password"
;
static
const
char
*
const
CONFIG_TLS_METHOD
=
"TLS.method"
;
static
const
char
*
const
CONFIG_TLS_CIPHERS
=
"TLS.ciphers"
;
static
const
char
*
const
CONFIG_TLS_SERVER_NAME
=
"TLS.serverName"
;
static
const
char
*
const
CONFIG_TLS_VERIFY_SERVER
=
"TLS.verifyServer"
;
static
const
char
*
const
CONFIG_TLS_VERIFY_CLIENT
=
"TLS.verifyClient"
;
static
const
char
*
const
CONFIG_TLS_REQUIRE_CLIENT_CERTIFICATE
=
"TLS.requireClientCertificate"
;
static
const
char
*
const
CONFIG_TLS_NEGOTIATION_TIMEOUT_SEC
=
"TLS.negotiationTimeoutSec"
;
static
const
char
*
const
CONFIG_TLS_NEGOTIATION_TIMEOUT_MSEC
=
"TLS.negotiationTimemoutMsec"
;
#endif
daemon/src/audio/mainbuffer.cpp
View file @
10319d91
...
...
@@ -383,10 +383,10 @@ void MainBuffer::flushAllBuffers()
iter
->
second
->
flushAll
();
}
void
MainBuffer
::
state
Info
()
void
MainBuffer
::
dump
Info
()
const
{
// print each call and bound call ids
for
(
CallIDMap
::
iterator
iter_call
=
callIDMap_
.
begin
();
iter_call
!=
callIDMap_
.
end
();
++
iter_call
)
{
for
(
CallIDMap
::
const_
iterator
iter_call
=
callIDMap_
.
begin
();
iter_call
!=
callIDMap_
.
end
();
++
iter_call
)
{
std
::
string
dbg_str
(
" Call:
\t
"
);
dbg_str
.
append
(
iter_call
->
first
);
dbg_str
.
append
(
" is bound to:
\t
"
);
...
...
@@ -402,7 +402,7 @@ void MainBuffer::stateInfo()
}
// Print ringbuffers ids and readpointers
for
(
RingBufferMap
::
iterator
iter_buffer
=
ringBufferMap_
.
begin
();
iter_buffer
!=
ringBufferMap_
.
end
();
++
iter_buffer
)
{
for
(
RingBufferMap
::
const_
iterator
iter_buffer
=
ringBufferMap_
.
begin
();
iter_buffer
!=
ringBufferMap_
.
end
();
++
iter_buffer
)
{
std
::
string
dbg_str
(
" Buffer:
\t
"
);
dbg_str
.
append
(
iter_buffer
->
first
);
...
...
daemon/src/audio/mainbuffer.h
View file @
10319d91
...
...
@@ -94,7 +94,7 @@ class MainBuffer {
void
flushAllBuffers
();
void
state
Info
();
void
dump
Info
()
const
;
private:
...
...
daemon/src/audio/pulseaudio/audiostream.cpp
View file @
10319d91
...
...
@@ -33,7 +33,12 @@
#include
"logger.h"
#include
<stdexcept>
AudioStream
::
AudioStream
(
pa_context
*
c
,
pa_threaded_mainloop
*
m
,
const
char
*
desc
,
int
type
,
unsigned
samplrate
,
std
::
string
&
deviceName
)
AudioStream
::
AudioStream
(
pa_context
*
c
,
pa_threaded_mainloop
*
m
,
const
char
*
desc
,
int
type
,
unsigned
samplrate
,
const
std
::
string
&
deviceName
)
:
audiostream_
(
0
),
mainloop_
(
m
)