HylaFax Server Install for connection to Elastix

Discussion in 'General' started by PHBarry, Jan 9, 2010.

  1. PHBarry

    Joined:
    Apr 21, 2009
    Messages:
    57
    Likes Received:
    0
    HylaFax Server Install with iaxmodem

    :D I hope this is useful to somebody it can sure be done differently.
    This is basically what I did after banging my head for months trying to get faxing separated per client on a windows pc... I use vi editor if you prefer it install nano…


    1. Install CentOS 5.
    I normally have to use a cd so I install nothing but the base install. This takes one cd if you are installing CentOS 5. I usually run a yum update, disable selinux, and a number of other things after installation.

    2. Yum install some of the required dependencies.
    Code:
    yum install gcc  ghostscript sharutils glibc-headers glibc-devel kernel-headers autoconf zlib-devel gcc-c++ libjpeg-devel mgetty-voice libtiff-devel
    3 Download the rest of the dependencies.
    Download spandsp to /usr/src
    Code:
    cd /usr/src
    wget http://www.soft-switch.org/downloads/spandsp/spandsp-0.0.5.tgz
    Download Iaxmodem
    wget http://downloads.sourceforge.net/project/iaxmodem/iaxmodem/iaxmodem-1.2.0/iaxmodem-1.2.0.tar.gz
    Download hylafax client and server
    wget ftp://ftp.hylafax.org/binary/linux/redhat/6.0.4/hylafax-server-6.0.4-1rhel5.i386.rpm
    wget ftp://ftp.hylafax.org/binary/linux/redhat/6.0.4/hylafax-client-6.0.4-1rhel5.i386.rpm
    
    4 Extract archives
    Code:
    tar xvzf iaxmodem-1.2.0.tar.gz
    tar xvzf spandsp-0.0.5.tgz
    5 compile spandsp and iaxmodem
    Code:
    cd /usr/src/spandsp-0.0.5
    ./configure && make && make install 
    cd /usr/src/iaxmodem-1.2.0  
    cd lib/spandsp
    ./configure && make && make install 
    cd /usr/src/iaxmodem-1.2.0
    ./configure && make
    cp iaxmodem /usr/sbin/
    mkdir /etc/iaxmodem
    6 Install Hylafax
    Code:
    cd /usr/src
    rpm -Uvh hylafax-client-6.0.4-1rhel5.i386.rpm hylafax-server-6.0.4-1rhel5.i386.rpm
    7 Configure the iaxmodems
    Code:
    mkdir /etc/iaxmodem
    add one for each modem example  iaxmodem-cfg.ttyIAX1 iaxmodem-cfg.ttyIAX2 iaxmodem-cfg.ttyIAX3
    cp iaxmodem-cfg.ttyIAX /etc/iaxmodem/iaxmodem-cfg.ttyIAX1
    vi  /etc/iaxmodem/iaxmodem-cfg.ttyIAX1
    Change the following for each modem. Each modem must have different device name 
    device  	/dev/ttyIAX1
    server          elastix server ip 
    peername        iax extension on PBX
    secret          iax extension secret
    save it in vi by typing :wq

    In my case I need like 15 modems to start. So I have 15 iaxmodem-cfg.ttyIAX configuration files… For each one of my modems.. Now it would be much easier to go into virtual faxes in Elastix and do this but, I had no luck getting the functionality working that I needed in a timely manner. In this case is keeping all faxes separate per windows client user on a terminal server of 20 or more users.
    Code:
    cp iaxmodem.init.fedora /etc/init.d/iaxmodem
    vi /etc/init.d/iaxmodem
    change any lines with  /usr/local/sbin/iaxmodem  to /usr/sbin/iaxmodem
    save it..
    chmod 755 /etc/init.d/iaxmodem
    mkdir /var/log/iaxmodem
    start iaxmodem
    /etc/init.d/iaxmodem start
    vi /etc/rc.local
    add 
    /etc/init.d/iaxmodem start
    Save it..

    7 Configure Hylafax
    Run faxsetup by typing faxsetup in command prompt
    Code:
    faxsetup
    Setup inittab
    Code:
    vi /etc/inittab
    add this at end. Add for every modem you want..
    Code:
    # fax
    fax0:2345:respawn:/usr/sbin/faxgetty ttyIAX1
    
    Add fax user. Add for every modem you want..
    Code:
    faxadduser 5001 -p  Password5001
    useradd 5001
    
    look at /etc/group
    get group 5001 group number
    Code:
    cat /etc/group
    will look this
    Code:
    5001:x:500:
    we are looking for the second number 500
    open hosts.hfaxd
    Code:
    vi /var/spool/hylafax/etc/hosts.hfaxd
    change
    Code:
    ^5001@::ry7YQ7j76876
    to
    Code:
    ^5001@:500:ry7YQ7j76876
    Save the file.

    Edit FaxDispatch
    Code:
    vi /var/spool/hylafax/etc/FaxDispatch
    add this to end of file
    Code:
     case "$DEVICE" in
    ttyIAX1) sudo chgrp 5001 $FILE;;
    esac
    Code:
    visudo
    Add line to bottom
    Code:
    Defaults:uucp !requiretty
    uucp    ALL=(root) NOPASSWD: /bin/chgrp
    
    This should change permissions so for the fax client I am using only the user will see it their faxes!
    Fax client here http://www.swt-online.de/hylafax/index_eng.html
    I usually reboot the server now… then test it.

    8. Setup client and test server. You need to edit the mod.dll in the user profile in Windows. You put the uuid in the mod.dll file.

    The only problem with this is it is supposed to automatically set permissions on the faxes which is not happening.
    If I change them manually to the group it works..
     
  2. DaveD

    Joined:
    Nov 12, 2007
    Messages:
    597
    Likes Received:
    0
    Thank you very much for sharing your steps ,very nice work
    +1 to your karma
     
  3. PHBarry

    Joined:
    Apr 21, 2009
    Messages:
    57
    Likes Received:
    0
    NP! Thank you and thanks for the karma! Once I get the last part worked out where it automatically sets permissions through hylafax I will update it. I manually have to update the permissions but the developer assures me that hylafax will update the permissions. Me being new to hylafax I am sure I will figure it out. I don't feel like messing with it for now... I dont know why I keep working I guess cause its COLD outside! Updating our website now. Newsite http://www.pinellashosting.com/ Oldsite http://www.pinellashosting.com/oldhome2 HMMM I dont know which I like better!
     
  4. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    FWIW, In a similar Fax Server setup I use chown (and psmark to watermark the faxes by datetime and print somewhere, this in itself might be good for HIPPA ) ) in FaxDispatch.

    (The psmark bit is /usr/bin/fax2ps -W 8.5 -H 10.675 $FILE | /usr/bin/psmark -s 80 -f ariel -b 0.9 -r 45 "
    ` date '+%D %R'` $DEVICE"| /usr/bin/lpr -P archiveprinter )

    As uucp's shell is nologin I found I needed

    Defaults:uucp !requiretty
    uucp ALL=(root) NOPASSWD: /bin/chmod, /bin/chown

    in sudoers

    ref:
    http://www.hylafax.org/content/Handbook ... Protection

    also you should use the full path to chmod/chgrp/chown as uucp will probably need that too.

    Hope that helps

    regards

    dicko
     
  5. PHBarry

    Joined:
    Apr 21, 2009
    Messages:
    57
    Likes Received:
    0
    Karma for you! You are on top of it Dicko.. I am going to try this as I was wondering if the user was restricted but I did not look into it yet. I bet this is it... Thank you

    I was also wondering what are you doing in that picture? :)
     
  6. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    :):)

    despite what some may think, that's a actually a firecracker, what else could it be??
     
  7. PHBarry

    Joined:
    Apr 21, 2009
    Messages:
    57
    Likes Received:
    0
    Well so far its not working but then I found this

    Many platforms will require the HylaFAX user (usually uucp) to be a member of the groups used as "fax uid" before the chgrp command will work. Remember to restart every faxgetty when you add uucp to a new group.

    I did everything rebooting then well test if it all works... If it all works I will update the original how to!
     
  8. PHBarry

    Joined:
    Apr 21, 2009
    Messages:
    57
    Likes Received:
    0
    OH... You have a firecracker in your hand? Wow I would have never guessed!
     
  9. PHBarry

    Joined:
    Apr 21, 2009
    Messages:
    57
    Likes Received:
    0
    /me kicks the wall! Its still not changing the group and I don't see any errors to point me any direction going to have to figure out how to turn on more logging!
     
  10. PHBarry

    Joined:
    Apr 21, 2009
    Messages:
    57
    Likes Received:
    0
    Now I am thinking I should be using same group as I used in hosts.hfaxd for FaxDispatch which I have been using the one you see in unix when you do an ls -la! Going to try the other!...
     
  11. PHBarry

    Joined:
    Apr 21, 2009
    Messages:
    57
    Likes Received:
    0
    WOW I left the esac out of the FaxDispatch once I added that everything started to work! Stupid mistake! The above how to should work for anyone using CentOS 5 and the new hylafax was apparently written for CentOS thought that was cool as I love centos!
     
  12. DigiPBX

    Joined:
    Nov 2, 2010
    Messages:
    9
    Likes Received:
    0
    I don't see were you have posted these instructions. I have the same issue with everyone seeing each others faxes. Can you point me in the right direction?

    Thanks
    Digi
     
  13. PHBarry

    Joined:
    Apr 21, 2009
    Messages:
    57
    Likes Received:
    0
    If you are using the Hylafax client I did. You setup a linux user and group. Then you set the uuid in the mod.dll file in the user profile in Windows. Next you add the uuid to the hosts.hfaxd. I may be leaving something out it has a been a long time since I did this. If you cant figure it out let me know and I will boot up a virtual machine I have with hylafax on it and I will give you more detailed instructions this weekend...
     
  14. PHBarry

    Joined:
    Apr 21, 2009
    Messages:
    57
    Likes Received:
    0
  15. DigiPBX

    Joined:
    Nov 2, 2010
    Messages:
    9
    Likes Received:
    0
    Thanks! ill give it a try since you made it so easy with your instructions.
    Digi
     
  16. PHBarry

    Joined:
    Apr 21, 2009
    Messages:
    57
    Likes Received:
    0
    Good Luck. I just reposted the how to at the top.
     

Share This Page