FreePBX 2.7: Fax For Asterisk Setup

Socs28

New Member
Joined
Mar 5, 2010
Messages
54
Reaction score
0
Here's my setup

Using FFA, and the FreePBX 2.7 setup, and then taking the FAXIT context from here, you can have in and out faxing up very quickly. It just takes a couple edits.

Here is what the sendfax and faxit contexts will look like, they're both changed a bit, mainly because of using SendFAX instead of TxFAX, and you'd want to put your info in:

[sendfax]
exten => s,1,Answer
exten => s,2,Wait(1)
exten => s,3,NoOp(NEWFILENAME: ${NEWFILENAME})
exten => s,4,SendFAX(${NEWFILENAME})
exten => s,5,Hangup()
[faxit]
exten => s,1,Wait(1)
exten => s,n,Set(TIMEOUT(digit)=7)
exten => s,n,Set(TIMEOUT(response)=10)
exten => s,n,Flite("Place the PDF document with a matching destination phone number in the server's Outgoing directory. To proceed: please enter the fax destination phone number now: ")
exten => s,n,Background(beep)
exten => s,n,Read(NUM2CALL,beep,10)
exten => s,n,GotoIf($["foo${NUM2CALL}" = "foo"]?2,1)
exten => s,n,Flite("Your fax will be sent to the following number:")
exten => s,n,SayDigits(${NUM2CALL})
exten => s,n,Background(custom/nv-press8)
exten => s,n,WaitExten(10)
exten => s,n,Goto(2,1)
exten => i,1,Goto(2,1)
exten => o,1,Goto(2,1)
exten => 2,1,Flite("Your fax request has been cancelled.")
exten => 2,2,Background(goodbye)
exten => 2,3,Hangup()
exten => 8,1,Set(CID=${CALLERID(num)})
exten => 8,n,Set(INFILE=/fax/${NUM2CALL}.pdf)
exten => 8,n,Set(OUTFILE=/fax/${NUM2CALL}.tif)
exten => 8,n,System(gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=tiffg3 -sOutputFile=${OUTFILE} -f ${INFILE})
exten => 8,n,System(echo Channel: local/${NUM2CALL}@from-internal > /fax/${CID})
exten => 8,n,System(echo SetVar: LOCALHEADERINFO=Yourinfohere >> /fax/${CID})
exten => 8,n,System(echo SetVar: LOCALSTATIONID=Yourfaxnumberhere >> /fax/${CID})
exten => 8,n,System(echo SetVar: FAXRECEIVER=${NUM2CALL} >> /fax/${CID})
exten => 8,n,System(echo SetVar: NEWFILENAME=${OUTFILE} >> /fax/${CID})
exten => 8,n,System(echo Context: sendfax >> /fax/${CID})
exten => 8,n,System(echo Extension: s >> /fax/${CID})
exten => 8,n,System(echo Priority: 1 >> /fax/${CID})
exten => 8,n,System(echo Callerid: ${CID} >> /fax/${CID})
exten => 8,n,System(echo MaxRetries: 0 >> /fax/${CID})
exten => 8,n,System(echo WaitTime: 50 >> /fax/${CID})
exten => 8,n,System(chmod 775 /fax/${CID})
exten => 8,n,System(echo sleep 10 > /fax/${CID}.2)
exten => 8,n,System(echo mv /fax/${CID} /var/spool/asterisk/outgoing >> /fax/${CID}.2)
exten => 8,n,System(chmod 775 /fax/${CID}.2)
exten => 8,n,Background(thank-you-for-calling)
exten => 8,n,Background(goodbye)
exten => 8,n,Hangup()
exten => h,1,System(/fax/${CID}.2)

Other than that, use the FFA instructions, setup fax in FreePBX, make sure you drop the minimum rate to a low speed, because there are some old fax machines out there. I know it is working over SIP for me at my office, as well as a client install. My install is on Asterisk 1.6.2.6, my client is on 1.6.1.16. You still need:

exten => 32948,1,Answer
exten => 32948,n,Wait(1)
exten => 32948,n,Goto(faxit,s,1)

in from-internal-custom
I have edited where my outgoing faxes get picked up from, you may have noticed, but that doesn't really make any difference, other than for my sanity sake.
 

RonRussell

Guru
Joined
Mar 22, 2008
Messages
112
Reaction score
4
Last edited by a moderator:

oneadvent

New Member
Joined
Nov 10, 2009
Messages
162
Reaction score
0
I upgraded to 2.7 and the hylafax/avantfax solution still works fine.

Now if Google Voice just took the fax on its own, i'd be happy, but until then, this works.
 

