sflphone_const.h 6.86 KB
Newer Older
1
2
/*
 *  Copyright (C) 2008 Savoir-Faire Linux inc.
3
4
 *  Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
 *
5
6
7
8
 *  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.
9
 *
10
11
12
13
 *  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.
14
 *
15
16
17
18
 *  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.
 */
19

20
21
22
#ifndef __SFLPHONE_CONST_H
#define __SFLPHONE_CONST_H

Emmanuel Milou's avatar
Emmanuel Milou committed
23
24
#include <libintl.h>
#include "dbus.h"
25
#include "log4c.h"
Emmanuel Milou's avatar
Emmanuel Milou committed
26

27
28
29
/* @file sflphone_const.h
 * @brief Contains the global variables for the client code
 */
30

31
#define LOGO                ICONS_DIR "/sflphone.svg"
32
33
#define LOGO_NOTIF          ICONS_DIR "/sflphone_notif.svg"
#define LOGO_OFFLINE        ICONS_DIR "/sflphone_offline.svg"
34
#define LOGO_SMALL          ICONS_DIR "/sflphone_small.svg"
Emmanuel Milou's avatar
Emmanuel Milou committed
35

36
37
38
39
#define CURRENT_CALLS       "current_calls"
#define HISTORY             "history"
#define CONTACTS            "contacts"

40
/** Locale */
41
#define _(STRING)             gettext( STRING )
42
#define N_(STRING)			  (STRING)
43
44
#define c_(COMMENT,STRING)    gettext(STRING) 
#define n_(SING,PLUR,COUNT)   ngettext(SING,PLUR,COUNT)
45

46
#define IP2IP	"IP2IP"
47

48
49
50
51
52
/** Warnings unused variables **/
#define UNUSED_VAR(var)      (void*)var

#define UNUSED  __attribute__((__unused__))

53
54
55
#define IP2IP_PROFILE                      "IP2IP"

#define ACCOUNT_ID                         "Account.id"
56
#define ACCOUNT_TYPE                       "Account.type"
57
58
59
#define ACCOUNT_ALIAS		           "Account.alias"
#define ACCOUNT_ENABLED		           "Account.enable"
#define ACCOUNT_MAILBOX		           "Account.mailbox"
60
#define ACCOUNT_USERAGENT	           "useragent"
61
62
63
64
#define ACCOUNT_RESOLVE_ONCE               "Account.resolveOnce"
#define ACCOUNT_REGISTRATION_EXPIRE        "Account.expire"
#define ACCOUNT_SIP_STUN_SERVER	           "STUN.server"
#define ACCOUNT_SIP_STUN_ENABLED           "STUN.enable"
65
#define ACCOUNT_DTMF_TYPE                  "Account.dtmfType"
66
67
#define ACCOUNT_HOSTNAME                   "hostname"
#define ACCOUNT_USERNAME                   "username"
68
#define ACCOUNT_ROUTE                      "routeset"
69
70
71
72
73
#define ACCOUNT_PASSWORD                   "password"
#define ACCOUNT_AUTHENTICATION_USERNAME    "authenticationUsername"
#define ACCOUNT_REALM                      "realm"
#define ACCOUNT_KEY_EXCHANGE               "SRTP.keyExchange"
#define ACCOUNT_SRTP_ENABLED               "SRTP.enable"
74
#define ACCOUNT_SRTP_RTP_FALLBACK          "SRTP.rtpFallback"
75
76
77
78
#define ACCOUNT_ZRTP_DISPLAY_SAS           "ZRTP.displaySAS"
#define ACCOUNT_ZRTP_NOT_SUPP_WARNING      "ZRTP.notSuppWarning"
#define ACCOUNT_ZRTP_HELLO_HASH            "ZRTP.helloHashEnable"
#define ACCOUNT_DISPLAY_SAS_ONCE           "ZRTP.displaySasOnce"
79
#define KEY_EXCHANGE_NONE                  "0"
80
#define ZRTP                               "1"
81
#define SDES                               "2"
82

