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