1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. If you had a PIAF Forum account in the vBulletin days, log in with your old credentials. Otherwise, sign up again and we'll get you back in business as soon as we can.
  3. A serious FreePBX vulnerability has been reported. Update your Framework Module immediately. Click here for details.
  4. Critical FreePBX vulnerability! Update your server immediately. Details here.

FreePBX 2.7: Fax For Asterisk Setup

Discussion in 'Help' started by Rrrr, Mar 16, 2010.

  1. Socs28 New Member

    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.
  2. RonRussell Guru

  3. oneadvent New Member

    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.
  4. darmock PIAF Developer

    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
  5. agchenry New Member

    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:
  6. merk Guru

    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.
  7. RonRussell Guru

    Merk, Did you follow these directions?
  8. merk Guru

    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.
  9. HavocStyles New Member

    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:


  10. wardmundy Nerd Uno

    yum install cmake*
  11. merk Guru

    hey ward.

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

    I installed cmake but I am still having the same problem
  13. edisoninfo Guru

    Possibly because the error said it couldn't find libncurses so that it could install cmake. Try this:


    yum install ncurses*
  14. ghurty Senior Member


    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

Share This Page