83
#define TLS_LISTENER_PORT                   "TLS.listenerPort"
pierre-luc's avatar
pierre-luc committed
84
#define TLS_ENABLE                          "TLS.enable"
85
#define TLS_PORT                            "TLS.port"
86
87
88
89
90
91
92
93
94
95
96
97
98
#define TLS_CA_LIST_FILE                    "TLS.certificateListFile"
#define TLS_CERTIFICATE_FILE                "TLS.certificateFile"
#define TLS_PRIVATE_KEY_FILE                "TLS.privateKeyFile"
#define TLS_PASSWORD                        "TLS.password"
#define TLS_METHOD                          "TLS.method"
#define TLS_CIPHERS                         "TLS.ciphers"
#define TLS_SERVER_NAME                     "TLS.serverName"
#define TLS_VERIFY_SERVER                   "TLS.verifyServer"
#define TLS_VERIFY_CLIENT                   "TLS.verifyClient"
#define TLS_REQUIRE_CLIENT_CERTIFICATE      "TLS.requireClientCertificate"  
#define TLS_NEGOTIATION_TIMEOUT_SEC         "TLS.negotiationTimeoutSec"
#define TLS_NEGOTIATION_TIMEOUT_MSEC        "TLS.negotiationTimemoutMsec"

99
#define LOCAL_INTERFACE                     "Account.localInterface"
100
#define PUBLISHED_SAMEAS_LOCAL              "Account.publishedSameAsLocal"
101
102
103
104
#define LOCAL_PORT                          "Account.localPort"
#define PUBLISHED_PORT                      "Account.publishedPort"
#define PUBLISHED_ADDRESS                   "Account.publishedAddress"

105
106
107
108
#define REGISTRATION_STATUS                 "Status"
#define REGISTRATION_STATE_CODE             "Registration.code" 
#define REGISTRATION_STATE_DESCRIPTION      "Registration.description"

109
110
111
112
113
/**
 * Global logger
 */
log4c_category_t* log4c_sfl_gtk_category;

114
/** Error while opening capture device */
115
#define ALSA_CAPTURE_DEVICE	      0x0001
116
/** Error while opening playback device */
117
#define ALSA_PLAYBACK_DEVICE	      0x0010
118
119
120
/** Error pulseaudio */
#define PULSEAUDIO_NOT_RUNNING        0x0100

121
/** Tone to play when no voice mails */
122
#define TONE_WITHOUT_MESSAGE  0
123
/** Tone to play when voice mails */
124
#define TONE_WITH_MESSAGE     1
125
/** Tells if the main window is reduced to the system tray or not */
126
#define MINIMIZED	      TRUE
127
/** Behaviour of the main window on incoming calls */
128
#define __POPUP_WINDOW  ( dbus_popup_mode() )
129
/** Show/Hide the dialpad */
130
#define SHOW_DIALPAD	( dbus_get_dialpad() )
131
132
/** Show/Hide the alsa configuration panel */
#define SHOW_ALSA_CONF  ( dbus_get_audio_manager() == ALSA )
133
134
/** Show/Hide the volume controls */
#define SHOW_VOLUME	(dbus_get_volume_controls() && SHOW_ALSA_CONF)
135
136
137
138

/** Audio Managers */
#define ALSA	      0
#define PULSEAUDIO    1
139

140
141
142
143
 /** DTMF type */
#define OVERRTP "overrtp"
#define SIPINFO "sipinfo"

144
145
146
147
/** Notification levels */
#define __NOTIF_LEVEL_MIN     0
#define __NOTIF_LEVEL_MED     1
#define __NOTIF_LEVEL_HIGH    2
148

149
/** Messages ID for the status bar - Incoming calls */
150
#define __MSG_INCOMING_CALL  0
151
/** Messages ID for the status bar - Calling */
152
#define __MSG_CALLING	     1
153
/** Messages ID for the status bar - Voice mails  notification */
154
#define __MSG_VOICE_MAILS    2
155
/** Messages ID for the status bar - Current account */
156
157
#define __MSG_ACCOUNT_DEFAULT  3

158
/** Desktop notifications - Time before to close the notification*/
159
#define __TIMEOUT_MODE      "default"
160
/** Desktop notifications - Time before to close the notification*/
161
#define __TIMEOUT_TIME      18000       // 30 secondes
162

163
164
165
/**
 * Macros for logging
 */
166
167
168
169
#define DEBUG(...) log4c_category_log(log4c_sfl_gtk_category, LOG4C_PRIORITY_DEBUG, __VA_ARGS__);
#define WARN(...) log4c_category_log(log4c_sfl_gtk_category, LOG4C_PRIORITY_WARN, __VA_ARGS__);
#define ERROR(...) log4c_category_log(log4c_sfl_gtk_category, LOG4C_PRIORITY_ERROR, __VA_ARGS__);
#define FATAL(...) log4c_category_log(log4c_sfl_gtk_category, LOG4C_PRIORITY_FATAL, __VA_ARGS__);
Emmanuel Milou's avatar
Emmanuel Milou committed
170

171
#endif