I first want to say thanks to Joe and Tony for posting this, and being of help to those in this thread.
I've set up Hylafax on PIAF (the hard way) in the past. I've also worked with Hylafax on its own (again, the hard way... see a pattern here? LOL). Needless to say, it wasn't fun. But, seeing that a script was created (one that was editable no less), I really saw what we could do with it. We used it, and of course, we had to make adjustments along the way when we found out what was working and what wasn't working. But, in the end, we have a system for a client (one of our Atom systems with a PRI card and DIDs) that works beautifully.
With what we learned, we went back and looked to see how to make future installs better for larger installs. So, since I tend to be a little bit of a script monkey, I went to work on the original script, and added another one as a supplemental to satisfy some prerequisites that we found we needed (like NV Faxdetect).
So, what I am going to do is post the install path that worked best for us, using the modified script that should make setting up both inbound and outbound faxing easier. Be sure to do this on the system when you're not taking calls, since at least two reboots are necessary in this process.
- Grab this Excel spreadsheet...
http://www.goccsg.com/piaf-hylafax/fax-assignment-sample.xls
This spreadsheet will help you plan your fax setup, and will help avoid confusion. It will also give you the number of modems you should create.
- Log in to SSH. run the following (from the home root directory -- /root)...
wget http://www.goccsg.com/piaf-hylafax/piaf-faxdetect.sh
wget http://www.goccsg.com/piaf-hylafax/piaf-hylafax.sh
- do a chmod +x *.sh so that we can make them executable
- Now, run ./piaf-faxdetect.sh. Follow the directions and read the warnings on the screen. This will download and install the applications (nv faxdetect and nv backgrounddetect) into Asterisk. It will also recompile and reinstall the Asterisk code (this will not overwrite your config).
- Reboot your system, as suggested.
- Log back in, and run ./piaf-hylafax.sh. Again, follow all of the directions and read the warnings on the screen. Also, when prompted, answer all of the questions, including how many modems you want to start with (which is the number that you have come up with from .
Now, it will ask you for the CID name once, and the CID numbers for however many modems you wish to add. I did this by design (for now), and if you want unique names, you can go back and edit each /etc/iaxmodem-config.ttyIAXxx config file's cidname. It will also ask for the email addresses for each modem so that it can automatically add them to the FaxDispatch file in Hylafax.
- Reboot your system. This will allow IAXmodem, Asterisk, and Hylafax to talk to each other.
- Go into the FreePBX control panel, and add your IAX Fax Extensions. Do this for every DID you create.
SetUp “Fax Machine” Extension in FreePBX
In FreePBX, Setup, Extensions, Add Extension, add a Generic IAX2 Device.
Create the extension with the following Characteristics:
User Extension: 4574 (this helped me keep it straight, you can do whatever fax extension you want)
Display Name: Homer's Fax (Give it a Descriptive Name)
Outbound CID: 6155551216
Secret: The same strong secret as you specified in the setup
Save your changes. Then, open the newly created extension again and make the following characteristics:
notransfer = yes
host = 127.0.0.1
type = friend
port = 4574 <=== * This must match the port assigned
qualify=yes
disallow = all
allow = ulaw
permit = 127.0.0.1/255.255.255.
Save your changes again and apply your new settings.
- Go to your inbound routes, configure the proper DIDs (assuming it's set up). Go to the Fax Handling section, then set it to go to the created Fax extension, set the email address (again). For fax detection, use NVFax, and set the pause after answer to 4 (or whatever you feel comfortable with). When done, save your changes and apply your settings..
- Instead of me typing the rest, I'm going to link you to the rest...
http://pbxinaflash.com/forum/showpost.php?p=21799&postcount=2
(From the point on AvantFax onwards -- note: I limited users to the assigned modem)
http://pbxinaflash.com/forum/showpost.php?p=21800&postcount=3
http://pbxinaflash.com/forum/showpost.php?p=21801&postcount=4
(Note: I restricted users to individual modems, and recommend faxing through WinPrint Hylafax over AvantFax. In Winprint Hylafax, you may put in "ttyIAX4" for the modem, and that modem will be used alone.
- In AvantFax config, under the modems, I named the modems after their extension, and for contact, put the email address of the user in there. This will help with receiving. This email address must be unique.
- Just to be safe, reboot again.
- Test and fix things as necessary
Some notes:
- I am going to look for a way to make the adding of the fax extensions easier, so that we don't have to add them through FreePBX.
- Furthermore, I modified this with the idea that this will benefit those who have PRI line(s) coming in, and that users will be faxing from their DID lines directly. In the future, I'm hoping to make it work with analog lines.
- If you have suggestions, or fixes you wish to send to me, send me a private message on here. I may not respond (since I am often busy being
foneman's grunt), but I will read it and make changes to this process as I see fit.
- I borrowed from instructions that others have provided, particularly Tony. Again, I thank him for taking the time to write what he did.
- Oh, and as a note... I am not trying to supercede what has been done before, just offering a way to build upon and simplify things based on what has already been provided, especially for those who want to apply this to larger setups. This is not, in any way, a one-size-fits-all solution.