darmock

PIAF Developer
Joined
Oct 18, 2007
Messages
2,892
Reaction score
98
Amen..... the next release of PIAF will use freepbx 2.6.0 as the base install. Course I am sure we will get flamed for using it but too bad. Luckily once you install the new version you can upgrade to your hearts content.

I keep testing things in our lab....... but....


Tom
 

agchenry

New Member
Joined
Jul 16, 2010
Messages
9
Reaction score
0
if i configured Ward's incredible PBX and i added just 1 sip trunk. (i dial 9 before the number to use that particular trunnk) How can i make all my faxes go out the sip i added. I tried adding 9 to the number and 9 to the pdf file but after i dial faxit it asks for out going number and i can just input 10 unmbers?? I just cant figure it out. :banghead:
 

merk

Guru
Joined
Sep 5, 2008
Messages
66
Reaction score
1
Yes I get an error -
Code:
root@pbx:~/fax/agx-ast-addons $ ./build.sh 
-- Configuring done
-- Generating done
-- Build files have been written to: /root/fax/agx-ast-addons
[ 12%] Built target app_devstate
[ 25%] Built target app_nv_backgrounddetect
[ 37%] Built target app_nv_faxdetect
[ 50%] Built target app_pickup2
[ 62%] Building C object CMakeFiles/app_rxfax.dir/app_rxfax.o
cc1: warnings being treated as errors
/root/fax/agx-ast-addons/app_rxfax.c: In function âphase_e_handlerâ:
/root/fax/agx-ast-addons/app_rxfax.c:107: warning: implicit declaration of function ât30_get_local_identâ
/root/fax/agx-ast-addons/app_rxfax.c:108: warning: implicit declaration of function ât30_get_far_identâ
/root/fax/agx-ast-addons/app_rxfax.c:110: error: ât30_stats_tâ has no member named âpages_transferredâ
/root/fax/agx-ast-addons/app_rxfax.c:127: error: ât30_stats_tâ has no member named âpages_transferredâ
/root/fax/agx-ast-addons/app_rxfax.c:137: error: ât30_stats_tâ has no member named âpages_transferredâ
/root/fax/agx-ast-addons/app_rxfax.c:140: error: dereferencing pointer to incomplete type
/root/fax/agx-ast-addons/app_rxfax.c:143: error: ât30_stats_tâ has no member named âpages_transferredâ
/root/fax/agx-ast-addons/app_rxfax.c: In function âphase_d_handlerâ:
/root/fax/agx-ast-addons/app_rxfax.c:170: error: ât30_stats_tâ has no member named âpages_transferredâ
/root/fax/agx-ast-addons/app_rxfax.c:180: error: ât30_stats_tâ has no member named âpages_transferredâ
/root/fax/agx-ast-addons/app_rxfax.c: In function ârxfax_execâ:
/root/fax/agx-ast-addons/app_rxfax.c:199: error: storage size of âfaxâ isnât known
/root/fax/agx-ast-addons/app_rxfax.c:318: warning: implicit declaration of function ât30_set_local_identâ
/root/fax/agx-ast-addons/app_rxfax.c:321: warning: implicit declaration of function ât30_set_header_infoâ
/root/fax/agx-ast-addons/app_rxfax.c:323: warning: passing argument 2 of ât30_set_phase_b_handlerâ from incompatible pointer type
/root/fax/agx-ast-addons/app_rxfax.c:324: warning: passing argument 2 of ât30_set_phase_d_handlerâ from incompatible pointer type
/root/fax/agx-ast-addons/app_rxfax.c:199: warning: unused variable âfaxâ
make[2]: *** [CMakeFiles/app_rxfax.dir/app_rxfax.o] Error 1
make[1]: *** [CMakeFiles/app_rxfax.dir/all] Error 2
make: *** [all] Error 2

I hate to revive a dead thread but I am having this exact same issue. Were you able to solve it or did you just swap out the pc?

I should mention this is a x64 machine and I am getting that error when install fax.pbx and when doing it manuall by compiling asterisk.
 

RonRussell

