32
32
#define __PREFERENCE_H__
34
34
#include "config/serializable.h"
36
// general preferences
37
static const char * const orderKey = "order";
38
static const char * const audioApiKey = "audioApi";
39
static const char * const historyLimitKey = "historyLimit";
40
static const char * const historyMaxCallsKey = "historyMaxCalls";
41
static const char * const notifyMailsKey = "notifyMails";
42
static const char * const zoneToneChoiceKey = "zoneToneChoice";
43
static const char * const registrationExpireKey = "registrationExpire";
44
static const char * const portNumKey = "portNum";
45
static const char * const searchBarDisplayKey = "searchBarDisplay";
46
static const char * const zeroConfenableKey = "zeroConfenable";
47
static const char * const md5HashKey = "md5Hash";
50
static const char * const playDtmfKey = "playDtmf";
51
static const char * const playTonesKey = "playTones";
52
static const char * const pulseLengthKey = "pulseLength";
53
static const char * const symmetricRtpKey = "symmetric";
54
static const char * const zidFileKey = "zidFile";
56
// addressbook preferences
57
static const char * const photoKey = "photo";
58
static const char * const enabledKey = "enabled";
59
static const char * const listKey = "list";
60
static const char * const maxResultsKey = "maxResults";
61
static const char * const businessKey = "business";
62
static const char * const homeKey = "home";
63
static const char * const mobileKey = "mobile";
66
static const char * const iax2EnabledKey = "iax2Enabled";
67
static const char * const numberAddPrefixKey = "numberAddPrefix";
68
static const char * const numberEnabledKey = "numberEnabled";
69
static const char * const sipEnabledKey = "sipEnabled";
70
static const char * const urlCommandKey = "urlCommand";
71
static const char * const urlSipFieldKey = "urlSipField";
74
static const char * const alsamapKey = "alsa";
75
static const char * const pulsemapKey = "pulse";
76
static const char * const cardinKey = "cardIn";
77
static const char * const cardoutKey = "cardOut";
78
static const char * const cardringKey = "cardRing";
79
static const char * const pluginKey = "plugin";
80
static const char * const smplrateKey = "smplRate";
81
static const char * const devicePlaybackKey = "devicePlayback";
82
static const char * const deviceRecordKey = "deviceRecord";
83
static const char * const deviceRingtoneKey = "deviceRingtone";
84
static const char * const recordpathKey = "recordPath";
85
static const char * const alwaysRecordingKey = "alwaysRecording";
86
static const char * const volumemicKey = "volumeMic";
87
static const char * const volumespkrKey = "volumeSpkr";
88
static const char * const noiseReduceKey = "noiseReduce";
89
static const char * const echoCancelKey = "echoCancel";
90
static const char * const echoTailKey = "echoTailLength";
91
static const char * const echoDelayKey = "echoDelayLength";
93
// shortcut preferences
94
static const char * const hangupShortKey = "hangUp";
95
static const char * const pickupShortKey = "pickUp";
96
static const char * const popupShortKey = "popupWindow";
97
static const char * const toggleHoldShortKey = "toggleHold";
98
static const char * const togglePickupHangupShortKey = "togglePickupHangup";
102
40
class Preferences : public Serializable {
104
42
static const char * const DFT_ZONE;
43
static const char * const REGISTRATION_EXPIRE_KEY;
108
virtual void serialize(Conf::YamlEmitter *emitter);
110
virtual void unserialize(Conf::MappingNode *map);
47
virtual void serialize(Conf::YamlEmitter &emitter);
48
virtual void unserialize(const Conf::MappingNode &map);
112
50
std::string getAccountOrder() const {
113
51
return accountOrder_;
333
270
class HookPreference : public Serializable {
335
272
HookPreference();
337
virtual void serialize(Conf::YamlEmitter *emitter);
339
virtual void unserialize(Conf::MappingNode *map);
341
bool getIax2Enabled() const {
345
void setIax2Enabled(bool i) {
273
HookPreference(const std::map<std::string, std::string> &settings);
275
virtual void serialize(Conf::YamlEmitter &emitter);
276
virtual void unserialize(const Conf::MappingNode &map);
349
278
std::string getNumberAddPrefix() const {
350
return numberAddPrefix_;
353
void setNumberAddPrefix(const std::string &n) {
354
numberAddPrefix_ = n;
357
bool getNumberEnabled() const {
358
return numberEnabled_;
361
void setNumberEnabled(bool n) {
365
bool getSipEnabled() const {
369
void setSipEnabled(bool s) {
373
std::string getUrlCommand() const {
376
void setUrlCommand(const std::string &u) {
380
std::string getUrlSipField() const {
383
void setUrlSipField(const std::string &u) {
280
return numberAddPrefix_;
285
std::map<std::string, std::string> toMap() const;
286
void runHook(pjsip_msg *msg);
388
289
bool iax2Enabled_;