faxrcvd and samba share based off of device

Help
dustin
2011-09-29
2013-05-30
  • dustin

    dustin - 2011-09-29

    Does anyone have any code or examples of how to save the faxes to another folder/samba share based off of devie
    Since avantfax changed the the way faxrcvd works and it not longers calls the FaxDispatch is there another way of doing this.

    Thanks

     
  • Dave

    Dave - 2011-09-30

    Simply remove the FaxRcvdCmd setting from your modem configuration files (config.ttySX) in order to use HylaFAX's faxrcvd/FaxDispatch again.

    Then in your FaxDispatch, add:

    if ; then
    /var/www/avantfax/includes/faxrcvd.php $FILE $DEVICE $COMMID $MSG $CALLID1 $CALLID2 $CALLID3 $CALLID4
    fi

    So that your faxes continue to be added to AvantFAX.

     
  • rhoath

    rhoath - 2011-10-12

    I did something similar (but without the samba share), and change the code in faxrcvd under the printer to copy files to a diffrent directory based on the device the fax came in on. I then added the directory pathing in advantfax under the modem configuration so that I can make any changes to avantfax and not have to rewrite the code, amke it easy to add and remove paths quickly.

    Granted this does kill your ability to send faxes directly to a printer but we nevered planed to use a printer anyways.

    HTH

    Rhoath

     
  • Dave Dewberry

    Dave Dewberry - 2012-04-13

    Hi.  Could you post an example of what you add to the printer section?

    Thanks, Dave

     
  • rhoath

    rhoath - 2012-04-13

    Sure Dave,

    I modified the file "/var/spool/hylafax/bin/faxrcvd" by placing the code below under the printer section of that file. I created a folder outside of the hylafax directory to copy the new files to and shared that folder with our users. The next step was to specify the new file location in advantfax under the modem by placing the path to the folder "/faxinbox/accounting" were it says Printer:.

    Like I said this worked for us because we have no plans on printing our faxes to a printer ever and this will kill the printing of faxes directly to a printer.

    //
    // PRINTING SUPPORT
    //
    if ($PRINTFAXRCVD == true) {
    avantfaxlog("Modemid is $modemdev", true);//log the copy of the file
    avantfaxlog("filepath is $printer", true);//log the copy of the file
    avantfaxlog("company is $company", true);//log the copy of the filed

    if ($modemdev == "ttyS10") { // check for modem ttyS10
    Copy($faxfile, "$printer$company-JID$faxid.tif");//copy file to new location if found
    chmod("$printer$company-JID$faxid.tif", 0775);
    avantfaxlog("faxrcvd> Sending fax $faxfile to folder $printer$company-JID$faxid.tif", true);//log the copy of the file
    } elseif ($modemdev == "ttyS11") { //check for device ttyS11
    Copy($faxfile, "$printer$company-JID$faxid.tif");//copy file to new location if found
    chmod("$printer$company-JID$faxid.tif", 0775);
    avantfaxlog("faxrcvd> Sending fax $faxfile to folder $printer$company-JID$faxid.tif", true);//log the copy of the file
    }//close for modemdev if statment

    }
    exit;

     
  • Dave Dewberry

    Dave Dewberry - 2012-04-24

    Thank you very much for your reply, I finally took a look at this today.
    I replaced ttyS10 with ttyIAX0 in your printing support code and added the path /images/fax to the modems in Avantfax but faxes are not getting printed. 
    Any idea what I've missed or where I can get a fuller log of the activity?  I've pasted the Avantfax log below.  The permissions for /images/fax are 777.

    23.04.2012 16:47 faxrcvd> Fax sent to MODEM contact fo@example.com
    23.04.2012 16:47 send_mail> 'fax: XXXXXXXXX 23.04.2012 16:46' sent to 'fo@example.com' from 'jkmdoffice@gmail.com' - /var/www/html/avantfax/faxes/recvd/2012/04/23/XXXXXXXXX/000000043/fax.pdf ()
    23.04.2012 16:46 FaxArchive> faxcontent (1183 chars) set for faxid '50'
    23.04.2012 16:46 ocr_faxcontent> processed /var/www/html/avantfax/faxes/recvd/2012/04/23/XXXXXXXXX/000000043/fax.tif in 4.4 s
    23.04.2012 16:46 faxrcvd> Inserted /var/www/html/avantfax/faxes/recvd/2012/04/23/XXXXXXXXX/000000043 from XXX-XXX-XXXX to Inbox
    23.04.2012 16:46 ArchiveIn> fax '/var/www/html/avantfax/faxes/recvd/2012/04/23/XXXXXXXXX/000000043' from fax number 'XXX-XXX-XXXX' - ttyIAX0
    23.04.2012 16:46 tiff2pdf> successfully created /var/www/html/avantfax/faxes/recvd/2012/04/23/XXXXXXXXX/000000043/fax.pdf
    23.04.2012 16:46 faxrcvd> PROCESSING FAX from 'XXX-XXX-XXXX' (2 pages) received '2012:04:23 16:46:01'
    23.04.2012 16:46 faxrcvd> executing: recvq/fax000000043.tif ttyIAX0 '000000087' '' CIDNum: '' CIDName: '' DID: ''
    23.04.2012 16:45 dynconf> checking CallID1 EMPTY CALLID on device /dev/ttyIAX0

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks