Hi,
Most people using iaxmodem + HylaFAX or spandsp from an Asterisk
application get satisfactory results for both transmitting and receiving
FAXes. However, quite a few people find FAX receive is reliable, but FAX
transmit can be flaky. Its box dependent. The cause of this has been
known since the early days of spandsp. Asterisk + zaptel/dahdi is unable
to produce a consistent audio stream on transmit, even though it usually
receives OK.
I suspected Digium might have finally done something about this, as they
are releasing a FAX module similar to app_fax. It looks like they have.
In chan_dahdi.c there is now code that extends the buffering inside
dadhi when a FAX is detected, and puts the buffering back to normal at
the end. This isn't really a cure - its more of a bandaid. However, I
expect it has the desired effect if they have put it into the trunk code.
You need to enable this feature in chan_dahdi.conf. The current default
chan_dahdi.conf has the following line
;faxbuffers=>6,full
You will need to remove the ";" to make the feature work. I doubt that
6
is a big enough number, though. 8 might be more successful, based on
audio logs I have received in the past.
Background
---------------------
In the early days of developing spandsp, a number of people reported
they could receive FAXes reliably, but could not transmit them reliably.
As this did not happen on my test machines, I asked a few people to try
a test, and send me the resulting audio files. The test was as follows:
- Loop 2 E1/T1 ports together
- Use patched app_rxfax and app_txfax apps, which records the audio in files
- Set up a FAX call, so it dials out through one E1/T1 and back into the
other
- Send me the resulting audio files
What I found was occasional gaps of 20ms, 40ms, 60ms, or sometimes even
80ms in the received audio. The gaps all appeared to be an exact
multiple of 20ms. If these gaps were edited out by hand, the received
signal precisely matched the transmitted signal. One would expect this
problem to be on the transmit side, as a problem on the receive side
would likely loose some of the signal, not inject silences. This was
basically confirmed by tests between a flaky box and a reliable one.
Reports said the problem happened on lightly loaded machines, so it does
not appear to relate to heavily loaded machines.
This problem was reported, but nobody seemed to care. Without a machine
displaying the effect in my possession, it was impractical for me to
investigate the root cause properly. Very interestingly, many people who
have problems sending from app_txfax or app_fax have no problem sending
from iaxmodem + HylaFAX. It seems Asterisk can feed a zaptel/dahdi
channel much more reliably when passing a signal through, than when
generating on in an app.
After all these years it looks like Digium have finally had to face up
to this problem to get a commercial FAX package out the door. Everyone
should benefit.
Regards,
Steve