Afer the general headache of getting ISDN faxing to work with Hylafax on FreeBSD 7.2, I've written this simple howto should make life easier for anyone attempting to do what I have done. A decent amount of the information has been taken from shellbang.org, and in my case I was configuring an AVM B1 controller. However from the docs, this should work with other AVM controllers (C2, C4).
This should also work for Digi Datafire (formerly ITK IX1) controllers and legacy Diehl (now Eicon) controllers, however I can't vouch for this.
Thomas Wintergerst's publishes the source for CAPI4BSD (C4B) on his website. However it doesn't compile on FreeBSD 7.2.
Hellmuth Michaelis published a version of C4B patched for use on FreeBSD 7.2. Unfortunately it relied on his build environment, so it doesn't work out of the box. Luckily he provided a diff file. This can be used to patch the original C4B source. However there is another caveat: libc_r was deprecated as of 6.x, and removed in 7.0, so a modification had to be made to the diff. Hence we have to use the following diff: c4b-20100225-01.diff
Fetch the C4B source, and extract
Patch the C4B source:
Now, it should be possible to build & install C4B
As per the README, add the following lines to /etc/rc.conf
Restart, and check dmesg for the controller
To test, the controller send some noise over the line
A complete self test is done by using X.75 protocol for data transfer
For more information about testing C4B, have a look at Shellbang.org
http://www.shellbang.org/freebsd/introducingc4b.html
Now that we know the controller is up and running, Hylafax needs to be installed. This should be as easy as installing it from the ports tree, or compiling it if you want to use different configuration
Enable Hylafax on boot, by adding the following to /etc/rc.conf
I've finally managed to create a working port of CAPI4Hylafax, it also uses the current (v.01.03.00) of the source from available from the AVM FTP server. This version will also compile on FreeBSD amd64 (20050129 didn't).
To get CAPI4Hylafax v.01.03.00 installed, download the attached tarball, extract & build:
I've left the previous build information here for reference.
Installing CAPI4Hylafax is a bit of a chore. There's no official port, and the port on Shellbang.org doesn't build properly. The reason appears to be that configure process doesn't appear to work, as well as some other basic issues. The work around is to execute the configure process oneself.
Fetch the port, and extract
Patch the Makefile
Attempt to build. This will fail with an error like "Makefile: No such file or directory". Don't worry, as we'll do the configure ourselves.
Enter the work directory, and call the commands that should have been called after patching & before configuring. You'll get some warnings, but hopefully no errors.
To configure, we also need to export some compiler flags before we call configure
Now that configure has succeeded, we can build the port
You'll need to enable c2faxrecv in /etc/rc.conf so that Hylafax know the CAPI fax modem is available
Before Hylafax has been configured, faxsetup needs to be run. Use your preferred settings, however when asked to configure a modem, select NO, as we'll create a configuration file for the cAPI modem
You can either add the CAPI modem config using c2faxconfig, or do it manually. Personally, I looked at the automagically created config.faxCAPI, and used is as a base. Because the AVM B1 has two channels, I added a 2nd section so that it can send two concurrent faxes.
First, enter the Hylafax configuration directory
Make the following change to config. This will make Hylafax use the capi4hylafax sendfax command. Also, c2faxsend doesn't appear to support 2D TIFF compression, so
we have to tell Hylafax not to use it. This took some time to work out as all the files in the spool directory we valid, but the faxes were blank with only the tagline.
Finally, run faxmodem to create the FIFO symbolic links
Providing that I've left nothing out, the final result is a basic working setup. If something isn't working or I've left out a step, please feel free to contact me.
I've left out receiving faxes and more advanced configuration as this has been documented far better than I ever could.
Thanks really has to go to Thomas Wintergerst for getting AVM active ISDN controllers working in FreeBSD, Hellmuth Michaelis for getting them to work in FreeBSD 7.2, and Jan Stocker for porting AVM's CAPI4Hylafax to FreeBSD.
This should also work for Digi Datafire (formerly ITK IX1) controllers and legacy Diehl (now Eicon) controllers, however I can't vouch for this.
Thomas Wintergerst's publishes the source for CAPI4BSD (C4B) on his website. However it doesn't compile on FreeBSD 7.2.
Hellmuth Michaelis published a version of C4B patched for use on FreeBSD 7.2. Unfortunately it relied on his build environment, so it doesn't work out of the box. Luckily he provided a diff file. This can be used to patch the original C4B source. However there is another caveat: libc_r was deprecated as of 6.x, and removed in 7.0, so a modification had to be made to the diff. Hence we have to use the following diff: c4b-20100225-01.diff
Fetch the C4B source, and extract
# fetch "http://www.nord-com.net/thomas.wintergerst/files_c4b/c4b-1.1.1.tar.gz"
# tar -xzf c4b-1.1.1.tar.gz
Patch the C4B source:
# patch --ignore-whitespace < c4b-20100225-01.diff
Now, it should be possible to build & install C4B
# cd c4b
# make obj && make depend && make && make install && make clean
As per the README, add the following lines to /etc/rc.conf
Code:
capi_enable="YES"
avmaic_enable="YES" # Only for AVM controllers
daic_enable="YES" # Only for legacy Diehl controllers
ix1a_enable="YES" # Only for ITK IX1 (Digi Datafire) controllers
Restart, and check dmesg for the controller
# dmesg | grep -i capi
# capitest -lv
To test, the controller send some noise over the line
# capitest -o /etc/hosts -tv <number>
A complete self test is done by using X.75 protocol for data transfer
# capitest -s -tx <number>
For more information about testing C4B, have a look at Shellbang.org
http://www.shellbang.org/freebsd/introducingc4b.html
Now that we know the controller is up and running, Hylafax needs to be installed. This should be as easy as installing it from the ports tree, or compiling it if you want to use different configuration
# pkg_add -r hylafax
# cd /usr/ports/comms/hylafax && make config && make && make install && make clean
Enable Hylafax on boot, by adding the following to /etc/rc.conf
Code:
hylafax_enable="YES"
I've finally managed to create a working port of CAPI4Hylafax, it also uses the current (v.01.03.00) of the source from available from the AVM FTP server. This version will also compile on FreeBSD amd64 (20050129 didn't).
To get CAPI4Hylafax v.01.03.00 installed, download the attached tarball, extract & build:
# fetch -o capi4hylafax-01.03.00.tar.bz2 "http://forums.freebsd.org/attachment.php?attachmentid=993&stc=1&d=1284649628"
# tar -xjvf capi4hylafax-01.03.00.tar.bz2
# cd comms/capi4hylafax/ && make install && make clean
I've left the previous build information here for reference.
Installing CAPI4Hylafax is a bit of a chore. There's no official port, and the port on Shellbang.org doesn't build properly. The reason appears to be that configure process doesn't appear to work, as well as some other basic issues. The work around is to execute the configure process oneself.
Fetch the port, and extract
# fetch "http://www.shellbang.org/files/capi4hylafax-20050129.tar.gz"
# tar -xzf "capi4hylafax-20050129.tar.gz"
Patch the Makefile
# patch < capi4hylafax-20100209-01.diff
Attempt to build. This will fail with an error like "Makefile: No such file or directory". Don't worry, as we'll do the configure ourselves.
# cd comms/capi4hylafax/ && make
Enter the work directory, and call the commands that should have been called after patching & before configuring. You'll get some warnings, but hopefully no errors.
# cd work/capi4hylafax-20050129/
# aclocal && libtoolize --force --copy && autoreconf
To configure, we also need to export some compiler flags before we call configure
# export LDFLAGS=-L/usr/local/lib
# export CPPFLAGS=-I/usr/local/include
# ./configure
Now that configure has succeeded, we can build the port
# cd ../../ && make && make install && make clean
You'll need to enable c2faxrecv in /etc/rc.conf so that Hylafax know the CAPI fax modem is available
Code:
capi4hylafax_c2faxrecv_enable="YES"
Before Hylafax has been configured, faxsetup needs to be run. Use your preferred settings, however when asked to configure a modem, select NO, as we'll create a configuration file for the cAPI modem
# faxsetup
You can either add the CAPI modem config using c2faxconfig, or do it manually. Personally, I looked at the automagically created config.faxCAPI, and used is as a base. Because the AVM B1 has two channels, I added a 2nd section so that it can send two concurrent faxes.
First, enter the Hylafax configuration directory
# cd /var/spool/hylafax/etc/
Make the following change to config. This will make Hylafax use the capi4hylafax sendfax command. Also, c2faxsend doesn't appear to support 2D TIFF compression, so
we have to tell Hylafax not to use it. This took some time to work out as all the files in the spool directory we valid, but the faxes were blank with only the tagline.
Code:
SendFaxCmd: "/usr/local/bin/c2faxsend"
Use2D: no
Finally, run faxmodem to create the FIFO symbolic links
# faxmodem
Providing that I've left nothing out, the final result is a basic working setup. If something isn't working or I've left out a step, please feel free to contact me.
I've left out receiving faxes and more advanced configuration as this has been documented far better than I ever could.
Thanks really has to go to Thomas Wintergerst for getting AVM active ISDN controllers working in FreeBSD, Hellmuth Michaelis for getting them to work in FreeBSD 7.2, and Jan Stocker for porting AVM's CAPI4Hylafax to FreeBSD.