HylaFAX problems with Virtual FAX

Discussion in 'General' started by Drstrangelove, Jan 25, 2010.

  1. Drstrangelove

    Joined:
    Oct 26, 2009
    Messages:
    28
    Likes Received:
    0
    Hallo,

    1 Week ago we had a nice going virtualFAX until now, the main problem is that we cant receive faxes, we tested it, we send a fax through a external-Fax @ home to the officeFAX, i get a message that the transaction between the two faxes is compleet so the fax is send. but the strange part is we didn't get the fax in our mailbox neither in the FAX-visor. But it worked correctly 1 week ago!

    Is hylafax broken or what?

    Thanks for reading this thread,

    Regards,

    Strangelove
     
  2. Drstrangelove

    Joined:
    Oct 26, 2009
    Messages:
    28
    Likes Received:
    0
    I see what the problems could be, avantfax! I tried to install avantfax and this corrupt the configfiles of hylafax.

    Does some1 has a clue how i can restore this?

    PLEASE PLEASE PLEASE HELP!:(

    Thanks!:blush:
     
  3. saleh

    Joined:
    Apr 18, 2007
    Messages:
    249
    Likes Received:
    0
    Please check what command added for receiving fax in your IAX Modem configuration

    Example:
    file name: /var/spool/hylafax/etc/config.ttyIAX1
    FaxRcvdCmd: bin/faxrcvd.php

    Regards,

    Saleh
     
  4. Drstrangelove

    Joined:
    Oct 26, 2009
    Messages:
    28
    Likes Received:
    0
    Salam Saleh,

    Thanks for your help, i found the configfile!

    I see what the problem is i think,

    I have no receiving destination.

    Code:
    CountryCode:      *private
    AreaCode:               *private
    CountryCode:            *private
    AreaCode:               *private
    FAXNumber:              *private
    LongDistancePrefix:     1
    InternationalPrefix:    011
    DialStringRules:        etc/dialrules
    ServerTracing:          0xFFF
    SessionTracing:         0xFFF
    RecvFileMode:           0600
    LogFileMode:            0600
    DeviceMode:             0600
    RingsBeforeAnswer:	1
    SpeakerVolume:          off
    GettyArgs:              "-h %l dx_%s"
    LocalIdentifier:        "Fax"
    TagLineFont:            etc/lutRS18.pcf
    TagLineFormat:          "From %%l|%c|Page %%P of %%T"
    MaxRecvPages:           200
    #
    #
    # Modem-related stuff: should reflect modem command interface
    # and hardware connection/cabling (e.g. flow control).
    #
    ModemType:              Class1          # use this to supply a hint
    
    #
    # Enabling this will use the hfaxd-protocol to set Caller*ID
    #
    #ModemSetOriginCmd:     AT+VSID="%s","%d"
    
    #
    # If "glare" during initialization becomes a problem then take
    # the modem off-hook during initialization, and then place it
    # back on-hook when done.
    #
    #ModemResetCmds:        "ATH1\nAT+VCID=1"	# enables CallID display
    #ModemReadyCmds:        ATH0
    
    
    Class1AdaptRecvCmd:     AT+FAR=1
    Class1TMConnectDelay:   400             # counteract quick CONNECT response
    
    Class1RMQueryCmd:	"!24,48,72,96"  # enable this to disable V.17
    
    #
    # You'll likely want Caller*ID display (also displays DID) enabled.
    #
    ModemResetCmds:         AT+VCID=1	# enables CallID display
    
    
    #
    # Enabling this will use the hfaxd-protocol to set Caller*ID
    #
    #ModemSetOriginCmd:     AT+VSID="%s","%d"
    
    #
    # If "glare" during initialization becomes a problem then take
    # the modem off-hook during initialization, and then place it
    # back on-hook when done.
    #
    #ModemResetCmds:        "ATH1\nAT+VCID=1"	# enables CallID display
    #ModemReadyCmds:        ATH0
    
    
    Class1AdaptRecvCmd:     AT+FAR=1
    Class1TMConnectDelay:   400             # counteract quick CONNECT response
    
    Class1RMQueryCmd:	"!24,48,72,96"  # enable this to disable V.17
    
    #
    # You'll likely want Caller*ID display (also displays DID) enabled.
    #
    ModemResetCmds:         AT+VCID=1	# enables CallID display
    
    #
    # If you are "missing" Caller*ID data on some calls (but not all)
    # and if you do not have adequate glare protection you may want to
    # not answer based on RINGs, but rather enable the CallIDAnswerLength
    # for NDID, disable AT+VCID=1 and do this:
    #
    #RingsBeforeAnswer: 0
    #ModemRingResponse: AT+VRID=1
    
    CallIDPattern:          "NMBR="
    CallIDPattern:          "NAME="
    CallIDPattern:          "ANID="
    CallIDPattern:          "NDID="
    #CallIDAnswerLength:    4
    # Uncomment these if you really want them, but you probably don't.
    #CallIDPattern:          "DATE="
    #CallIDPattern:          "TIME="
    
    
    
    I see i am forgetting something in config.ttyIAX1.. shoud i put FaxRcvdCmd: bin/faxrcvd.php at the end of the code??


    Thanks alot! Shoekran,

    Regards,

    strangelove
     
  5. saleh

    Joined:
    Apr 18, 2007
    Messages:
    249
    Likes Received:
    0
    Which elastix version have you

    Regards,

    Saleh
     
  6. Drstrangelove

    Joined:
    Oct 26, 2009
    Messages:
    28
    Likes Received:
    0
    I have Elastix 1.5.2-2.3
     
  7. Drstrangelove

    Joined:
    Oct 26, 2009
    Messages:
    28
    Likes Received:
    0
    should i add FaxRcvdCmd: bin/faxrcvd.php in the code?
     
  8. saleh

    Joined:
    Apr 18, 2007
    Messages:
    249
    Likes Received:
    0
    For Elastix 1.5.2-2.3 please see which faxrcvd command is active elastix faxrcvd or avantfax faxrcvd


    cd /var/spool/hylafax/bin
    ls -la faxrcvd
    cat faxrcvd

    Regards,

    Saleh
     
  9. Drstrangelove

    Joined:
    Oct 26, 2009
    Messages:
    28
    Likes Received:
    0
    -rwxr-xr-x 1 root root 3300 Jan 12 2009 faxrcvd

    Code:
    #!/usr/bin/php
    <?php
        require_once "includes/functions.php";
        require_once "includes/config.php";
        
        /**********************************************
         *         1) OBTENGO INFORMACION             *
         **********************************************/
    
        // check for proper arguments
        if ($_SERVER['argc'] < 3) {
            echo $_SERVER['argv'][0]." file devID commID error-msg CIDNumber CIDName\n";
            exit;
        }
    
        $tiff_file = $_SERVER['argv'][1];
        $modemdev  = $_SERVER['argv'][2];
    	
        $commID    = ($_SERVER['argc'] >= 4) ? $_SERVER['argv'][3] : "";
        $errormsg  = ($_SERVER['argc'] >= 5) ? $_SERVER['argv'][4] : "";
        $CIDNumber = ($_SERVER['argc'] >= 6) ? $_SERVER['argv'][5] : "";
        $CIDName   = ($_SERVER['argc'] == 7) ? $_SERVER['argv'][6] : "";
        
        faxes_log ("faxrcvd> Obteniendo informacion del tiff ".obtener_nombre($tiff_file)." CIDNumber: ".$CIDNumber." CIDName: ".$CIDName);
       
        // OBTENGO INFORMACION DEL FAX
        if (!faxinfo ($tiff_file, $sender, $pages, $date, $fax_papersize)) {
            faxes_log ("faxrcvd> Failed: $tiff_file $modemdev corrupted");
            exit;
        }
        $company_name = ($CIDName) ? $CIDName : $sender;
        $company_number  = ($CIDNumber) ? clean_faxnum ($CIDNumber) : $sender;
        faxes_log ("faxrcvd> Processing FAX from company_name: $company_name, company_number: $company_number");
    
    
        /**********************************************
         *         2) ALMACENO FAX: HD Y DB           *
         **********************************************/
        // copy tiff file to new dir
        $name_pdf = str_replace("tif","pdf",obtener_nombre($tiff_file));
        global $faxes_path;
        $pathDB = createFolder($company_number, $commID, "in");
        $pdffile = "$faxes_path/recvd/$pathDB/fax.pdf";
    
        //El usuario actual es uucp
        // create pdf in new dir
        tiff2pdf ($tiff_file, $pdffile);
        // METO EL FAX EN LA BASE DE DATOS?
        fax_info_insert($name_pdf,$modemdev,$commID,$errormsg,$company_name,$company_number,'in',"recvd/$pathDB");
        faxes_log ("faxrcvd> Se copio el $name_pdf en la ruta $faxes_path/recvd/$pathDB y se grabo en la BD.");
        /**********************************************
         *         3) ENVIO EMAIL                     *
         **********************************************/
    
        $destinatario = obtener_mail_destiny($modemdev);
        $arrConfig    = getConfigurationSendingFaxMail($name_pdf,$company_name,$company_number);
        $titulo       = $arrConfig['subject'];
        $contenido    = $arrConfig['content'];
        $remite       = $arrConfig['remite'];
        $remitente    = $arrConfig['remitente'];
        $archivo      = $pdffile;
        $archivo_name = $name_pdf;
    
        print_r($arrConfig);
        echo $destinatario;
        enviar_mail_adjunto($destinatario,$titulo,$contenido,$remite,$remitente,$archivo,$archivo_name);
    
         /*
    	recvq/fax000000003.tif (ftp://elastix.palosanto.com:4559/recvq/fax000000003.tif):
    	          Sender: 
    	           Pages: 1
    	         Quality: Normal
    	            Size: ISO A4
    	        Received: 2007:06:11 16:30:20
    	 Time To Receive: 0:38
    	     Signal Rate: 9600 bit/s
    	     Data Format: 2-D MR
    	   Error Correct: No
    	         CallID1: 
    	         CallID2: 
    	     Received On: ttyIAX1
    	          CommID: 000000003 (ftp://elastix.palosanto.com:4559/log/c000000003)
        */
    ?>
    
    He opens faxrcvd so that is good right?
     
  10. saleh

    Joined:
    Apr 18, 2007
    Messages:
    249
    Likes Received:
    0
    >> should i add FaxRcvdCmd: bin/faxrcvd.php in the code?
    No, this is in Elastix 1.6

    Elastix 1.6 Changelog

    - In paloSantoFax.class.php now defined FaxRcvdCmd keyword to use of hylafax.
    - New files faxrcvd.php and faxrcvd-elastix.php to define script after process fa
    x recived.
    - Keyword FaxRcvdCmd on file config.ttyIAX* added, for avoid replace file faxrcvd
    .
     
  11. Drstrangelove

    Joined:
    Oct 26, 2009
    Messages:
    28
    Likes Received:
    0
    So what should i do about the configfile?
     
  12. Drstrangelove

    Joined:
    Oct 26, 2009
    Messages:
    28
    Likes Received:
    0
    Should I re-symlink faxrcvd or something?

    I dont have a clue im new in this :blink:
     
  13. saleh

    Joined:
    Apr 18, 2007
    Messages:
    249
    Likes Received:
    0
    When you have Elastix Version 1.5.2-2.3 and you have not this lines in your IAX Modem configuration for avantfax

    ## AvantFAX
    #
    FaxRcvdCmd: bin/faxrcvd.php
    DynamicConfig: bin/dynconf.php
    UseJobTSI: true

    and you have the Elastix faxrcvd command active and not the faxrcvd.php command for Avantfax, i see no problem

    Please post this

    cat /var/spool/hylafax/etc/config

    cat /var/spool/hylafax/bin/notify.php

    Regards,

    Saleh
     
  14. saleh

    Joined:
    Apr 18, 2007
    Messages:
    249
    Likes Received:
    0
    Have you this file:
    ls -la /var/spool/hylafax/bin/notify-avantfax.php

    when you have it please remove it

    rm /var/spool/hylafax/bin/notify-avantfax.php

    Regards,

    Saleh
     
  15. Drstrangelove

    Joined:
    Oct 26, 2009
    Messages:
    28
    Likes Received:
    0
    Ok

    Code:
    [root@pbx etc]# cat /var/spool/hylafax/etc/config
    NotifyCmd:      bin/notify.php
    
    [root@pbx etc]# cat /var/spool/hylafax/bin/notify.php
    cat: /var/spool/hylafax/bin/notify.php: No such file or directory
    
    
     
  16. Drstrangelove

    Joined:
    Oct 26, 2009
    Messages:
    28
    Likes Received:
    0
    Do you think we can fix this?
     
  17. saleh

    Joined:
    Apr 18, 2007
    Messages:
    249
    Likes Received:
    0
    this is the right file

    #!/usr/bin/php
    <?php
    $cmdLine = "";

    for($i=1; $i<$_SERVER['argc']; $i++)
    $cmdLine .= "{$_SERVER['argv'][$i]} ";

    if(file_exists("bin/notify-avantfax.php"))
    echo `bin/notify-avantfax.php $cmdLine`;

    if(file_exists("bin/notify-elastix.php"))
    echo `bin/notify-elastix.php $cmdLine`;
    ?>

    have you this file notify-elastix.php under the path /var/spool/hylafax/bin
     
  18. Drstrangelove

    Joined:
    Oct 26, 2009
    Messages:
    28
    Likes Received:
    0
    Yes I have notify-elastix.php
     
  19. saleh

    Joined:
    Apr 18, 2007
    Messages:
    249
    Likes Received:
    0
    Create this file with file name notify.php under the /var/spool/hylafax/bin

    and add this lines in it

    #!/usr/bin/php
    <?php
    $cmdLine = "";

    for($i=1; $i<$_SERVER['argc']; $i++)
    $cmdLine .= "{$_SERVER['argv'][$i]} ";

    if(file_exists("bin/notify-avantfax.php"))
    echo `bin/notify-avantfax.php $cmdLine`;

    if(file_exists("bin/notify-elastix.php"))
    echo `bin/notify-elastix.php $cmdLine`;
    ?>

    and change the mode for it

    chmod 755 notify.php


    Regards,

    Saleh
     
  20. saleh

    Joined:
    Apr 18, 2007
    Messages:
    249
    Likes Received:
    0
    or quick symbolic link the the notify-elastix.php file

    cd /var/spool/hylafax/bin
    ln -s notify-elastix.php notify.php

    Regards,

    Saleh
     

Share This Page