Hylafax Issue/Bug? - Sent fax, emailed incorrectly

Discussion in 'General' started by sasben2, Jul 24, 2009.

  1. sasben2

    Joined:
    Jul 24, 2009
    Messages:
    14
    Likes Received:
    0
    Hi there, I'm hoping someone can point me in the right direction, i'm losing my mind ;-)

    I have the latest stable Elastix with Avantfax installed from the rpm. I can send and receive faxes, no problem. There are some nuances however.

    The simple one first.
    1) If I run the following command, it shows that postfix is correctly configured as my outgoing mail domain is correct.

    sendecho "test" | mail -s testmessage myemail@address.com

    The issue is that the fax status email sent after a fax, shows the name "Fax Elastix" with an email of elastix@example.com.

    I've looked in various configuration files, main.cf, hosts, hylafax, avantfax, passwd etc, but didn't find where it could be.

    Can someone point me in the right direction?

    FIXED: After rebuild, I didn't go into "Template Email" in the Elastix panel.. DOH!!!!



    2) Leading from problem 1, it seems there is a bug? in Hylafax. If I am wrong, please help me fix it :)

    I have setup two IAX2 modems with two different destination emails.
    Looking at fax dispatch: /etc/hylafax/etc/FaxDispatch, it seems to be correct in its case statement for sending faxes.

    [root@ih etc]# vi /etc/hylafax/etc/FaxDispatch
    SENDTO=root;
    FILETYPE=pdf;

    case "$DEVICE" in
    ttyIAX1) SENDTO=address1@domain.com;;
    ttyIAX2) SENDTO=address2@gmail.com;;
    esac


    Now, If i send a fax via AvantFax, using a login that can only see ttyIAX2, the fax goes out, and shows it using ttyIAX2 within Avantfax.

    Fax Visor however shows the "Fax Destiny" to be the first fax on ttyIAX1 (because I have the name Fax1 and Fax2 on the IAX fax settings).

    So, the problem is that whatever fax I sent from within AvantFax, the fax status email seems to only ever go to the email address that is configured against ttyIAX1 in the Elastix fax control panel.

    Interestingly, I changed the case around so that ttyIAX2 was address1 and ttyIAX1 was address2 (as above but reversed) and the email STILL went to the ttyIAX1 address.

    Any ideas?


    Lastely,
    3) Archive view in AvantFax..

    The fax visor in the Elastix control panel shows the outgoing faxes for all people i.e. It seems to be working fine.

    The problem is in the "Archive" view in AvantFax for an individual user; it only shows the incoming faxes and never any sent. Any ideas?


    Thanks guys!, I hope I can contribute to the Elastix 2.0 as I make my way around this distro.
     
  2. sasben2

    Joined:
    Jul 24, 2009
    Messages:
    14
    Likes Received:
    0
    Just to add to this.

    In Fax Visor, the Company Name is correct for ttyIAX2, but again the Fax Destiny shows the name of the ttyIAX1.

    Also, checking the hylafax logs, it shows the correct outgoing device.

    SEND FAX: JOB 14 DEST 97368660 COMMID 000000014 DEVICE '/dev/ttyIAX2' FROM 'Address 2 <address2@gmail.com>'


    So this would seem that FaxDispatch has a problem?
     
  3. sasben2

    Joined:
    Jul 24, 2009
    Messages:
    14
    Likes Received:
    0
    Problem 2 Update
    ================
    Ok, so there is something wrong with bin/notify-elastix.php.

    I have edited it to show more information.
    Underneath:
    print_r($arrConfig);
    echo $destinatario;

    I put:
    echo $modemdev;
    echo $number;


    Even though the hylafax log shows correct device (as above), when I run:
    cd /var/spool/hylafax
    for i in `ls doneq/q*`; do bin/notify.php $i done :30; done

    The output is:
    Array
    (
    [remite] => fax@domain.com
    [remitente] => Fax
    [subject] => Fax attached Nº doc10.pdf
    [content] => Fax sent from "Address1", the phone number is XXXXXXX.
    This email has a fax attached doc10.pdf.
    )
    fax@domain.com
    ttyIAX1
    XXXXXXXX

    So the outcome is, Avantfax shows it was sent by ttyIAX2 (all the user had access to), the Logs shows ttyIAX2

    however, bin/notify-elastix.php reads it as ttyIAX1.
     
  4. sasben2

    Joined:
    Jul 24, 2009
    Messages:
    14
    Likes Received:
    0
    PROBLEM 2 RESOLVED
    ==================

    Scenario: You have more than one IAX2 fax modem setup in the Elastix control panel. Each has a different destination email address.

    If you restrict Avantfax users to a particular modem, you will find that the fax status email notification always goes to the email address of the IAX modem which sent the first ever fax.

    Issue: The called function "obtener_modem_destiny($number)" in /var/spool/hylafax/bin/notify-elastix.php, is set to always return the result from the first fax ever sent.

    Fix:
    vi /var/spool/hylafax/bin/notify-elastix.php


    Find this line: $modemdev = obtener_modem_destiny($number);
    Change to:
    //$modemdev = obtener_modem_destiny($number);
    $modemdev = getModem($arrReg[1]);


    Then go to the bottom of the file and insert the function below, before the ?> EOF.


    function getModem($file)
    {
    return trim(`grep '^modem' /var/spool/hylafax/doneq/$file | cut -b 7-16`);
    }


    NOTE: This patch fixes the Elastix side, which means that regardless of the email address you have in each user's login in AvantFax, that is never used. ANYWAY, within Elastix it was never used anyway for sent faxes.

    Note 2: There are some other issues, like Fax Visor shows the incorrect company name. I'll work on this one.


    Now.... Can anyone tell me about Problem 3? Seeing "Archive" or sent faxes within AvantFax?
     
  5. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    A very nice analytic and deductive process sasben2, or may I call you Geoff?,


    Avantfax and the built in Fax Visor have very different philosophies, my preference is Avantfax but "normalizing" a multi-user/multi-fax device Elastix to the more functional (IMHO) Avantfax is commendable.

    +1 karma definitely, we can all learn from you!!
    dicko
     
  6. sasben2

    Joined:
    Jul 24, 2009
    Messages:
    14
    Likes Received:
    0
    Geoff is fine :)

    Thanks dicko... Yes I would agree with you.. AvantFax does a great job as a standalone, but integration into Elastix *whilst* keeping avantfax running for the masses (the workers who fax out), would be great.

    Would you happen to know where I can get more information on email2fax for it? Google is turning a blank.

    Cheers!
     
  7. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    Geoff:
    the hylafax, (perhaps better the hylafax+) fora.
    (A working knowledge of mime,how MTA's work, and the hylafax process are all must's, you need to be able to handle plaintext(a2ps). html(html2ps), and mime enclosures, for it to work reasonably in your particular environment. ps2tiff/ps2fax are done for you already)
     

Share This Page