TUTORIAL HylaFAX / AvantFax for PIAF! - Parts 1-4

phinphan

Active Member
Joined
Oct 19, 2007
Messages
641
Reaction score
130
Tshif - thanks for the great guide. I know have it up and running and am faxing away to my heart's content. Thanks to Joe for the scripts as well.
 

jroper

Guru
Joined
Oct 20, 2007
Messages
3,832
Reaction score
71
Hi

My understanding is that when you create a new user in avantfax, you can select the fax modems they use, and therefore the CID information against each iaxmodem.

Joe
 

phinphan

Active Member
Joined
Oct 19, 2007
Messages
641
Reaction score
130
I tried that and it did not seem to limit the outgoing faxes. It seems to only limit the iaxmodems that they can see.
 

tshif

Guru
Joined
Jan 3, 2008
Messages
1,240
Reaction score
4
I would like to be able to change the fax header based upon the id of the user connecting to hylafax/avantfax. I thought about changing the header info on each of the 4 iaxmodems that are defined but I don't know how to limit a particular user to a particular iaxmodem. Has anyone figured this out. I have been working my way through the hylafax/avantfax mailing list archives with no success so far.

Im preparing an article on this topic right now - should be ready in a couple of days, tops.

In fact - I plan on covering several really cool things. Adding another department to the fax server, adding a "dedicated" fax (inbound and outbound) to an idividual (for executive use, etc.), and using NVDetect so that your users may have a fax placed right on their regular DID line - so it can be used for voice and fax calls without a dedicated fax did. I also hope to cover changing the Fax cover sheets, and the Fax headers for the modems.

Anyone else have something special that you would like covered - let me know. Always happy to hear about your challenges - as well as your successes.

-tshif
 

markiper

Member
Joined
Oct 22, 2007
Messages
198
Reaction score
5
Thanks Joe, that did the trick fro me...

I was able to successfully change the AVANTFAX signature sent on every e-mail generated from avantfax to something that suited my company name. As you mentioned, just looking at the following location:

In respect of the email, I'm guessing, but it looks likely that changing around line 187 of config.php in /var/www/html/avantfax/includes should do what you need it to do.

edit: - looking again, local_config.php may be more appropriate - line 238. Try this first.[/QUOTE]

and changing line 238 to what is suitable for your installation will do the trick. I have not been able to test the COVER PAGE (as I do not have a fax to sent it to for someone to look at the output) generated by avantfax when sending the faxes through the web interface, but I am assuming that this will also follow the changes made on the local_config.php file that I modify. I will try to check this tomorrow sometime when I have access to a second fax, but for the time being this works like a charm.

I can certainly hope that we can make a summary of all the things that different people have change to customize this fax application for eveyone in the forum to benefit from it, as I said before, it is an excellent applicaiton and now that more companies are trying to go GREEN (not the Trix... way), this comes really handy.

Regards,
markiper
 

markiper

Member
Joined
Oct 22, 2007
Messages
198
Reaction score
5
COVER PAGE also modified ...

Even though I have tried a number of things, I have been unsuccesful to modify the COVER PAGE from AVANTFAX to somwething else without branding on it. Here is what I have tried so far, and if anyone have any more ideas, please let me know.

Using GIMP and installing a ghostscript you can open the the COVER.PS file that is used as a fax cover page every time that you use AVANTFAX interface to send a fax.

GIMP can be downloaded form the following site:

http://www.gimp.org/downloads

The ghostscript and procedure to open eps files (files with extension .ps) are posted int he following link:

http://www.squidoo.com/epsGIMP

