• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

compat/H21-Feb-2009-14874

lib/H21-Feb-2009-283,866229,894

CHANGESH A D21-Feb-20099.2 KiB231229

FAQH A D21-Feb-20098 KiB183153

Makefile.inH A D21-Feb-2009817 3324

READMEH A D21-Feb-200912.3 KiB313226

TODOH A D21-Feb-200915 21

VERSIONH A D21-Feb-20096 21

buildH A D21-Feb-20092.4 KiB7569

config.ttyIAXH A D21-Feb-20092.2 KiB7970

configureH A D21-Feb-2009834 3426

iaxmodem-cfg.ttyIAXH A D21-Feb-2009178 1211

iaxmodem.1H A D21-Feb-20091.6 KiB4120

iaxmodem.cH A D03-May-202253 KiB1,8191,417

iaxmodem.infH A D21-Feb-20097.3 KiB313141

iaxmodem.init.debianH A D21-Feb-20091 KiB5245

iaxmodem.init.fedoraH A D21-Feb-20091.2 KiB7253

iaxmodem.init.suseH A D21-Feb-20091.9 KiB6944

termpkg-ttydforfax.patchH A D21-Feb-20091.1 KiB2928

README

1		** ABOUT IAXMODEM **
2
3IAXmodem is a software modem written in C that uses an IAX channel
4(commonly provided by an Asterisk PBX system) instead of a traditional
5phone line and uses a DSP library instead of DSP hardware chipsets.
6
7To accomplish this, then, IAXmodem interfaces an IAX library known as
8libiax2 with a DSP library known as spandsp, and then IAXmodem interfaces
9the DSP library with a tty device node for interfacing with modem (fax)
10applications.
11
12IAXmodem comes with a copy of both libiax2 and spandsp.  Both of these
13libraries may have had bugs fixed or enhancements added for specific use
14with IAXmodem.  Although these changes are submitted to the library
15authors/maintainers and may be committed to the upstream repositories,
16it is recommended that the versions here be used for iaxmodem if only
17for the reason that these versions have been tested and are known to work.
18
19If you are using other applications that require a different libiax2 or
20spandsp version then iaxmodem can be statically linked to the libraries
21after building the versions here (but not installing them).  See the
22part about "build static" below.
23
24Currently supported platforms are GNU/Linux on x86 hardware.
25
26The libiax2 source was pulled from iaxclient SVN on December 23, 2007.
27
28The spandsp source is spandsp-0.0.5 snapshot 20080725.
29
30IAXmodem should usually be installed either on the same machine as the
31Asterisk server or on a system that is very close to the Asterisk server
32on a controlled network.  Do not even bother trying to use IAXmodem to
33send faxes through your IAX-supporting VoIP provider, it won't work
34reliably, if at all.
35
36Please see the FAQ file for more information regarding IAXmodem.
37
38
39		** INSTALLING IAXMODEM **
40
41There are two ways to build IAXmodem.  One way uses dynamic libraries;
42the other way uses static libraries.  If you already have an installation
43of an incompatible spandsp or libiax2 on the system, then you should
44probably build using static libraries.
45
46To install libiax2:  (if you're not going to 'build static')
47
48# cd lib/libiax2
49# ./configure
50# make
51# make install
52
53To install spandsp:  (if you're not going to 'build static')
54
55# cd lib/spandsp
56# ./configure
57# make
58# make install
59
60If you're building with dynamic libraries, make sure that your linker
61can find these libraries by having a line in your /etc/ld.so.conf file
62that is "/usr/local/lib" and running 'ldconfig' afterwards.
63
64To build IAXmodem with dynamic linking:
65
66# ./build
67
68To build IAXmodem with static linking:
69
70# ./build static
71
72This will create the iaxmodem binary.  You may run the binary from
73its present location, or you may copy it to any location that you may
74choose.
75
76The build script also accepts one other command-line option: -bsdptys.
77This option must come first, like this:
78
79# ./build -bsdptys
80
81Alternatively you can build IAXmodem with static linking by running
82the more traditional:
83
84# ./configure
85# make
86
87Create the /etc/iaxmodem directory.  The modem configuration files will
88be stored in here.  With your favorite editor edit the prototype modem
89configuration file, iaxmodem-cfg.ttyIAX.  Alter the configuration lines
90as needed and desired.
91
92The "device" entry is the full name of the device that you will be using
93in your modem application.  If running multiple instances of iaxmodem then
94you will need a different device for each instance.
95
96The "owner" entry (formatted "user:group") is the system user and group
97that IAXmodem should use for the created device.
98
99The "mode" entry is the permissions mode for the created device.
100
101The "port" entry refers to the preferred port number on which to listen
102for communications from the Asterisk server (so if you're using more than
103one IAXmodem on a single IP address you will need to have each IAXmodem
104configuration use a different port).  You should not use "4569" if Asterisk
105is already listening on port 4569.
106
107The "refresh" entry indicates the preference on how frequently to refresh
108the registration with the Asterisk server.  (However, the actual refresh
109value that is used will be negotiated between IAXmodem and the Asterisk
110server.)  By setting this to a value of "0" (zero), IAXmodem will not
111register with the server, and thus the server should be configured to
112communicate with IAXmodem on a static address.
113
114The "server", "peername", and "secret" entries refer to the server name
115(or address), the registered peer name for the IAXmodem client, and the
116registered secret (password) for the IAXmodem client.
117
118The entries "cidname" and "cidnumber" refer to the Caller*ID presentation
119that will be made by IAXmodem to the Asterisk server.
120
121The "codec" entry refers to the preferred audio codec. This can be
122"slinear", "ulaw", or "alaw".
123
124The "record" entry causes audio files to be recorded (see below).
125
126The "replay" entry causes the audio files to be replayed back (see below).
127
128The "nojitterbuffer" entry disables the very simple iaxmodem jitterbuffer
129(see below).
130
131The "iax2debug" entry enables debugging output for IAX2.
132
133The "dspdebug" entry enables debugging output for the DSPs.
134
135The "nodaemon" entry exempts the modem from inclusion with daemon use.
136
137Comments can be placed into the IAXmodem configuration files by beginning
138them with a semicolon (";").
139
140Now copy this file to the /etc/iaxmodem directory with a unique file name.
141The name of the file will serve as the identifier, if you choose to launch
142iaxmodem in non-daemon mode (see below).
143
144
145		** RUNNING IAXMODEM **
146
147Now you are ready to start IAXmodem.  IAXmodem can be run in two manners,
148daemon mode, or non-daemon.  Initially you should probably run iaxmodem
149at least once in non-daemon mode, just to make sure things are working
150(that iaxmodem registers).
151
152                      ----------
153
154In non-daemon mode, IAXmodem is started by supplying the configuration
155identifier as the only command-line parameter, like this:
156
157  /path/to/iaxmodem ttyIAX
158
159In this example the modem configuration file is expected to be:
160
161  /etc/iaxmodem/ttyIAX
162
163You should probably run IAXmodem like this at least once to check
164to see that registration occurs properly (then press ^C to exit).
165
166In non-daemon mode IAXmodem does not detach itself from the controlling
167tty, and it does send logging data both to standard output (informational
168items) and to standard error (errors).  As this logging can be a bit
169verbose, you may choose to ignore all of it by starting IAXmodem like
170this:
171
172  /path/to/iaxmodem ttyIAX >/dev/null 2>&1
173
174Alternatively, if you wish to record this into rotated log files:
175
176  /path/to/iaxmodem ttyIAX >/tmp/iaxmodem.stdout 2>/tmp/iaxmodem.stderr
177
178You may also choose to run IAXmodem from init by placing an entry into
179the /etc/inittab file like this (and then restarting init):
180
181  IAX:2345:respawn:/path/to/iaxmodem ttyIAX
182
183                      ----------
184
185In daemon mode, IAXmodem is started by not supplying a configuration
186identifier on the command-line, like this:
187
188  /path/to/iaxmodem
189
190This will cause iaxmodem to detach itself from the controlling tty and
191launch a separate iaxmodem instance for every modem configuration file
192found in /etc/iaxmodem.
193
194In daemon mode IAXmodem sends logging data to files in the
195/var/log/iaxmodem directory, if available.  (The /var/log/iaxmodem
196directory will need to be created.)
197
198You may wish to run iaxmodem in daemon mode and start it with a standard
199init.d script.  The provided iaxmodem.init files should serve this
200purpose.  (Choose the appropriate one for your distribution.)
201
202                      ----------
203
204Some people want to launch iaxmodem in a manner like daemon mode, but
205for various reasons (like runit compatibility) need the parent process
206to not detach itself from the controlling tty.  This is done with the -F
207option like this:
208
209  /path/to/iaxmodem -F
210
211
212		** USING IAX MODEM **
213
214Once IAXmodem is running you are ready to use it with your application.
215
216If your application is HylaFAX, there is a HylaFAX modem configuration
217file included with IAXmodem (config.ttyIAX).  The config file is for
218HylaFAX version 4.2.2 and later.  Instead of running faxaddmodem,
219simply edit this config file to your liking and then copy it to
220/var/spool/hylafax/etc/.  (Run faxgetty and the rest of HylaFAX as
221usual.)
222
223If using the "record" option, IAXmodem will create two audio files in
224the /tmp/ directory.  These files are overwritten by each new audio
225call.  The file "ttyIAX-dsp.raw" is the audio that was received by
226IAXmodem from the DSP library (which IAXmodem delivered to the IAX
227library), and the file "ttyIAX-iax.raw" is the audio that was received
228by IAXmodem from the IAX library (which IAXmodem delivered to the DSP
229library).  These audio files can be converted by sox into playable WAV
230files in this way:
231
232  sox -s -w -r 8000 -c 1 ttyIAX-iax.raw playable.wav
233
234If using the "replay" option, IAXmodem will replay the audio in the
235audio files previously recorded by "record".  So the audio that is
236passed to the DSP comes from "ttyIAX-iax.raw" instead of from the IAX
237channel, and the audio that is passed to the IAX channel comes from
238"ttyIAX-dsp.raw" instead of from the DSP.  This feature is indended
239to provide a simple and reliable way to methodically repeat a call
240session for debugging.  Use of "replay" will disable "record".
241
242Jitter occurs when audio is received out of sequence.  Normally this
243involves missing audio packets, but sometimes it can involve mis-
244ordered audio.  Jitter occurs because the UDP communication medium
245graciously allows packets to be dropped by the network, and so on
246collision-prone links these audio packets will be dropped when
247deemed necessary by the network equipment.  Jitter should not occur
248if iaxmodem is communicating directly with the PBX over a loopback
249or directly-wired (crossover) interface.
250
251By default iaxmodem copes with received jitter by replacing missing
252audio with "fill" from the previously-received audio packet and by
253dropping mis-ordered audio packets.  The intention behind this is to
254prevent our packet counting from falling behind the other endpoint,
255to prevent jitter from causing carrier drops or from producing a
256carrier when there shouldn't be one.  In some cases this fill behavior
257may be undesireable, and instead it would better to just skip the
258missing audio (thus letting our packet counting fall slightly behind).
259In order to disable the jitterbuffer put "nojitterbuffer" into the
260iaxmodem config file.
261
262By default iaxmodem, when starting, will examine an existing log file
263to see if it is larger than 1GB.  If it is, then iaxmodem will rename
264that file with ".old" at the end, deleting any existing ".old" log
265file.  The purpose in this is to prevent iaxmodem logging from
266consuming too much disk space.  However, the astute iaxmodem
267administrator should probably employ a system-wide logrotate service
268to rotate the iaxmodem logging independently.
269
270An appropriate logrotate.d entry for iaxmodem may look like this:
271
272/var/log/iaxmodem/*.log {
273    notifempty
274    missingok
275    postrotate
276        /bin/kill -HUP `cat /var/run/iaxmodem.pid` || true
277    endscript
278}
279
280Modems typically should be reset and reinitialized after each call
281(in case something within the call put the modem into a bad state).
282During initialization it is difficult, if not impossible, to properly
283handle incoming calls.  For this reason IAXmodem is "busied-out" for
284five seconds after going on-hook (ATH0 or ATZ).  If the initialization
285sequence can last longer than that time it would be advisable, then,
286to take the modem off-hook (ATH1) at the outset of initialization and
287to place it back on-hook (ATH0) when done (in which case the modem
288will be busied out during the entire initialization sequence plus
289five seconds after it finishes).  For HylaFAX the five-second
290automatic busy-out should be sufficient.
291
292
293		** CONTRIBUTING **
294
295* Bug Reports - If you use IAXmodem and encounter a problem please do
296  report it, even if you can work around the problem and even if you
297  do not intend to fix the problem.
298* Patches - If you develop a patch (bug fix or enhancement) please do
299  share it.  If you would like to develop, but don't know what to do,
300  please look at the list of items in the TODO file.
301* Commission Work - If you use or would like to use IAXmodem and need
302  some work done, hire someone to do it (the author can provide
303  suggestions) and share that work.
304* Donations - The author is always happy to accept donations of just
305  about any kind.
306
307
308		** CONTACTS and SUPPORT **
309
310Original Author:  Lee Howard <faxguy@howardsilvan.com>
311        Website:  http://iaxmodem.sourceforge.net
312   Mailing List:  iaxmodem-users@lists.sourceforge.net
313