~noskcaj/ubuntu/saucy/sflphone/merge-1.2.3-2

« back to all changes in this revision

Viewing changes to daemon/src/account.h

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2012-05-19 21:46:37 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20120519214637-la8rbrford5kj6m3
Tags: 1.1.0-1
* New upstream release 
  - Fixes "FTBFS with libccrtp-dev/2.0.2 from experimental" (Closes: #663282)
* NEW Maintainer: Debian VoIP Team - Thanks Francois for your work.
  - (Closes: #665789: O: sflphone -- SIP and IAX2 compatible VoIP phone)
* Added Build-Depends: libdbus-c++-bin
* Add gcc47-fixes.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 
38
38
#include "global.h"
39
39
#include "noncopyable.h"
40
 
#include "config/config.h"
 
40
#include "config/sfl_config.h"
41
41
#include "config/serializable.h"
42
42
 
43
43
class VoIPLink;
59
59
    ErrorNetwork ,
60
60
    ErrorHost,
61
61
    ErrorExistStun,
62
 
    ErrorConfStun,
 
62
    ErrorNotAcceptable,
63
63
    NumberOfStates
64
64
};
65
65
 
66
66
// Account identifier
67
 
static const char *const ACCOUNT_ID                          = "Account.id";
 
67
static const char *const CONFIG_ACCOUNT_ID                   = "Account.id";
68
68
 
69
69
// Common account parameters
70
70
static const char *const CONFIG_ACCOUNT_TYPE                 = "Account.type";
72
72
static const char *const CONFIG_ACCOUNT_MAILBOX              = "Account.mailbox";
73
73
static const char *const CONFIG_ACCOUNT_ENABLE               = "Account.enable";
74
74
static const char *const CONFIG_ACCOUNT_REGISTRATION_EXPIRE  = "Account.registrationExpire";
 
75
static const char *const CONFIG_ACCOUNT_REGISTRATION_STATUS = "Account.registrationStatus";
 
76
static const char *const CONFIG_ACCOUNT_REGISTRATION_STATE_CODE = "Account.registrationCode";
 
77
static const char *const CONFIG_ACCOUNT_REGISTRATION_STATE_DESC = "Account.registrationDescription";
75
78
static const char *const CONFIG_CREDENTIAL_NUMBER            = "Credential.count";
76
 
static const char *const ACCOUNT_DTMF_TYPE                   = "Account.dtmfType";
 
79
static const char *const CONFIG_ACCOUNT_DTMF_TYPE            = "Account.dtmfType";
77
80
static const char *const CONFIG_RINGTONE_PATH                = "Account.ringtonePath";
78
81
static const char *const CONFIG_RINGTONE_ENABLED             = "Account.ringtoneEnabled";
79
 
 
80
 
static const char *const HOSTNAME                            = "hostname";
81
 
static const char *const USERNAME                            = "username";
82
 
static const char *const ROUTESET                            = "routeset";
83
 
static const char *const PASSWORD                            = "password";
84
 
static const char *const REALM                               = "realm";
85
 
static const char *const DEFAULT_REALM                       = "*";
86
 
static const char *const USERAGENT                                                       = "useragent";
87
 
 
88
 
static const char *const LOCAL_INTERFACE                     = "Account.localInterface";
89
 
static const char *const PUBLISHED_SAMEAS_LOCAL              = "Account.publishedSameAsLocal";
90
 
static const char *const LOCAL_PORT                          = "Account.localPort";
91
 
static const char *const PUBLISHED_PORT                      = "Account.publishedPort";
92
 
static const char *const PUBLISHED_ADDRESS                   = "Account.publishedAddress";
93
 
 
94
 
static const char *const DISPLAY_NAME                        = "Account.displayName";
95
 
static const char *const DEFAULT_ADDRESS                     = "0.0.0.0";
 
82
static const char *const CONFIG_KEEP_ALIVE_ENABLED           = "Account.keepAliveEnabled";
 
83
 
 
84
static const char *const CONFIG_ACCOUNT_HOSTNAME             = "Account.hostname";
 
85
static const char *const CONFIG_ACCOUNT_USERNAME             = "Account.username";
 
86
static const char *const CONFIG_ACCOUNT_ROUTESET             = "Account.routeset";
 
87
static const char *const CONFIG_ACCOUNT_PASSWORD             = "Account.password";
 
88
static const char *const CONFIG_ACCOUNT_REALM                = "Account.realm";
 
89
static const char *const CONFIG_ACCOUNT_DEFAULT_REALM        = "*";
 
90
static const char *const CONFIG_ACCOUNT_USERAGENT            = "Account.useragent";
 
91
 
 
92
static const char *const CONFIG_LOCAL_INTERFACE              = "Account.localInterface";
 
93
static const char *const CONFIG_PUBLISHED_SAMEAS_LOCAL       = "Account.publishedSameAsLocal";
 
94
static const char *const CONFIG_LOCAL_PORT                   = "Account.localPort";
 
95
static const char *const CONFIG_PUBLISHED_PORT               = "Account.publishedPort";
 
96
static const char *const CONFIG_PUBLISHED_ADDRESS            = "Account.publishedAddress";
 
97
 
 
98
static const char *const CONFIG_DISPLAY_NAME                 = "Account.displayName";
 
99
static const char *const CONFIG_DEFAULT_ADDRESS              = "0.0.0.0";
96
100
 
97
101
// SIP specific parameters
98
 
static const char *const SIP_PROXY                           = "SIP.proxy";
99
 
static const char *const STUN_SERVER                                             = "STUN.server";
100
 
static const char *const STUN_ENABLE                                             = "STUN.enable";
 
102
static const char *const CONFIG_SIP_PROXY                    = "SIP.proxy";
 
103
static const char *const CONFIG_STUN_SERVER                  = "STUN.server";
 
104
static const char *const CONFIG_STUN_ENABLE                  = "STUN.enable";
101
105
 
102
106
// SRTP specific parameters
103
 
static const char *const SRTP_ENABLE                         = "SRTP.enable";
104
 
static const char *const SRTP_KEY_EXCHANGE                   = "SRTP.keyExchange";
105
 
static const char *const SRTP_ENCRYPTION_ALGO                = "SRTP.encryptionAlgorithm";  // Provided by ccRTP,0=NULL,1=AESCM,2=AESF8
106
 
static const char *const SRTP_RTP_FALLBACK                   = "SRTP.rtpFallback";
107
 
static const char *const ZRTP_HELLO_HASH                     = "ZRTP.helloHashEnable";
108
 
static const char *const ZRTP_DISPLAY_SAS                    = "ZRTP.displaySAS";
109
 
static const char *const ZRTP_NOT_SUPP_WARNING               = "ZRTP.notSuppWarning";
110
 
static const char *const ZRTP_DISPLAY_SAS_ONCE               = "ZRTP.displaySasOnce";
111
 
 
112
 
static const char *const TLS_LISTENER_PORT                   = "TLS.listenerPort";
113
 
static const char *const TLS_ENABLE                          = "TLS.enable";
114
 
static const char *const TLS_CA_LIST_FILE                    = "TLS.certificateListFile";
115
 
static const char *const TLS_CERTIFICATE_FILE                = "TLS.certificateFile";
116
 
static const char *const TLS_PRIVATE_KEY_FILE                = "TLS.privateKeyFile";
117
 
static const char *const TLS_PASSWORD                        = "TLS.password";
118
 
static const char *const TLS_METHOD                          = "TLS.method";
119
 
static const char *const TLS_CIPHERS                         = "TLS.ciphers";
120
 
static const char *const TLS_SERVER_NAME                     = "TLS.serverName";
121
 
static const char *const TLS_VERIFY_SERVER                   = "TLS.verifyServer";
122
 
static const char *const TLS_VERIFY_CLIENT                   = "TLS.verifyClient";
123
 
static const char *const TLS_REQUIRE_CLIENT_CERTIFICATE      = "TLS.requireClientCertificate";
124
 
static const char *const TLS_NEGOTIATION_TIMEOUT_SEC         = "TLS.negotiationTimeoutSec";
125
 
static const char *const TLS_NEGOTIATION_TIMEOUT_MSEC        = "TLS.negotiationTimemoutMsec";
126
 
 
127
 
static const char *const REGISTRATION_STATUS                 = "Status";
128
 
static const char *const REGISTRATION_STATE_CODE             = "Registration.code";
129
 
static const char *const REGISTRATION_STATE_DESCRIPTION      = "Registration.description";
 
107
static const char *const CONFIG_SRTP_ENABLE                  = "SRTP.enable";
 
108
static const char *const CONFIG_SRTP_KEY_EXCHANGE            = "SRTP.keyExchange";
 
109
static const char *const CONFIG_SRTP_ENCRYPTION_ALGO         = "SRTP.encryptionAlgorithm";  // Provided by ccRTP,0=NULL,1=AESCM,2=AESF8
 
110
static const char *const CONFIG_SRTP_RTP_FALLBACK            = "SRTP.rtpFallback";
 
111
static const char *const CONFIG_ZRTP_HELLO_HASH              = "ZRTP.helloHashEnable";
 
112
static const char *const CONFIG_ZRTP_DISPLAY_SAS             = "ZRTP.displaySAS";
 
113
static const char *const CONFIG_ZRTP_NOT_SUPP_WARNING        = "ZRTP.notSuppWarning";
 
114
static const char *const CONFIG_ZRTP_DISPLAY_SAS_ONCE        = "ZRTP.displaySasOnce";
 
115
 
 
116
static const char *const CONFIG_TLS_LISTENER_PORT            = "TLS.listenerPort";
 
117
static const char *const CONFIG_TLS_ENABLE                   = "TLS.enable";
 
118
static const char *const CONFIG_TLS_CA_LIST_FILE             = "TLS.certificateListFile";
 
119
static const char *const CONFIG_TLS_CERTIFICATE_FILE         = "TLS.certificateFile";
 
120
static const char *const CONFIG_TLS_PRIVATE_KEY_FILE         = "TLS.privateKeyFile";
 
121
static const char *const CONFIG_TLS_PASSWORD                 = "TLS.password";
 
122
static const char *const CONFIG_TLS_METHOD                   = "TLS.method";
 
123
static const char *const CONFIG_TLS_CIPHERS                  = "TLS.ciphers";
 
124
static const char *const CONFIG_TLS_SERVER_NAME              = "TLS.serverName";
 
125
static const char *const CONFIG_TLS_VERIFY_SERVER            = "TLS.verifyServer";
 
126
static const char *const CONFIG_TLS_VERIFY_CLIENT            = "TLS.verifyClient";
 
127
static const char *const CONFIG_TLS_REQUIRE_CLIENT_CERTIFICATE = "TLS.requireClientCertificate";
 
128
static const char *const CONFIG_TLS_NEGOTIATION_TIMEOUT_SEC  = "TLS.negotiationTimeoutSec";
 
129
static const char *const CONFIG_TLS_NEGOTIATION_TIMEOUT_MSEC = "TLS.negotiationTimemoutMsec";
130
130
 
131
131
// General configuration keys for accounts
132
 
static const char * const aliasKey = "alias";
133
 
static const char * const typeKey = "type";
134
 
static const char * const idKey = "id";
135
 
static const char * const usernameKey = "username";
136
 
static const char * const authenticationUsernameKey = "authenticationUsername";
137
 
static const char * const passwordKey = "password";
138
 
static const char * const hostnameKey = "hostname";
139
 
static const char * const accountEnableKey = "enable";
140
 
static const char * const mailboxKey = "mailbox";
 
132
static const char * const ALIAS_KEY = "alias";
 
133
static const char * const TYPE_KEY = "type";
 
134
static const char * const ID_KEY = "id";
 
135
static const char * const USERNAME_KEY = "username";
 
136
static const char * const AUTHENTICATION_USERNAME_KEY = "authenticationUsername";
 
137
static const char * const PASSWORD_KEY = "password";
 
138
static const char * const HOSTNAME_KEY = "hostname";
 
139
static const char * const ACCOUNT_ENABLE_KEY = "enable";
 
140
static const char * const MAILBOX_KEY = "mailbox";
141
141
 
142
 
static const char * const codecsKey = "codecs";  // 0/9/110/111/112/
143
 
static const char * const ringtonePathKey = "ringtonePath";
144
 
static const char * const ringtoneEnabledKey = "ringtoneEnabled";
145
 
static const char * const displayNameKey = "displayName";
 
142
static const char * const CODECS_KEY = "codecs";  // 0/9/110/111/112/
 
143
static const char * const RINGTONE_PATH_KEY = "ringtonePath";
 
144
static const char * const RINGTONE_ENABLED_KEY = "ringtoneEnabled";
 
145
static const char * const DISPLAY_NAME_KEY = "displayName";
146
146
 
147
147
class Account : public Serializable {
148
148
 
155
155
         */
156
156
        virtual ~Account();
157
157
 
158
 
        /**
159
 
         * Method called by the configuration engine to serialize instance's information
160
 
         * into configuration file.
161
 
         */
162
 
        virtual void serialize(Conf::YamlEmitter *emitter) = 0;
163
 
 
164
 
        /**
165
 
         * Method called by the configuration engine to restore instance internal state
166
 
         * from configuration file.
167
 
         */
168
 
        virtual void unserialize(Conf::MappingNode *map) = 0;
169
 
 
170
158
        virtual void setAccountDetails(std::map<std::string, std::string> details) = 0;
171
159
 
172
160
        virtual std::map<std::string, std::string> getAccountDetails() const = 0;
240
228
            alias_ = alias;
241
229
        }
242
230
 
243
 
        std::string getType() const {
244
 
            return type_;
245
 
        }
246
 
        void setType(const std::string &type) {
247
 
            type_ = type;
248
 
        }
249
 
 
250
231
        /**
251
232
         * Accessor to data structures
252
233
         * @return CodecOrder& The list that reflects the user's choice