-
Notifications
You must be signed in to change notification settings - Fork 26
/
README.Asterisk
243 lines (165 loc) · 6.02 KB
/
README.Asterisk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
Revision SVN 8
- fix documentation
- diff at proper level
Revision SVN 6
- convert to using subversion
- update the documentation
- support for Asterisk 1.2.x
Revision 1.7 (2006-09-03)
- update Intel filenames in documentation, use IPP 4.1.2 instead of 4.1
Revision 1.6 (2005-09-03)
- unified G.723.1 and G.729 patches into a single diff, so you can
study both more easily
- fix memory leak - thanks to Rafael for spotting the missing `!' in Intel's
code
- compile the command line encoder and decoder for G.729 such that
they produce raw G.729 rather than ITU demonstration bitstreams.
- add Debian packaging files
- add runme.sh
Revision 1.5
- libimf.so and libimf.a notes
Revision 1.4
- static linking
- compiler optimizations
Revision 1.3
- added Intel links
- fixed patch command
- added notes about build dependencies
Prerequisites
-------------
- This code has been compiled with gcc 4. To use with gcc 3, you may need
to change the `-mtune' to `-mcpu' in makeopts, and some other small
changes.
Step 1a
-------
Download the code from Intel
cd /tmp
wget ftp://download.intel.com/software/products/ipp/downloads/samples/l_ipp-sample-speech-coding_p_4.1.008.tgz
wget ftp://download.intel.com/software/products/ipp/downloads/l_ipp_ia32_itanium_p_4_1_2.tar
Step 1b
-------
Install Asterisk header files
On Debian, just type
apt-get install asterisk-dev
apt-get build-dep asterisk
Specifically, you need the *.h files that come with Asterisk
Step 2a
-------
Register with Intel
See http://www.intel.com/software/products/ipp/
a) register on Intel's site under the 'free non-commercial use' section
b) obtain the license number and a license key file
c) put the license key file in the place specified by Intel's documentation
d) run the installer
Step 2b
-------
Install IPP libraries.
(For more detailed help with this stage, see
http://www.readytechnology.co.uk/open/ipp-codecs/intel-notes/ipp-4.1.2.txt )
mkdir /tmp/ipp-tmp
cd /tmp/ipp-tmp
tar xf /tmp/l_ipp_ia32_itanium_p_4_1_2.tar
Follow Intel's instructions to install IPP. If using Debian, the Intel
installed will stop half way, leaving a .rpm file sitting in a subdirectory
of /tmp. You can install the .rpm file using `alien' and then proceed.
Intel's instructions and licensing information (including Open Source
version information) are at http://www.intel.com/software/products/ipp/
Once you've installed IPP and agreed to the license terms, you may need to
copy the libraries from one PC to another (eg, from your development machine
to a production server). You just need to copy the contents of the following
directory:
/opt/intel/ipp41/ia32_itanium/sharedlib/
without re-running the install process.
If you use static linking (now the default method), you DON'T need to
copy the libraries onto every computer where you run the codec. You
only need the libraries on the computer where you compile the codec.
Step 3
------
Install IPP sample code
cd /usr/local/src
tar xzf /tmp/l_ipp-sample-speech-coding_p_4.1.008.tgz
Step 4
------
Apply my patch
cd ipp_sample/
patch -p0 < /tmp/ipp-svn8.diff
Step 4a
-------
Select compiler optimizations
vi speech-coding/makeopts
Note: if you optimize for a more modern processor than the processor
in your machine, the codec will not run and Asterisk will not start.
The default is Pentium 4. If you have a Pentium III, you must change
the optimizations.
Step 5a
-------
If you have icc 8.0 libimf, move intel_cc_80/lib/libimf.so to
somewhere out of the way. This will allow you to link libimf.a
statically with codec_g729.so
Step 5b
-------
**************************************
* New: *
* If NOT using Debian: *
* chmod a+x runme.sh *
* ./runme.sh *
* or *
* chmod a+x runme.sh *
* ./runme.sh install *
* *
* If you are using Debian: *
* *
* chmod a+x runme.sh debian/rules *
* dpkg-buildpackage -rfakeroot *
**************************************
Step 6
------
Deploy
cp codec_g72*.so /usr/lib/asterisk/modules
(the target location depends on your system)
or just do ./runme.sh install
or if using Debian, dpkg -i ../asterisk-ipp-codecs_1.0-1_i386.deb
If you haven't used static linking (now the default),
modify /etc/init.d/asterisk:
export LD_LIBRARY_PATH=/opt/intel/ipp41/ia32_itanium/sharedlib:/opt/intel/ipp41/ia32_itanium/sharedlib/linux32:$LD_LIBRARY_PATH
You may need to insert the following into your
sip.conf, iax.conf, h323.conf, etc:
allow=g729
Now restart Asterisk
/etc/init.d/asterisk restart
Step 7
------
Verify install
At the shell prompt:
# asterisk -r
At the Asterisk prompt:
>show translation
If the G.723.1 and G.729 columns have -'s instead of numbers, then
the codecs are not working properly.
============================
COMMAND LINE ENCODER/DECODER
============================
G.729 only at present
Do you want to record greetings and IVR messages in G.729 format so
that your CPU doesn't have to transcode every time a call takes place?
Most likely, yes, you do want this.
Now you can. The original Intel command line encoder and decoder utilities
(g729fpencoder and g729fpdecoder) work with bitstream files in a
special format used by the ITU test suite. This is not the same format
that Asterisk expects when reading/writing raw G.729.
The utilities `my_enc' and `my_dec' have been designed to work
with the raw format. Files generated by `my_enc' can be read by Asterisk
without any transcoding.
Usage:
my_enc audio.raw audio.g729
my_dec audio.g729 audio.raw
Where:
audio.raw must be
- 16 bit signed linear audio,
- mono,
- 8000Hz sample rate
To convert a WAV file into the raw uncompressed audio before feeding it
to `my_enc', you would use the `sox' utility (available on all Unix systems):
sox audio.wav -t raw -r 8000 -s -w -c 1 audio.raw
To convert a GSM file (such as those distributed with Asterisk), do:
sox audio.gsm -t raw -r 8000 -s -w -c 1 audio.raw