Guru
Joined
Mar 22, 2008
Messages
112
Reaction score
4
Merk, Did you follow these directions?
After building a completely new system (to replace the one we upgraded to FreePBX 2.7) using PIAF 1.6, updating FreePBX 2.5.2.2 modules, installing Ward's fax.pbx script (http://nerdvittles.com/index.php?p=237) and Joe's HylaFAX/AvantFax (http://pbxinaflash.com/community/threads/hylafax-avantfax-for-piaf-parts-1-4.3645/?t=3645), I now have a working inbound and outbound PBX/Fax server. Thanks Ward and Joe. My advice - Do NOT upgrade to FreePBX 2.7.
 
Last edited by a moderator:

merk

Guru
Joined
Sep 5, 2008
Messages
66
Reaction score
1
Merk, Did you follow these directions?

Yea but we upgraded to FreePBX 2.8 and then tried to install the scripts as per Wards directions. The issue is that Wards script fails. I will retry with a fresh install before updating to freepbx 2.8.


Side question - Has anyone successfully installed the fax script on a x64 system?


EDIT: Ok so I think I found the problem, its with cmake not installing. I am getting the error "libncurses.so.5 is needed by cmake-2.4.8-3.el5.i386" so cmake is failing which is causing the script to fail. I am looking online for libncurses.so.5 and will report back. So far no luck searching.
 

HavocStyles

New Member
Joined
Apr 6, 2010
Messages
20
Reaction score
0
Yeah I'm in the same boat right now as well, upgraded to 2.8 and Fax is hosed, going to lurk on this thread and wait and see what the best fix is for this issue, just not sure which module I want to use now. I'm not running x64 version but check and see if you have the ncurses library installed.

yum search ncurses

ncurses.i386 : A terminal handling library
ncurses-devel.i386 : Development files for the ncurses library

Your error sounds like cross compile issue, possibly related to x64 (just a guess) :rolleyes5:


Yea but we upgraded to FreePBX 2.8 and then tried to install the scripts as per Wards directions. The issue is that Wards script fails. I will retry with a fresh install before updating to freepbx 2.8.


Side question - Has anyone successfully installed the fax script on a x64 system?


EDIT: Ok so I think I found the problem, its with cmake not installing. I am getting the error "libncurses.so.5 is needed by cmake-2.4.8-3.el5.i386" so cmake is failing which is causing the script to fail. I am looking online for libncurses.so.5 and will report back. So far no luck searching.
 

merk

Guru
Joined
Sep 5, 2008
Messages
66
Reaction score
1
hey ward.

Thanks for the reply but I tried that and i get "no package cmake to install".
 

ghurty

Senior Member
Joined
Jan 13, 2009
Messages
852
Reaction score
4
I installed cmake but I am still having the same problem
 

ghurty

Senior Member
Joined
Jan 13, 2009
Messages
852
Reaction score
4
Possibly because the error said it couldn't find libncurses so that it could install cmake. Try this:


yum install ncurses*


I just ran it, and it succufully installedtwo new items. But I still get an error:

Code:
root@pbx:~/fax/agx-ast-addons $ ./build.sh
CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 2.8)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: /root/fax/agx-ast-addons
[ 12%] Building C object CMakeFiles/app_devstate.dir/app_devstate.o
cc1: warnings being treated as errors
/root/fax/agx-ast-addons/app_devstate.c:45: warning: initialization from incompatible pointer type
/root/fax/agx-ast-addons/app_devstate.c:45: warning: initialization makes integer from pointer without a cast
/root/fax/agx-ast-addons/app_devstate.c:45: error: initializer element is not computable at load time
/root/fax/agx-ast-addons/app_devstate.c:45: error: (near initialization for âcli_dev_state.inuseâ)
/root/fax/agx-ast-addons/app_devstate.c: In function âdevstate_cliâ:
/root/fax/agx-ast-addons/app_devstate.c:61: warning: âast_device_state_changed_literalâ is deprecated (declared at /usr/include/asterisk/devicestate.h:192)
/root/fax/agx-ast-addons/app_devstate.c:63: warning: âast_device_state_changed_literalâ is deprecated (declared at /usr/include/asterisk/devicestate.h:192)
/root/fax/agx-ast-addons/app_devstate.c: In function âdevstate_execâ:
/root/fax/agx-ast-addons/app_devstate.c:96: warning: âast_device_state_changed_literalâ is deprecated (declared at /usr/include/asterisk/devicestate.h:192)
/root/fax/agx-ast-addons/app_devstate.c: At top level:
/root/fax/agx-ast-addons/app_devstate.c:122: error: âAST_FORMAT_MAX_AUDIOâ undeclared here (not in a function)
/root/fax/agx-ast-addons/app_devstate.c: In function âaction_devstateâ:
/root/fax/agx-ast-addons/app_devstate.c:164: warning: âast_device_state_changedâ is deprecated (declared at /usr/include/asterisk/devicestate.h:175)
make[2]: *** [CMakeFiles/app_devstate.dir/app_devstate.o] Error 1
make[1]: *** [CMakeFiles/app_devstate.dir/all] Error 2
make: *** [all] Error 2
Thanks
 
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