3
3
* Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
4
4
* Author: Yan Morin <yan.morin@savoirfairelinux.com>
5
5
* Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com>
7
7
* This program is free software; you can redistribute it and/or modify
8
8
* it under the terms of the GNU General Public License as published by
9
9
* the Free Software Foundation; either version 3 of the License, or
10
10
* (at your option) any later version.
12
12
* This program is distributed in the hope that it will be useful,
13
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
15
* GNU General Public License for more details.
17
17
* You should have received a copy of the GNU General Public License
18
18
* along with this program; if not, write to the Free Software
19
19
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
89
89
#define RINGDIR "ringtones" /** Ringtones directory */
90
90
#define CODECDIR "codecs" /** Codecs directory */
92
#define SIZEBUF 1024*1024
92
#define SIZEBUF 400000 /** About 12 sec of buffering at 8000 Hz*/
93
93
#define STATIC_BUFSIZE 5000
95
95
#define ALSA_DFT_CARD_ID 0 /** Index of the default soundcard */
97
#define PCM_PLUGHW "plughw" /** Alsa plugin */
97
#define PCM_PLUGHW "plughw" /** Alsa plugin */
98
98
#define PCM_DEFAULT "default" /** Default ALSA plugin */
99
99
#define PCM_DMIX "plug:dmix" /** Alsa plugin for software mixing */
100
#define PCM_DSNOOP "plug:dsnoop" /** Alsa plugin for microphone sharing */
101
#define PCM_DMIX_DSNOOP "dmix/dsnoop" /** Audio profile using Alsa dmix/dsnoop */
101
#define SFL_CODEC_VALID_PREFIX "libcodec_" /** Valid prefix for codecs shared library */
103
#define SFL_CODEC_VALID_PREFIX "libcodec_" /** Valid prefix for codecs shared library */
102
104
#define SFL_CODEC_VALID_EXTEN ".so" /** Valid extension for codecs shared library */
103
105
#define CURRENT_DIR "." /** Current directory */
104
106
#define PARENT_DIR ".." /** Parent directory */
106
#define SFL_PCM_BOTH 0x0021 /** To open both playback and capture devices */
108
#define SFL_PCM_BOTH 0x0021 /** To open both playback and capture devices */
107
109
#define SFL_PCM_PLAYBACK 0x0022 /** To open playback device only */
108
110
#define SFL_PCM_CAPTURE 0x0023 /** To open capture device only */
111
#define SFL_PCM_RINGTONE 0x0024
111
114
#define IAX2_ENABLED true /** IAX2 support */
130
133
#define NETWORK_UNREACHABLE 0x0011 /** Network unreachable */
131
134
#define PULSEAUDIO_NOT_RUNNING 0x0100 /** Pulseaudio is not running */
134
137
#define PULSEAUDIO 1
135
#define CHECK_INTERFACE( layer , api ) (layer == api)
138
#define CHECK_INTERFACE( layer , api ) (layer == api)
137
#define UNUSED __attribute__((__unused__))
140
#define UNUSED __attribute__((__unused__))
139
142
#define DEFAULT_SIP_PORT "5060"
140
143
#define DEFAULT_SIP_TLS_PORT "5061"
145
148
/** Enumeration that contains known audio payloads */
147
// http://www.iana.org/assignments/rtp-parameters
148
// http://www.gnu.org/software/ccrtp/doc/refman/html/formats_8h.html#a0
149
// 0 PCMU A 8000 1 [RFC3551]
150
PAYLOAD_CODEC_ULAW = 0,
151
// 3 GSM A 8000 1 [RFC3551]
152
PAYLOAD_CODEC_GSM = 3,
153
// 8 PCMA A 8000 1 [RFC3551]
154
PAYLOAD_CODEC_ALAW = 8,
155
// 9 G722 A 8000 1 [RFC3551]
156
PAYLOAD_CODEC_G722 = 9,
157
// http://www.ietf.org/rfc/rfc3952.txt
159
PAYLOAD_CODEC_ILBC_20 = 97,
160
PAYLOAD_CODEC_ILBC_30 = 98,
161
// http://www.speex.org/drafts/draft-herlein-speex-rtp-profile-00.txt
163
// http://support.xten.com/viewtopic.php?p=8684&sid=3367a83d01fdcad16c7459a79859b08e
165
PAYLOAD_CODEC_SPEEX_8000 = 110,
166
PAYLOAD_CODEC_SPEEX_16000 = 111,
167
PAYLOAD_CODEC_SPEEX_32000 = 112
150
// http://www.iana.org/assignments/rtp-parameters
151
// http://www.gnu.org/software/ccrtp/doc/refman/html/formats_8h.html#a0
152
// 0 PCMU A 8000 1 [RFC3551]
153
PAYLOAD_CODEC_ULAW = 0,
154
// 3 GSM A 8000 1 [RFC3551]
155
PAYLOAD_CODEC_GSM = 3,
156
// 8 PCMA A 8000 1 [RFC3551]
157
PAYLOAD_CODEC_ALAW = 8,
158
// 9 G722 A 8000 1 [RFC3551]
159
PAYLOAD_CODEC_G722 = 9,
160
// http://www.ietf.org/rfc/rfc3952.txt
162
PAYLOAD_CODEC_ILBC_20 = 97,
163
PAYLOAD_CODEC_ILBC_30 = 98,
164
// http://www.speex.org/drafts/draft-herlein-speex-rtp-profile-00.txt
166
// http://support.xten.com/viewtopic.php?p=8684&sid=3367a83d01fdcad16c7459a79859b08e
168
PAYLOAD_CODEC_SPEEX_8000 = 110,
169
PAYLOAD_CODEC_SPEEX_16000 = 111,
170
PAYLOAD_CODEC_SPEEX_32000 = 112
168
171
} AudioCodecType;
170
173
/** The struct to reflect the order the user wants to use the codecs */