Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
savoirfairelinux
jami-daemon
Commits
01ac3ab6
Commit
01ac3ab6
authored
Apr 09, 2012
by
Tristan Matthews
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* #9731: use all caps for application-wide constants
parent
cce04807
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
439 additions
and
427 deletions
+439
-427
daemon/src/account.h
daemon/src/account.h
+14
-14
daemon/src/audio/pulseaudio/pulselayer.cpp
daemon/src/audio/pulseaudio/pulselayer.cpp
+4
-9
daemon/src/global.h
daemon/src/global.h
+2
-2
daemon/src/iax/iaxaccount.cpp
daemon/src/iax/iaxaccount.cpp
+20
-20
daemon/src/preferences.cpp
daemon/src/preferences.cpp
+114
-114
daemon/src/preferences.h
daemon/src/preferences.h
+52
-52
daemon/src/sip/sipaccount.cpp
daemon/src/sip/sipaccount.cpp
+95
-95
daemon/src/sip/sipaccount.h
daemon/src/sip/sipaccount.h
+35
-36
daemon/test/Makefile.am
daemon/test/Makefile.am
+2
-1
daemon/test/audiolayertest.cpp
daemon/test/audiolayertest.cpp
+4
-3
daemon/test/configurationtest.cpp
daemon/test/configurationtest.cpp
+57
-61
daemon/test/configurationtest.h
daemon/test/configurationtest.h
+3
-20
daemon/test/test_utils.h
daemon/test/test_utils.h
+37
-0
No files found.
daemon/src/account.h
View file @
01ac3ab6
...
...
@@ -129,20 +129,20 @@ static const char *const CONFIG_REGISTRATION_STATE_CODE = "Registrat
static
const
char
*
const
CONFIG_REGISTRATION_STATE_DESCRIPTION
=
"Registration.description"
;
// General configuration keys for accounts
static
const
char
*
const
aliasKey
=
"alias"
;
static
const
char
*
const
typeKey
=
"type"
;
static
const
char
*
const
idKey
=
"id"
;
static
const
char
*
const
usernameKey
=
"username"
;
static
const
char
*
const
authenticationUsernameKey
=
"authenticationUsername"
;
static
const
char
*
const
passwordKey
=
"password"
;
static
const
char
*
const
hostnameKey
=
"hostname"
;
static
const
char
*
const
accountEnableKey
=
"enable"
;
static
const
char
*
const
mailboxKey
=
"mailbox"
;
static
const
char
*
const
codecsKey
=
"codecs"
;
// 0/9/110/111/112/
static
const
char
*
const
ringtonePathKey
=
"ringtonePath"
;
static
const
char
*
const
ringtoneEnabledKey
=
"ringtoneEnabled"
;
static
const
char
*
const
displayNameKey
=
"displayName"
;
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
CODECS_KEY
=
"codecs"
;
// 0/9/110/111/112/
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
{
...
...
daemon/src/audio/pulseaudio/pulselayer.cpp
View file @
01ac3ab6
...
...
@@ -31,6 +31,7 @@
#include <algorithm> // for std::find
#include <stdexcept>
#include <cassert>
#include "audiostream.h"
#include "pulselayer.h"
#include "audio/samplerateconverter.h"
...
...
@@ -39,24 +40,18 @@
namespace
{
void
playback_callback
(
pa_stream
*
s
,
size_t
bytes
,
void
*
userdata
)
void
playback_callback
(
pa_stream
*
/*s*/
,
size_t
/*
bytes
*/
,
void
*
userdata
)
{
assert
(
s
&&
bytes
);
assert
(
bytes
>
0
);
static_cast
<
PulseLayer
*>
(
userdata
)
->
writeToSpeaker
();
}
void
capture_callback
(
pa_stream
*
s
,
size_t
bytes
,
void
*
userdata
)
void
capture_callback
(
pa_stream
*
/*s*/
,
size_t
/*
bytes
*/
,
void
*
userdata
)
{
assert
(
s
&&
bytes
);
assert
(
bytes
>
0
);
static_cast
<
PulseLayer
*>
(
userdata
)
->
readFromMic
();
}
void
ringtone_callback
(
pa_stream
*
s
,
size_t
bytes
,
void
*
userdata
)
void
ringtone_callback
(
pa_stream
*
/*s*/
,
size_t
/*
bytes
*/
,
void
*
userdata
)
{
assert
(
s
&&
bytes
);
assert
(
bytes
>
0
);
static_cast
<
PulseLayer
*>
(
userdata
)
->
ringtoneToSpeaker
();
}
...
...
daemon/src/global.h
View file @
01ac3ab6
...
...
@@ -57,9 +57,9 @@ typedef signed int SINT32;
typedef
short
SFLDataFormat
;
#define SIZEBUF 400000
/** About 12 sec of buffering at 8000 Hz*/
#define SIZEBUF 400000
/** About 12 sec of buffering at 8000 Hz*/
#define ALSA_DFT_CARD_ID
0
/** Index of the default soundcard */
#define ALSA_DFT_CARD_ID
0
/** Index of the default soundcard */
#define PCM_PLUGHW "plughw"
/** Alsa plugin */
#define PCM_DEFAULT "default"
/** Default ALSA plugin */
...
...
daemon/src/iax/iaxaccount.cpp
View file @
01ac3ab6
...
...
@@ -71,17 +71,17 @@ void IAXAccount::serialize(Conf::YamlEmitter *emitter)
Conf
::
ScalarNode
codecs
(
codecStr_
);
Conf
::
ScalarNode
displayName
(
displayName_
);
accountmap
.
setKeyValue
(
aliasKey
,
&
alias
);
accountmap
.
setKeyValue
(
typeKey
,
&
type
);
accountmap
.
setKeyValue
(
idKey
,
&
id
);
accountmap
.
setKeyValue
(
usernameKey
,
&
username
);
accountmap
.
setKeyValue
(
passwordKey
,
&
password
);
accountmap
.
setKeyValue
(
hostnameKey
,
&
hostname
);
accountmap
.
setKeyValue
(
accountEnableKey
,
&
enable
);
accountmap
.
setKeyValue
(
mailboxKey
,
&
mailbox
);
accountmap
.
setKeyValue
(
displayNameKey
,
&
displayName
);
accountmap
.
setKeyValue
(
codecsKey
,
&
codecs
);
accountmap
.
setKeyValue
(
ALIAS_KEY
,
&
alias
);
accountmap
.
setKeyValue
(
TYPE_KEY
,
&
type
);
accountmap
.
setKeyValue
(
ID_KEY
,
&
id
);
accountmap
.
setKeyValue
(
USERNAME_KEY
,
&
username
);
accountmap
.
setKeyValue
(
PASSWORD_KEY
,
&
password
);
accountmap
.
setKeyValue
(
HOSTNAME_KEY
,
&
hostname
);
accountmap
.
setKeyValue
(
ACCOUNT_ENABLE_KEY
,
&
enable
);
accountmap
.
setKeyValue
(
MAILBOX_KEY
,
&
mailbox
);
accountmap
.
setKeyValue
(
DISPLAY_NAME_KEY
,
&
displayName
);
accountmap
.
setKeyValue
(
CODECS_KEY
,
&
codecs
);
try
{
emitter
->
serializeAccount
(
&
accountmap
);
...
...
@@ -97,18 +97,18 @@ void IAXAccount::unserialize(const Conf::MappingNode *map)
return
;
}
map
->
getValue
(
aliasKey
,
&
alias_
);
map
->
getValue
(
typeKey
,
&
type_
);
map
->
getValue
(
usernameKey
,
&
username_
);
map
->
getValue
(
passwordKey
,
&
password_
);
map
->
getValue
(
hostnameKey
,
&
hostname_
);
map
->
getValue
(
accountEnableKey
,
&
enabled_
);
map
->
getValue
(
mailboxKey
,
&
mailBox_
);
map
->
getValue
(
codecsKey
,
&
codecStr_
);
map
->
getValue
(
ALIAS_KEY
,
&
alias_
);
map
->
getValue
(
TYPE_KEY
,
&
type_
);
map
->
getValue
(
USERNAME_KEY
,
&
username_
);
map
->
getValue
(
PASSWORD_KEY
,
&
password_
);
map
->
getValue
(
HOSTNAME_KEY
,
&
hostname_
);
map
->
getValue
(
ACCOUNT_ENABLE_KEY
,
&
enabled_
);
map
->
getValue
(
MAILBOX_KEY
,
&
mailBox_
);
map
->
getValue
(
CODECS_KEY
,
&
codecStr_
);
// Update codec list which one is used for SDP offer
setActiveCodecs
(
ManagerImpl
::
unserialize
(
codecStr_
));
map
->
getValue
(
displayNameKey
,
&
displayName_
);
map
->
getValue
(
DISPLAY_NAME_KEY
,
&
displayName_
);
}
void
IAXAccount
::
setAccountDetails
(
std
::
map
<
std
::
string
,
std
::
string
>
details
)
...
...
daemon/src/preferences.cpp
View file @
01ac3ab6
...
...
@@ -84,16 +84,16 @@ void Preferences::serialize(Conf::YamlEmitter *emiter)
Conf
::
ScalarNode
zeroConfenable
(
zeroConfenable_
);
Conf
::
ScalarNode
md5Hash
(
md5Hash_
);
preferencemap
.
setKeyValue
(
orderKey
,
&
order
);
preferencemap
.
setKeyValue
(
historyLimitKey
,
&
historyLimit
);
preferencemap
.
setKeyValue
(
historyMaxCallsKey
,
&
historyMaxCalls
);
preferencemap
.
setKeyValue
(
notifyMailsKey
,
&
notifyMails
);
preferencemap
.
setKeyValue
(
zoneToneChoiceKey
,
&
zoneToneChoice
);
preferencemap
.
setKeyValue
(
registrationExpireKey
,
&
registrationExpire
);
preferencemap
.
setKeyValue
(
portNumKey
,
&
portNum
);
preferencemap
.
setKeyValue
(
searchBarDisplayKey
,
&
searchBarDisplay
);
preferencemap
.
setKeyValue
(
zeroConfenableKey
,
&
zeroConfenable
);
preferencemap
.
setKeyValue
(
md5HashKey
,
&
md5Hash
);
preferencemap
.
setKeyValue
(
ORDER_KEY
,
&
order
);
preferencemap
.
setKeyValue
(
HISTORY_LIMIT_KEY
,
&
historyLimit
);
preferencemap
.
setKeyValue
(
HISTORY_MAX_CALLS_KEY
,
&
historyMaxCalls
);
preferencemap
.
setKeyValue
(
NOTIFY_MAILS_KEY
,
&
notifyMails
);
preferencemap
.
setKeyValue
(
ZONE_TONE_CHOICE_KEY
,
&
zoneToneChoice
);
preferencemap
.
setKeyValue
(
REGISTRATION_EXPIRE_KEY
,
&
registrationExpire
);
preferencemap
.
setKeyValue
(
PORT_NUM_KEY
,
&
portNum
);
preferencemap
.
setKeyValue
(
SEARCH_BAR_DISPLAY_KEY
,
&
searchBarDisplay
);
preferencemap
.
setKeyValue
(
ZEROCONF_ENABLE_KEY
,
&
zeroConfenable
);
preferencemap
.
setKeyValue
(
MD5_HASH_KEY
,
&
md5Hash
);
emiter
->
serializePreference
(
&
preferencemap
);
}
...
...
@@ -105,16 +105,16 @@ void Preferences::unserialize(const Conf::MappingNode *map)
return
;
}
map
->
getValue
(
orderKey
,
&
accountOrder_
);
map
->
getValue
(
historyLimitKey
,
&
historyLimit_
);
map
->
getValue
(
historyMaxCallsKey
,
&
historyMaxCalls_
);
map
->
getValue
(
notifyMailsKey
,
&
notifyMails_
);
map
->
getValue
(
zoneToneChoiceKey
,
&
zoneToneChoice_
);
map
->
getValue
(
registrationExpireKey
,
&
registrationExpire_
);
map
->
getValue
(
portNumKey
,
&
portNum_
);
map
->
getValue
(
searchBarDisplayKey
,
&
searchBarDisplay_
);
map
->
getValue
(
zeroConfenableKey
,
&
zeroConfenable_
);
map
->
getValue
(
md5HashKey
,
&
md5Hash_
);
map
->
getValue
(
ORDER_KEY
,
&
accountOrder_
);
map
->
getValue
(
HISTORY_LIMIT_KEY
,
&
historyLimit_
);
map
->
getValue
(
HISTORY_MAX_CALLS_KEY
,
&
historyMaxCalls_
);
map
->
getValue
(
NOTIFY_MAILS_KEY
,
&
notifyMails_
);
map
->
getValue
(
ZONE_TONE_CHOICE_KEY
,
&
zoneToneChoice_
);
map
->
getValue
(
REGISTRATION_EXPIRE_KEY
,
&
registrationExpire_
);
map
->
getValue
(
PORT_NUM_KEY
,
&
portNum_
);
map
->
getValue
(
SEARCH_BAR_DISPLAY_KEY
,
&
searchBarDisplay_
);
map
->
getValue
(
ZEROCONF_ENABLE_KEY
,
&
zeroConfenable_
);
map
->
getValue
(
MD5_HASH_KEY
,
&
md5Hash_
);
}
VoipPreference
::
VoipPreference
()
:
playDtmf_
(
true
)
...
...
@@ -136,11 +136,11 @@ void VoipPreference::serialize(Conf::YamlEmitter *emitter)
Conf
::
ScalarNode
symmetricRtp
(
symmetricRtp_
);
Conf
::
ScalarNode
zidFile
(
zidFile_
.
c_str
());
preferencemap
.
setKeyValue
(
playDtmfKey
,
&
playDtmf
);
preferencemap
.
setKeyValue
(
playTonesKey
,
&
playTones
);
preferencemap
.
setKeyValue
(
pulseLengthKey
,
&
pulseLength
);
preferencemap
.
setKeyValue
(
symmetricRtpKey
,
&
symmetricRtp
);
preferencemap
.
setKeyValue
(
zidFileKey
,
&
zidFile
);
preferencemap
.
setKeyValue
(
PLAY_DTMF_KEY
,
&
playDtmf
);
preferencemap
.
setKeyValue
(
PLAY_TONES_KEY
,
&
playTones
);
preferencemap
.
setKeyValue
(
PULSE_LENGTH_KEY
,
&
pulseLength
);
preferencemap
.
setKeyValue
(
SYMMETRIC_RTP_KEY
,
&
symmetricRtp
);
preferencemap
.
setKeyValue
(
ZID_FILE_KEY
,
&
zidFile
);
emitter
->
serializeVoipPreference
(
&
preferencemap
);
}
...
...
@@ -152,11 +152,11 @@ void VoipPreference::unserialize(const Conf::MappingNode *map)
return
;
}
map
->
getValue
(
playDtmfKey
,
&
playDtmf_
);
map
->
getValue
(
playTonesKey
,
&
playTones_
);
map
->
getValue
(
pulseLengthKey
,
&
pulseLength_
);
map
->
getValue
(
symmetricRtpKey
,
&
symmetricRtp_
);
map
->
getValue
(
zidFileKey
,
&
zidFile_
);
map
->
getValue
(
PLAY_DTMF_KEY
,
&
playDtmf_
);
map
->
getValue
(
PLAY_TONES_KEY
,
&
playTones_
);
map
->
getValue
(
PULSE_LENGTH_KEY
,
&
pulseLength_
);
map
->
getValue
(
SYMMETRIC_RTP_KEY
,
&
symmetricRtp_
);
map
->
getValue
(
ZID_FILE_KEY
,
&
zidFile_
);
}
AddressbookPreference
::
AddressbookPreference
()
:
photo_
(
true
)
...
...
@@ -182,13 +182,13 @@ void AddressbookPreference::serialize(Conf::YamlEmitter *emitter)
Conf
::
ScalarNode
home
(
home_
);
Conf
::
ScalarNode
mobile
(
mobile_
);
preferencemap
.
setKeyValue
(
photoKey
,
&
photo
);
preferencemap
.
setKeyValue
(
enabledKey
,
&
enabled
);
preferencemap
.
setKeyValue
(
listKey
,
&
list
);
preferencemap
.
setKeyValue
(
maxResultsKey
,
&
maxResults
);
preferencemap
.
setKeyValue
(
businessKey
,
&
business
);
preferencemap
.
setKeyValue
(
homeKey
,
&
home
);
preferencemap
.
setKeyValue
(
mobileKey
,
&
mobile
);
preferencemap
.
setKeyValue
(
PHOTO_KEY
,
&
photo
);
preferencemap
.
setKeyValue
(
ENABLED_KEY
,
&
enabled
);
preferencemap
.
setKeyValue
(
LIST_KEY
,
&
list
);
preferencemap
.
setKeyValue
(
MAX_RESULTS_KEY
,
&
maxResults
);
preferencemap
.
setKeyValue
(
BUSINESS_KEY
,
&
business
);
preferencemap
.
setKeyValue
(
HOME_KEY
,
&
home
);
preferencemap
.
setKeyValue
(
MOBILE_KEY
,
&
mobile
);
emitter
->
serializeAddressbookPreference
(
&
preferencemap
);
...
...
@@ -201,13 +201,13 @@ void AddressbookPreference::unserialize(const Conf::MappingNode *map)
return
;
}
map
->
getValue
(
photoKey
,
&
photo_
);
map
->
getValue
(
enabledKey
,
&
enabled_
);
map
->
getValue
(
listKey
,
&
list_
);
map
->
getValue
(
maxResultsKey
,
&
maxResults_
);
map
->
getValue
(
businessKey
,
&
business_
);
map
->
getValue
(
homeKey
,
&
home_
);
map
->
getValue
(
mobileKey
,
&
mobile_
);
map
->
getValue
(
PHOTO_KEY
,
&
photo_
);
map
->
getValue
(
ENABLED_KEY
,
&
enabled_
);
map
->
getValue
(
LIST_KEY
,
&
list_
);
map
->
getValue
(
MAX_RESULTS_KEY
,
&
maxResults_
);
map
->
getValue
(
BUSINESS_KEY
,
&
business_
);
map
->
getValue
(
HOME_KEY
,
&
home_
);
map
->
getValue
(
MOBILE_KEY
,
&
mobile_
);
}
HookPreference
::
HookPreference
()
:
iax2Enabled_
(
false
)
...
...
@@ -251,12 +251,12 @@ void HookPreference::serialize(Conf::YamlEmitter *emitter)
Conf
::
ScalarNode
urlCommand
(
urlCommand_
);
Conf
::
ScalarNode
urlSipField
(
urlSipField_
);
preferencemap
.
setKeyValue
(
iax2EnabledKey
,
&
iax2Enabled
);
preferencemap
.
setKeyValue
(
numberAddPrefixKey
,
&
numberAddPrefix
);
preferencemap
.
setKeyValue
(
numberEnabledKey
,
&
numberEnabled
);
preferencemap
.
setKeyValue
(
sipEnabledKey
,
&
sipEnabled
);
preferencemap
.
setKeyValue
(
urlCommandKey
,
&
urlCommand
);
preferencemap
.
setKeyValue
(
urlSipFieldKey
,
&
urlSipField
);
preferencemap
.
setKeyValue
(
IAX2_ENABLED_KEY
,
&
iax2Enabled
);
preferencemap
.
setKeyValue
(
NUMBER_ADD_PREFIX_KEY
,
&
numberAddPrefix
);
preferencemap
.
setKeyValue
(
NUMBER_ENABLED_KEY
,
&
numberEnabled
);
preferencemap
.
setKeyValue
(
SIP_ENABLED_KEY
,
&
sipEnabled
);
preferencemap
.
setKeyValue
(
URL_COMMAND_KEY
,
&
urlCommand
);
preferencemap
.
setKeyValue
(
URL_SIP_FIELD_KEY
,
&
urlSipField
);
emitter
->
serializeHooksPreference
(
&
preferencemap
);
}
...
...
@@ -268,18 +268,18 @@ void HookPreference::unserialize(const Conf::MappingNode *map)
return
;
}
map
->
getValue
(
iax2EnabledKey
,
&
iax2Enabled_
);
map
->
getValue
(
numberAddPrefixKey
,
&
numberAddPrefix_
);
map
->
getValue
(
numberEnabledKey
,
&
numberEnabled_
);
map
->
getValue
(
sipEnabledKey
,
&
sipEnabled_
);
map
->
getValue
(
urlCommandKey
,
&
urlCommand_
);
map
->
getValue
(
urlSipFieldKey
,
&
urlSipField_
);
map
->
getValue
(
IAX2_ENABLED_KEY
,
&
iax2Enabled_
);
map
->
getValue
(
NUMBER_ADD_PREFIX_KEY
,
&
numberAddPrefix_
);
map
->
getValue
(
NUMBER_ENABLED_KEY
,
&
numberEnabled_
);
map
->
getValue
(
SIP_ENABLED_KEY
,
&
sipEnabled_
);
map
->
getValue
(
URL_COMMAND_KEY
,
&
urlCommand_
);
map
->
getValue
(
URL_SIP_FIELD_KEY
,
&
urlSipField_
);
}
void
HookPreference
::
runHook
(
pjsip_msg
*
msg
)
{
if
(
sipEnabled_
)
{
std
::
string
header
(
sip_utils
::
fetchHeaderValue
(
msg
,
urlSipField_
));
const
std
::
string
header
(
sip_utils
::
fetchHeaderValue
(
msg
,
urlSipField_
));
UrlHook
::
runAction
(
urlCommand_
,
header
);
}
}
...
...
@@ -383,28 +383,28 @@ void AudioPreference::serialize(Conf::YamlEmitter *emitter)
delaystr
<<
echoCancelDelay_
;
Conf
::
ScalarNode
echodelay
(
delaystr
.
str
());
preferencemap
.
setKeyValue
(
audioApiKey
,
&
audioapi
);
preferencemap
.
setKeyValue
(
recordpathKey
,
&
recordpath
);
preferencemap
.
setKeyValue
(
alwaysRecordingKey
,
&
alwaysRecording
);
preferencemap
.
setKeyValue
(
volumemicKey
,
&
volumemic
);
preferencemap
.
setKeyValue
(
volumespkrKey
,
&
volumespkr
);
preferencemap
.
setKeyValue
(
alsamapKey
,
&
alsapreferencemap
);
alsapreferencemap
.
setKeyValue
(
cardinKey
,
&
cardin
);
alsapreferencemap
.
setKeyValue
(
cardoutKey
,
&
cardout
);
alsapreferencemap
.
setKeyValue
(
cardringKey
,
&
cardring
);
alsapreferencemap
.
setKeyValue
(
pluginKey
,
&
plugin
);
alsapreferencemap
.
setKeyValue
(
smplrateKey
,
&
smplrate
);
preferencemap
.
setKeyValue
(
pulsemapKey
,
&
pulsepreferencemap
);
pulsepreferencemap
.
setKeyValue
(
devicePlaybackKey
,
&
devicePlayback
);
pulsepreferencemap
.
setKeyValue
(
deviceRecordKey
,
&
deviceRecord
);
pulsepreferencemap
.
setKeyValue
(
deviceRingtoneKey
,
&
deviceRingtone
);
preferencemap
.
setKeyValue
(
noiseReduceKey
,
&
noise
);
preferencemap
.
setKeyValue
(
echoCancelKey
,
&
echo
);
preferencemap
.
setKeyValue
(
echoTailKey
,
&
echotail
);
preferencemap
.
setKeyValue
(
echoDelayKey
,
&
echodelay
);
preferencemap
.
setKeyValue
(
AUDIO_API_KEY
,
&
audioapi
);
preferencemap
.
setKeyValue
(
RECORDPATH_KEY
,
&
recordpath
);
preferencemap
.
setKeyValue
(
ALWAYS_RECORDING_KEY
,
&
alwaysRecording
);
preferencemap
.
setKeyValue
(
VOLUMEMIC_KEY
,
&
volumemic
);
preferencemap
.
setKeyValue
(
VOLUMESPKR_KEY
,
&
volumespkr
);
preferencemap
.
setKeyValue
(
ALSAMAP_KEY
,
&
alsapreferencemap
);
alsapreferencemap
.
setKeyValue
(
CARDIN_KEY
,
&
cardin
);
alsapreferencemap
.
setKeyValue
(
CARDOUT_KEY
,
&
cardout
);
alsapreferencemap
.
setKeyValue
(
CARDRING_KEY
,
&
cardring
);
alsapreferencemap
.
setKeyValue
(
PLUGIN_KEY
,
&
plugin
);
alsapreferencemap
.
setKeyValue
(
SMPLRATE_KEY
,
&
smplrate
);
preferencemap
.
setKeyValue
(
PULSEMAP_KEY
,
&
pulsepreferencemap
);
pulsepreferencemap
.
setKeyValue
(
DEVICE_PLAYBACK_KEY
,
&
devicePlayback
);
pulsepreferencemap
.
setKeyValue
(
DEVICE_RECORD_KEY
,
&
deviceRecord
);
pulsepreferencemap
.
setKeyValue
(
DEVICE_RINGTONE_KEY
,
&
deviceRingtone
);
preferencemap
.
setKeyValue
(
NOISE_REDUCE_KEY
,
&
noise
);
preferencemap
.
setKeyValue
(
ECHO_CANCEL_KEY
,
&
echo
);
preferencemap
.
setKeyValue
(
ECHO_TAIL_KEY
,
&
echotail
);
preferencemap
.
setKeyValue
(
ECHO_DELAY_KEY
,
&
echodelay
);
emitter
->
serializeAudioPreference
(
&
preferencemap
);
}
...
...
@@ -413,30 +413,30 @@ void AudioPreference::unserialize(const Conf::MappingNode *map)
{
assert
(
map
);
map
->
getValue
(
audioApiKey
,
&
audioApi_
);
map
->
getValue
(
recordpathKey
,
&
recordpath_
);
map
->
getValue
(
alwaysRecordingKey
,
&
alwaysRecording_
);
map
->
getValue
(
volumemicKey
,
&
volumemic_
);
map
->
getValue
(
volumespkrKey
,
&
volumespkr_
);
map
->
getValue
(
noiseReduceKey
,
&
noisereduce_
);
map
->
getValue
(
echoCancelKey
,
&
echocancel_
);
map
->
getValue
(
AUDIO_API_KEY
,
&
audioApi_
);
map
->
getValue
(
RECORDPATH_KEY
,
&
recordpath_
);
map
->
getValue
(
ALWAYS_RECORDING_KEY
,
&
alwaysRecording_
);
map
->
getValue
(
VOLUMEMIC_KEY
,
&
volumemic_
);
map
->
getValue
(
VOLUMESPKR_KEY
,
&
volumespkr_
);
map
->
getValue
(
NOISE_REDUCE_KEY
,
&
noisereduce_
);
map
->
getValue
(
ECHO_CANCEL_KEY
,
&
echocancel_
);
Conf
::
MappingNode
*
alsamap
=
(
Conf
::
MappingNode
*
)(
map
->
getValue
(
"alsa"
));
if
(
alsamap
)
{
alsamap
->
getValue
(
cardinKey
,
&
cardin_
);
alsamap
->
getValue
(
cardoutKey
,
&
cardout_
);
alsamap
->
getValue
(
cardringKey
,
&
cardring_
);
alsamap
->
getValue
(
smplrateKey
,
&
smplrate_
);
alsamap
->
getValue
(
pluginKey
,
&
plugin_
);
alsamap
->
getValue
(
CARDIN_KEY
,
&
cardin_
);
alsamap
->
getValue
(
CARDOUT_KEY
,
&
cardout_
);
alsamap
->
getValue
(
CARDRING_KEY
,
&
cardring_
);
alsamap
->
getValue
(
SMPLRATE_KEY
,
&
smplrate_
);
alsamap
->
getValue
(
PLUGIN_KEY
,
&
plugin_
);
}
Conf
::
MappingNode
*
pulsemap
=
(
Conf
::
MappingNode
*
)(
map
->
getValue
(
"pulse"
));
if
(
pulsemap
)
{
pulsemap
->
getValue
(
devicePlaybackKey
,
&
devicePlayback_
);
pulsemap
->
getValue
(
deviceRecordKey
,
&
deviceRecord_
);
pulsemap
->
getValue
(
deviceRingtoneKey
,
&
deviceRingtone_
);
pulsemap
->
getValue
(
DEVICE_PLAYBACK_KEY
,
&
devicePlayback_
);
pulsemap
->
getValue
(
DEVICE_RECORD_KEY
,
&
deviceRecord_
);
pulsemap
->
getValue
(
DEVICE_RINGTONE_KEY
,
&
deviceRingtone_
);
}
}
...
...
@@ -447,11 +447,11 @@ std::map<std::string, std::string> ShortcutPreferences::getShortcuts() const
{
std
::
map
<
std
::
string
,
std
::
string
>
shortcutsMap
;
shortcutsMap
[
hangupShortKey
]
=
hangup_
;
shortcutsMap
[
pickupShortKey
]
=
pickup_
;
shortcutsMap
[
popupShortKey
]
=
popup_
;
shortcutsMap
[
toggleHoldShortKey
]
=
toggleHold_
;
shortcutsMap
[
togglePickupHangupShortKey
]
=
togglePickupHangup_
;
shortcutsMap
[
HANGUP_SHORT_KEY
]
=
hangup_
;
shortcutsMap
[
PICKUP_SHORT_KEY
]
=
pickup_
;
shortcutsMap
[
POPUP_SHORT_KEY
]
=
popup_
;
shortcutsMap
[
TOGGLE_HOLD_SHORT_KEY
]
=
toggleHold_
;
shortcutsMap
[
TOGGLE_PICKUP_HANGUP_SHORT_KEY
]
=
togglePickupHangup_
;
return
shortcutsMap
;
}
...
...
@@ -459,11 +459,11 @@ std::map<std::string, std::string> ShortcutPreferences::getShortcuts() const
void
ShortcutPreferences
::
setShortcuts
(
std
::
map
<
std
::
string
,
std
::
string
>
map
)
{
hangup_
=
map
[
hangupShortKey
];
pickup_
=
map
[
pickupShortKey
];
popup_
=
map
[
popupShortKey
];
toggleHold_
=
map
[
toggleHoldShortKey
];
togglePickupHangup_
=
map
[
togglePickupHangupShortKey
];
hangup_
=
map
[
HANGUP_SHORT_KEY
];
pickup_
=
map
[
PICKUP_SHORT_KEY
];
popup_
=
map
[
POPUP_SHORT_KEY
];
toggleHold_
=
map
[
TOGGLE_HOLD_SHORT_KEY
];
togglePickupHangup_
=
map
[
TOGGLE_PICKUP_HANGUP_SHORT_KEY
];
}
...
...
@@ -477,11 +477,11 @@ void ShortcutPreferences::serialize(Conf::YamlEmitter *emitter)
Conf
::
ScalarNode
toggleHold
(
toggleHold_
);
Conf
::
ScalarNode
togglePickupHangup
(
togglePickupHangup_
);
preferencemap
.
setKeyValue
(
hangupShortKey
,
&
hangup
);
preferencemap
.
setKeyValue
(
pickupShortKey
,
&
pickup
);
preferencemap
.
setKeyValue
(
popupShortKey
,
&
popup
);
preferencemap
.
setKeyValue
(
toggleHoldShortKey
,
&
toggleHold
);
preferencemap
.
setKeyValue
(
togglePickupHangupShortKey
,
&
togglePickupHangup
);
preferencemap
.
setKeyValue
(
HANGUP_SHORT_KEY
,
&
hangup
);
preferencemap
.
setKeyValue
(
PICKUP_SHORT_KEY
,
&
pickup
);
preferencemap
.
setKeyValue
(
POPUP_SHORT_KEY
,
&
popup
);
preferencemap
.
setKeyValue
(
TOGGLE_HOLD_SHORT_KEY
,
&
toggleHold
);
preferencemap
.
setKeyValue
(
TOGGLE_PICKUP_HANGUP_SHORT_KEY
,
&
togglePickupHangup
);
emitter
->
serializeShortcutPreference
(
&
preferencemap
);
}
...
...
@@ -493,10 +493,10 @@ void ShortcutPreferences::unserialize(const Conf::MappingNode *map)
return
;
}
map
->
getValue
(
hangupShortKey
,
&
hangup_
);
map
->
getValue
(
pickupShortKey
,
&
pickup_
);
map
->
getValue
(
popupShortKey
,
&
popup_
);
map
->
getValue
(
toggleHoldShortKey
,
&
toggleHold_
);
map
->
getValue
(
togglePickupHangupShortKey
,
&
togglePickupHangup_
);
map
->
getValue
(
HANGUP_SHORT_KEY
,
&
hangup_
);
map
->
getValue
(
PICKUP_SHORT_KEY
,
&
pickup_
);
map
->
getValue
(
POPUP_SHORT_KEY
,
&
popup_
);
map
->
getValue
(
TOGGLE_HOLD_SHORT_KEY
,
&
toggleHold_
);
map
->
getValue
(
TOGGLE_PICKUP_HANGUP_SHORT_KEY
,
&
togglePickupHangup_
);
}
daemon/src/preferences.h
View file @
01ac3ab6
...
...
@@ -36,68 +36,68 @@
#include <map>
// general preferences
static
const
char
*
const
orderKey
=
"order"
;
static
const
char
*
const
audioApiKey
=
"audioApi"
;
static
const
char
*
const
historyLimitKey
=
"historyLimit"
;
static
const
char
*
const
historyMaxCallsKey
=
"historyMaxCalls"
;
static
const
char
*
const
notifyMailsKey
=
"notifyMails"
;
static
const
char
*
const
zoneToneChoiceKey
=
"zoneToneChoice"
;
static
const
char
*
const
registrationExpireKey
=
"registrationexpire"
;
static
const
char
*
const
portNumKey
=
"portNum"
;
static
const
char
*
const
searchBarDisplayKey
=
"searchBarDisplay"
;
static
const
char
*
const
zeroConfenableKey
=
"zeroConfenable"
;
static
const
char
*
const
md5HashKey
=
"md5Hash"
;
static
const
char
*
const
ORDER_KEY
=
"order"
;
static
const
char
*
const
AUDIO_API_KEY
=
"audioApi"
;
static
const
char
*
const
HISTORY_LIMIT_KEY
=
"historyLimit"
;
static
const
char
*
const
HISTORY_MAX_CALLS_KEY
=
"historyMaxCalls"
;
static
const
char
*
const
NOTIFY_MAILS_KEY
=
"notifyMails"
;
static
const
char
*
const
ZONE_TONE_CHOICE_KEY
=
"zoneToneChoice"
;
static
const
char
*
const
REGISTRATION_EXPIRE_KEY
=
"registrationexpire"
;
static
const
char
*
const
PORT_NUM_KEY
=
"portNum"
;
static
const
char
*
const
SEARCH_BAR_DISPLAY_KEY
=
"searchBarDisplay"
;
static
const
char
*
const
ZEROCONF_ENABLE_KEY
=
"zeroConfenable"
;
static
const
char
*
const
MD5_HASH_KEY
=
"md5Hash"
;
// voip preferences
static
const
char
*
const
playDtmfKey
=
"playDtmf"
;
static
const
char
*
const
playTonesKey
=
"playTones"
;
static
const
char
*
const
pulseLengthKey
=
"pulseLength"
;
static
const
char
*
const
symmetricRtpKey
=
"symmetric"
;
static
const
char
*
const
zidFileKey
=
"zidFile"
;
static
const
char
*
const
PLAY_DTMF_KEY
=
"playDtmf"
;
static
const
char
*
const
PLAY_TONES_KEY
=
"playTones"
;
static
const
char
*
const
PULSE_LENGTH_KEY
=
"pulseLength"
;
static
const
char
*
const
SYMMETRIC_RTP_KEY
=
"symmetric"
;
static
const
char
*
const
ZID_FILE_KEY
=
"zidFile"
;
// addressbook preferences
static
const
char
*
const
photoKey
=
"photo"
;
static
const
char
*
const
enabledKey
=
"enabled"
;
static
const
char
*
const
listKey
=
"list"
;
static
const
char
*
const
maxResultsKey
=
"maxResults"
;
static
const
char
*
const
businessKey
=
"business"
;
static
const
char
*
const
homeKey
=
"home"
;
static
const
char
*
const
mobileKey
=
"mobile"
;
static
const
char
*
const
PHOTO_KEY
=
"photo"
;
static
const
char
*
const
ENABLED_KEY
=
"enabled"
;
static
const
char
*
const
LIST_KEY
=
"list"
;
static
const
char
*
const
MAX_RESULTS_KEY
=
"maxResults"
;
static
const
char
*
const
BUSINESS_KEY
=
"business"
;
static
const
char
*
const
HOME_KEY
=
"home"
;
static
const
char
*
const
MOBILE_KEY
=
"mobile"
;
// hooks preferences
static
const
char
*
const
iax2EnabledKey
=
"iax2Enabled"
;
static
const
char
*
const
numberAddPrefixKey
=
"numberAddPrefix"
;
static
const
char
*
const
numberEnabledKey
=
"numberEnabled"
;
static
const
char
*
const
sipEnabledKey
=
"sipEnabled"
;
static
const
char
*
const
urlCommandKey
=
"urlCommand"
;
static
const
char
*
const
urlSipFieldKey
=
"urlSipField"
;
static
const
char
*
const
IAX2_ENABLED_KEY
=
"iax2Enabled"
;
static
const
char
*
const
NUMBER_ADD_PREFIX_KEY
=
"numberAddPrefix"
;
static
const
char
*
const
NUMBER_ENABLED_KEY
=
"numberEnabled"
;
static
const
char
*
const
SIP_ENABLED_KEY
=
"sipEnabled"
;
static
const
char
*
const
URL_COMMAND_KEY
=
"urlCommand"
;
static
const
char
*
const
URL_SIP_FIELD_KEY
=
"urlSipField"
;
// audio preferences
static
const
char
*
const
alsamapKey
=
"alsa"
;
static
const
char
*
const
pulsemapKey
=
"pulse"
;
static
const
char
*
const
cardinKey
=
"cardIn"
;
static
const
char
*
const
cardoutKey
=
"cardOut"
;
static
const
char
*
const
cardringKey
=
"cardRing"
;
static
const
char
*
const
pluginKey
=
"plugin"
;
static
const
char
*
const
smplrateKey
=
"smplRate"
;
static
const
char
*
const
devicePlaybackKey
=
"devicePlayback"
;
static
const
char
*
const
deviceRecordKey
=
"deviceRecord"
;
static
const
char
*
const
deviceRingtoneKey
=
"deviceRingtone"
;
static
const
char
*
const
recordpathKey
=
"recordPath"
;
static
const
char
*
const
alwaysRecordingKey
=
"alwaysRecording"
;
static
const
char
*
const
volumemicKey
=
"volumeMic"
;
static
const
char
*
const
volumespkrKey
=
"volumeSpkr"
;
static
const
char
*
const
noiseReduceKey
=
"noiseReduce"
;
static
const
char
*
const
echoCancelKey
=
"echoCancel"
;
static
const
char
*
const
echoTailKey
=
"echoTailLength"
;
static
const
char
*
const
echoDelayKey
=
"echoDelayLength"
;
static
const
char
*
const
ALSAMAP_KEY
=
"alsa"
;
static
const
char
*
const
PULSEMAP_KEY
=
"pulse"
;
static
const
char
*
const
CARDIN_KEY
=
"cardIn"
;
static
const
char
*
const
CARDOUT_KEY
=
"cardOut"
;
static
const
char
*
const
CARDRING_KEY
=
"cardRing"
;
static
const
char
*
const
PLUGIN_KEY
=
"plugin"
;
static
const
char
*
const
SMPLRATE_KEY
=
"smplRate"
;
static
const
char
*
const
DEVICE_PLAYBACK_KEY
=
"devicePlayback"
;
static
const
char
*
const
DEVICE_RECORD_KEY
=
"deviceRecord"
;
static
const
char
*
const
DEVICE_RINGTONE_KEY
=
"deviceRingtone"
;
static
const
char
*
const
RECORDPATH_KEY
=
"recordPath"
;
static
const
char
*
const
ALWAYS_RECORDING_KEY
=
"alwaysRecording"
;
static
const
char
*
const
VOLUMEMIC_KEY
=
"volumeMic"
;
static
const
char
*
const
VOLUMESPKR_KEY
=
"volumeSpkr"
;
static
const
char
*
const
NOISE_REDUCE_KEY
=
"noiseReduce"
;
static
const
char
*
const
ECHO_CANCEL_KEY
=
"echoCancel"
;
static
const
char
*
const
ECHO_TAIL_KEY
=
"echoTailLength"
;
static
const
char
*
const
ECHO_DELAY_KEY
=
"echoDelayLength"
;