Upgrade 3CX to v18 and get it hosted free!

Fax Configurator

Author image

Fax Configurator

In short:

Originally an agi-bin program, this Fax Configurator macro presents a menu to easily toggle a DID number from delivering an incoming fax directly to a real fax machine, a computer fax-modem, network printer, or via email as a pdf attachment.

In detail:

The core of this usage example is an extension that presents status information on how the fax configurator is currently set, along with an opportunity to change it to a new setting. Specifically:

1. Plays an intro greeting to let you know that you made it to the fax configurator
2. Reminds you of the incoming fax number, or the DID, that you will be altering the configuration for.
3. Tells you which option the fax configurator is currently set to.
4. Tells you what the various options are — its important to alter this message to suit your needs.
5. Reads in the new option.
6. Tells you what the fax configuratior is currently set to.


exten => 329,1,Answer
exten => 329,2,Playback(fax-configurator/reached)
exten => 329,3,Playback(fax-configurator/for-number)
exten => 329,4,SayDigits(2120162315)
exten => 329,5,Playback(fax-configurator/currently-using-option)
exten => 329,6,Set(FAXDIRECTION=${DB(faxconfigurator/direction)})
exten => 329,7,SayDigits(${FAXDIRECTION})
exten => 329,8,Read(newfaxdirection,fax-configurator/redirect-options,1)
exten => 329,9,Playback(fax-configurator/currently-using-option)
exten => 329,10,Set(DB(faxconfigurator/direction)=${newfaxdirection})
exten => 329,11,SayDigits(${newfaxdirection})
exten => 329,12,Hangup

To record your own greetings, see the Asterisk cmd Record page and make a directory /var/lib/asterisk/sounds/fax-configurator with sound files named as shown above, moving them into place.

Elsewhere, your incoming fax extension can look like this. It is assumed that all calls for your receiving fax DID are sent here:


[incoming-fax]

exten => s,1,Set(FAXDIRECTION=${DB(faxconfigurator/direction)})
exten => s,2,Verbose(Fax configurator set to option ${FAXDIRECTION})
exten => s,3,GotoIf($["${FAXDIRECTION}" = "1"]?7)
exten => s,4,GotoIf($["${FAXDIRECTION}" = "2"]?8)
exten => s,5,GotoIf($["${FAXDIRECTION}" = "3"]?9)
exten => s,6,GotoIf($["${FAXDIRECTION}" = "4"]?10)
exten => s,7,Dial(Zap/1|20,t)
exten => s,8,Dial(Zap/2|20,t)
exten => s,9,Goto(dsp-fax,s,1)
exten => s,10,Goto(email-fax,2201,1)
exetn => s,103,Dial(Zap/2|20,t)
exten => s,104,Hangup

Zap devices

The example above sends fax configurator option 1 to a Zap device, which happens to be a fax modem in a computer. Option 2 goes to a Zap device connected to a real fax machine.

DSP Fax

For the dsp-fax section, see the SpanDSP and rxfax topics at Asterisk fax, along with the scripts below.

gs-front.sh

#!/bin/sh

if [ “$1” == “” ]; then
echo Sorry, you must specify a pdf file.
exit -1
fi

pdf_file=”$1″

if [ ! -e “$pdf_file” ]; then
echo Sorry, pdf_file “$pdf_file” does not exist.
exit -1
fi

gs -q -dSAFER -dNOPAUSE -dBATCH -r600 -sDEVICE=ljet4 -sOutputFile=- “$pdf_file”

network-print.sh

#!/bin/sh

FILTER_DEF=/usr/src/magicfilter-2.3.h/filters/ljet4l.def
FILTER=/usr/local/bin/magicfilter

if [ ! -e “$FILTER” ]; then
exit -1
fi

if [ ! -e “$FILTER_DEF” ]; then
exit -1
fi

(echo ‘print -‘; “$FILTER” “$FILTER_DEF”) | \
/usr/bin/smbclient -I 192.168.1.51 -N \\\\192.168.1.51\\HP

For this network print example, magicfilter is used to convert the ghostscript output into a form suitable for a laserjet printer. The printer in turn is physically connected to a Windows XP machine which is accessible as a windows share, with smbclient.

Email fax

For details on how the email-fax section would be set up, see the fax section and mailfax script at Scott Laird’s page Faxing with Asterisk


Article Reviews

Write a Review

Your email address will not be published. Required fields are marked *

Required Field. Minimum 5 characters.

Required Field. Minimum 5 characters, maximum 50.

Required field.There is an error with this field.

Required Field.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

There are no reviews for this article. Be the first one to write a review.

Related Posts:

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.