I thought that GIMP will allow me to modify this file, but no luck. Then I tried a vector graphic editor program called Inkscape (http://www.inkscape.org), which can actually open the file after the COVER.PS is converted to COVER.PDF, and correctly edit the file and save it as a Postcript file once again, but upon loading this new file into the AVANTFAX directory:

/var/www/html/avantfax/images

and changing line 245 of the local_config.php file on:

/var/www/html/avantfax/includes

to adjust it to the new cover page filename, I had not luck at all. After all this work, the new file that I created is sent as the cover page, but the XXX- variables are not recognized; therefore the cover page is completely incorrect. The only thing I have not tried is to create my own PS file to use it as cover letter, but I will try this later tomorrow. If anyone in the forum has succesfully changed the COVER.PS to something without the AvantFax brading on it, please post your comments so that all of us can benefit from it.

Regards,
markiper
 

tshif

Guru
Joined
Jan 3, 2008
Messages
1,240
Reaction score
4
Adding a Dedicated Virtual Fax Machine / DID & Sharing A VoIP DID w/ Fax - Part 1

Adding a Dedicated Virtual Fax Machine / DID & Sharing A VoIP DID w/ Fax

Sometimes, such as in the case of the HR department, or certain executives, it will be desirable to have a dedicated “virtual fax machine” that is privatized for these purposes. This also allows dedicated routing on receipt of fax, and dedicated Caller ID Header information sent with the faxes from these setups.

Its also nice to be able to “put a fax machine” on virtually any extension using NVDetect – so well work through preparing Asterisk for that, and deploying a combo Voice Extension/Fax Machine.

Adding a virtual modem to Hylafax isn’t complicated, but there are several details. Follow these carefully and you will be able to add as many modems as you like.

To accomplish this, we set up a FreePBX extension to function as the “virtual fax machine”. Then, we create a new iaxmodem in etc/iaxmodem, add a faxgetty, run the fax admoodem process in HylaFax, and then add the modem in Avantfax. Whew – well, I said there were a lot of steps!

Keep in mind however, that the total number of modems that can be supported depend upon a lot of factors. In general, more than four modems in use concurrently could be a problem – or might be just fine.

SetUp “Fax Machine” Extension in FreePBX

In FreePBX, Setup, Extensions, Add Extension, add a Generic IAX2 Device.
Create the extension with the following Characteristics:
Display Name: Bob’s Fax (Give it a Descriptive Name)
Outbound CID: As appropriate
Secret: An Appropriate STRONG secret

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 <=== * Must be unique
qualify=yes
disallow = all
allow = ulaw
permit = 127.0.0.1/255.255.255.0

*This must be a unique port. I selected 4574 because the first 4 virtual modems are already set to use ports 4570-4573. Each time you add a new Virtual modem, increment this port by 1.

Do not enable voice mail or VMX.

SetUp “Fax Machine” Peer in iax_custom.conf (new instruction)
In freePBX using config editor, aqdd the following to the bottom of the iax_custom.conf file:

[iax-fax4]
type=friend
host=127.0.0.1
port=4574
context=from-internal
disallow=all
allow=ulaw
jitterbuffer=no
qualify=yes
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
secret= XXXXXX<=== The same strong secret you assigned to the shared fax occurrence, above.

Save your changes.

Create new IAX Modem
Next, we create the new iaxmodem in /etc/iaxmodem.We need to make a copy of one of the existing iaxmodem-cfg.ttyIAX files, and edit it to suit our needs. Copy one of the files to your desktop, and then rename the file to the next modemin the series. We will be naming the file:

iaxmodem-cfg.ttyIAX4.

Make sure that when you name the files, you match the case exactly as the other are done, or this wont work at all.

Open the file and edit the following lines as indicated. Do Not Change any other lines.


device /dev/ttyIAX4 <=== This is the 4th modem
port 4574 <=== This must match the port used when the FreePBX Fax Modem extension was created
peername xxx <=== Fax Extension number created in FreePBX
cidname B. Jones <===The Caller ID Name sent from this Fax Machine
cidnumber 1234567890 <=== The Caller ID Number sent from this Fax Machine
secret 274329 <=== NEW LINE. This is the secret used in the FreePBX fax extension created in FreePBX[FONT=&quot]for [/FONT]this purpose

Save your changes, and copy the file to /etc/iaxfaxmodems


Update initab
Using your favorite editor, modify the file /etc/inittab.

Look at the bottom of the file and you will se the lines added for the other virtual modems, add a line that looks like this:

t4:23:respawn:/usr/sbin/faxgetty ttyIAX4 > /var/log/iaxmodem/iaxmodem.log

And Save your changes.

New Instruction: Reboot your PBX now - and then proceed with the remaining directions.

Run FAXADDMODEM
Logged in as root, run faxaddmodem
When you are prompted for the modem name, enter: [FONT=&quot]ttyIAX4 (Case exact!)[/FONT]

Answer the remaining prompts as appropriate for your installation.

Add the New fax Category AvantFax
Log into the Avantfax UI as the super admin user, and Select FAX CATEGORIES from the drop down box. Enter Bobs Faxes and click CREATE.

Add the Modem to AvantFax
Still logged into the Avantfax UI as the super admin user, and Select MODEMS from the drop down box.
Make a new modem with the following characteristics:

Device = ttyIAX4 (case EXACT)
Alias = ttyIAX4 (Or, alternately, a friendly name like “Bobs Fax”
Contact = the email address that every fax received on this virtual fax machine will be sent to
Category = Bobs Faxes

Click on CREATE when you have the characteristics as desired.

Configure Bob's AvantFax User ID.
If you haven’t Created Bob’s AvantFax user id yet, do that NOW. Don’t forget to assign him to his own fax category (Bobs Faxes), and restrict him from seeing any modems other than his own (IAX4).

Fix the HylaFAX Modem Device File
Using your favorite Editor, locate and open the file: /var/spool/hylafax/etc/config.ttyIAX4
To the bottom of this file, add the following lines:
[FONT=&quot]#[/FONT]
[FONT=&quot]## AvantFAX[/FONT]
[FONT=&quot]#[/FONT]
[FONT=&quot]FaxRcvdCmd: bin/faxrcvd.php[/FONT]
[FONT=&quot]DynamicConfig: bin/dynconf.php[/FONT]
[FONT=&quot]UseJobTSI: true[/FONT]

[FONT=&quot]JobReqNoAnswer: 180[/FONT]
[FONT=&quot]JobReqNoCarrier: 180[/FONT]

Save your changes.

Its now time to reboot your system – so all the configs will take place correctly.

Configure DID for Virtual Fax Machine
From within FreePBX, Setup, Inbound Routes, create an inbound route for the DID that is to service this dedicated fax machine. Point it at the Extension we created for this virtual fax machine (Bobs Fax).

That’s it – all the heavy lifting is done. Test this out by sending a fax to the DID and note that it is being received on the IAX4 faxmodem.

I should point out that there are several other ways we could have achieved this same result –and in future article we might explore those methods. If you find one that you like – share it with us too.

The reasons I chose this method are really twofold. First, most of the work in FreePBX is done in the extensions interface, rather than be editing and creating conf file entries by hand. And second, this method translates very well into our next topic – sharing a DID with voice and fax.

See Adding a Dedicated Virtual Fax Machine / DID & Sharing A VoIP DID w/ Fax - Part 2
 

tshif

Guru
Joined
Jan 3, 2008
Messages
1,240
Reaction score
4
Adding a Dedicated Virtual Fax Machine / DID & Sharing A VoIP DID w/ Fax - Part 2

Adding a Dedicated Virtual Fax Machine / DID & Sharing A VoIP DID w/ Fax - Continued
Preparing Asterisk

In order to be able to share a DID between voice and fax, we need to enable the NVDetect function that we see referenced in the inbound route Fax Detection settings of FreePBX. To do this enabling, we must add a couple sections of new source, and recompile asterisk.

At this moment, you should pat yourself on the back for being smart enough to choose a distribution like FreePBX, or Fonicatec PABX, because they are source based. You should also send at least a $25 donation to the PBXIAF project – because it it weren’t for the way this distribution is put together (Source based, making this entire recompile possible) – the next few steps would be a lot harder, if not impossible.

Contraindications
If you have already activated NVDetect in Asterisk – do not perform this step again. If you have performed installation of Ward’s Fax Solution, this step has already been performed.

Patching Asterisk
If you don’t think you should try this – don’t. It’s not hard – but you can certainly bring your system to it’s knees with surprising finality should mistakes be made.

Log into your PBX as root, using putty or your favorite program, execute these lines:
(Updated 3.20.2009)
Code:
cd /usr/src/asterisk/apps
wget [URL]http://agx-ast-addons.svn.sourceforge.net/svnroot/agx-ast-addons/trunk/app_nv_backgrounddetect.c[/URL]
wget [URL]http://agx-ast-addons.svn.sourceforge.net/svnroot/agx-ast-addons/trunk/app_nv_faxdetect.c[/URL]
cd ..
make distclean
make clean
./configure
make menuselect


From the menu, select applications, and press enter.

Scroll down to the entries for:

app_nv_backgrounddetect
app_nv_faxdetect

And make sure they have stars in front of them (Press the space bar to toggle the stars).
The, press ESCAPE, and then the letter “S”.

Then enter these lines:
Code:
make
make install
When these complete, restart your PBX. When it reboots, NVfax Detect will be available on your machine.

Do not be alarmed by the “warnings” that appear after compiling Asterisk. They are general warnings only and do not indicate a problem.

Now that we have recompiled Asterisk to include the NVDetect function, we can move on to configuring FreePBX.

Managing Mary
For this exercise, well be configuring Marys phone and fax. Mary works offsite, has a SIP phone, and a burning desire to send and receive faxes.

Step 1: Get Mary’s regular DID service set up, and routed to her extension the way you always do. Voice mail, and all – just the same way you normally do. Make sure its working!

Step 2: Go through all the steps we just went through to create BOBS FAX, earlier in the article. You will make a FreePBX extension called Marys Fax, and this time, when creating IAXmodem, create IAX5. Don’t miss ANY of the steps.

Once you have created the FreePBX extension, and the IAXmodem configuration to be used for Marys shared voice/fax line, perform the following steps:

In FreePBX, under Setup, Inbound Routes, select Mary’s inbound DID. Locate the Fax Handling Section, and give it the following characteristics:

Fax Extension: Marys Fax
Fax Email: Not Used
Fax Detection Type: NVFax
Pause After Answer: 5 <=== The typical values for this are between 2-5.

Leave the inbound route destination to be Mary’s Extension, just as always.

That’s all folks! Now, when you call Marys DID with a voice call, it will be send right to Mary’s phone. When a fax reaches that same number, it will be routed to Marys Fax extension, and emailed to her as configured in AvantFax.

Remember – although we didn’t cover it in THIS article, you have to make AvantFax users for Bob and Mary, or they wont have the authority to send faxes. Don’t forget to assign them to their own Fax Categories and specific occurrence of IAXModem when the time comes.

If your wondering about remote users like Mary using print-to-fax, the Winprint Hylax printer driver discussed in the main Hylafax article will only work if the person is on the local network segment (logical) that the PBX is on. So – if Mary want to Print-to-fax, shell have to be on a VPN connection that provides her PC with an IP address from the local subnet. This does NOT mean she must have a VPN connection directly to the PBX, but to the logical subnet on which it resides. Routers that support END POINT PPTP VPN connections are ideal for this. (Snapgear 300 for example).

Hope you all enjoy to new features and configs for our great PBXIAF Hylafax setups!

Until next time –
tshif
 

phinphan

Active Member
Joined
Oct 19, 2007
Messages
641
Reaction score
130
Tshif - WOW. Ask and ye shall receive. On another note, I deleted my users and added them back with Avantfax and limited them to specific Iaxmodems and that seemed to have done the trick. Now the headers are right. Tomorrow I will give the new instructions a try.
 

tshif

Guru
Joined
Jan 3, 2008
Messages
1,240
Reaction score
4
Tshif - WOW. Ask and ye shall receive. On another note, I deleted my users and added them back with Avantfax and limited them to specific Iaxmodems and that seemed to have done the trick. Now the headers are right. Tomorrow I will give the new instructions a try.

:blush5: Thanks for both your very kind comments.

I'm glad re creating the users helped. I wasn't sure what I was going to suggest for that.

Be sure and let us know how the new "Fax Extension" setups work for you.

Tony
 

markiper

Member
Joined
Oct 22, 2007
Messages
198
Reaction score
5
Excellent article Tony...

Thanks a lot for the article on sharing a DID for voice/fax communications, this has great potential. Now, I can only hope to get the branding off of the cover page from AVANTFAX. Not a big deal as you can send your own cover page, but if a remote user sends a fax through the AvantFax web interface, then the AvantFax logo will be included in the heater and footer of the fax.

Regards,
markiper
 

tshif

Guru
Joined
Jan 3, 2008
Messages
1,240
Reaction score
4
Mark - Yeah - Ive been working on that too. Its being very stubborn.
 

markiper

Member
Joined
Oct 22, 2007
Messages
198
Reaction score
5
Indeed....

Today I have tried creating my own cover page as a PostScript file, but still unsuccessful to have this working properly. I will do some more reading and try to figure this out, but it has proven to be more challenging than what I originally thought of.

Regards,
markiper
 

phinphan

Active Member
Joined
Oct 19, 2007
Messages
641
Reaction score
130
Markiper - I was reading through the local_config.php file suggested by Joe and saw where you can use an html file instead of the .ps file. You need to install an html to ps converter (link provided) but editing the html file is much easier. If you want a generic coverpage, copy the coverpage from the hylafax directory /etc/hylafax over to the avantfax directory and rename it. That has no branding. I edited that file and added my firm name to it and it suffices for now.
 

tshif

Guru
Joined
Jan 3, 2008
Messages
1,240
Reaction score
4
phinphan - I found and tried that too - but it didn't work for me. Can you post for all of us the exact steps you took. We'd all be very grateful for your time.
:eurob:
 

jroper

Guru
Joined
Oct 20, 2007
Messages
3,832
Reaction score
71
Hi

I think we need a blank template to modify. If anyone can post a working EPS file that can be edited by say the GIMP and then converted to .ps., that would be really useful.

Joe
 

phinphan

Active Member
Joined
Oct 19, 2007
Messages
641
Reaction score
130
tshif - I was able to edit the hylafax coversheet and use it but it turns out that my printer driver was creating the cover sheet and not the avantfax program on the server. When I try and send the fax from the avantfax page on the server, it gives me an error that the file could not be rendered or something like that.

As for the html cover page, I installed the html2ps program but as a linux noob I cannot figure out how to install. Time to read the linux for newbies article that Ward is always encouraging us to read.
 

markiper

Member
Joined
Oct 22, 2007
Messages
198
Reaction score
5
phinphan - I saw the HTML option for the cover page, but since I am a linux noob, I figure that it will be a lot easier to go the PS way; unfortunately, editing that file did not work for me. :banghead: .... I have not been able to try anything else, but I will jump on this again by the end of the week.

Regards,
markiper
 

phinphan

Active Member
Joined
Oct 19, 2007
Messages
641
Reaction score
130
This cover page thing is incredible. :banghead:I downloaded adobe illustrator and modified the cover.ps file. I followed the instructions on avantfax.com for modifying the coverpage and no joy. Of course, I think I have messed something up as I know have no cover sheets! I think avantfax's real business is selling their cover sheet design service for $150 per page.

On the other hand, I was able to modify the hylafax cover page in notepad and use it with my windows hylafax client for sending the faxes and it works fine.
 

tshif

Guru
Joined
Jan 3, 2008
Messages
1,240
Reaction score
4
Adding “Print on Receive” to AvantFax

Adding “Print on Receive” to AvantFax
Sometimes the most reasonable way to deploy new technology – to overcome objections and simply meet the end users expectations, is to mimic the current system as best we can. That means it can be necessary to print each fax as it is received. AvantFax supports this.

After about 6 hours trying to figure out how to do this, and getting ever so close, Joe Roper chimed in with some excellent trouble shooting steps – and we came up with this process.

This article describes how to activate Print on receive – and direct the print jobs to your network printer. In this case, we use a Printer attached to an HP JetDirect device.

Here’s the size of the task at hand:
    • Ensure that’s Linux cups printing system is enabled at boot up on our PBX
    • Make sure the JetDirect device has IPP printing enabled. Make note of the Jet Direct devices HOST name. Note exact character case.
    • Create A new printer in Webmin, Hardware, Printer Administration.
    • Add this printer name to the Avantfax Modem Printer Field.
The process should be completed within around 5 minutes.

Prepare the JetDirect device
Using the web interface in the JetDirect device, locate and verify that IPP printing is enabled. This is generally found under the network settings section in the JetDirect interface, but varies with model.

While still inside the JetDirect Device, note the HOST NAME of the Jet Direct Device.

Prepare the PBX
Activate CUPS
Since CUPS is the way we will be printing, we need to make sure its started every time we boot our PBX. Using the web browser, navigate to Webmin. Under SYSTEM, Boot up and shutdown. Locate CUPS Printing System on the list, and verify it is set to start on boot up. If not, select it, and press the START NOW AND ON BOOT button at the bottom of the screen.

Create The Printer
We need to create a printer in Linux – so after making sure the printer is turned on and plugged into the network, in Webmin navigate to HARDWARE, Printer Administration, and Select Add New Printer. Create the printer with the following characteristics:
Printer Configuration
Name: Simple, Friendly Name (FaxPrinter1)
Description: As Desired
Print Banner: Optional
Accepting Requests: Yes
Printing Enabled: Yes

Print Destination
Remote Unix Server: IP Address of Printer
Printer: The LaserJet device HOST name, case exact.
Type: IPP

Printer Driver
Generic postscript printer

Set Option as appropriate for your printer, and SAVE your Changes.

If you have made any errors, WebMin will complain that the operation has not been successful. If it does, go back and CHECK YOUR WORK. When you are successful, WebMin will return to the list of printers, with your new printer showing.

Prepare Avantfax
Navigate to the Avantfax web ui and log in as super user admin. Navigate to the Modems List, and select the modem you wish to have print its inbound fax jobs. In the Printer field, enter the Simple Friendly Name (FaxPrinter1), case exact. Save your changes.

That’s it – test it by sending a fax to the modem whose configuration you have just changed. After receiving, your fax should be delivered as a print job to the printer we specified.

until next time –

New info: This process is not fool proof - it seems some JetDirect devices are better at this than others. If you have a choice, make sure to have the most current firmware in your Jet Direct. Let us know about your successes and failures with this process.
 

Members online

Forum statistics

Threads
25,779
Messages
167,505
Members
19,199
Latest member
leocipriano
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top