Installation Manual for Asterisk Iaxmodem Postfix and HylaFax WinPrintHylaFax

Embed Size (px)

Citation preview

  • 8/12/2019 Installation Manual for Asterisk Iaxmodem Postfix and HylaFax WinPrintHylaFax

    1/15

    Installation Manual for asterisk, FreePBX, iaxmodem,

    Postfix and HylaFax on openSUSE and

    WinPrintHylaFax on Windows lient

    Preface

    This is an installation manual for receiving and sending fax with HylaFax by fax-to-email andemail-to fax on openSUSE and install manual for WinrintHylafax that you send email-to-fax fromyour Windows clients! This assumes that you have "steris# and dahdi installed! $ wrote it %pen&ox'()) $nstallation *anual for dahdi on openSUSE! +reate $", extension on Free', read$nstallation *anual for Free', on openSUSE!

    Run asterisk as non-root user

    $f asteris# run as non-root user it safer because $ll change it!

    *a#e sure you .etc.init!d.asteris# stop and run "steris# as non-root!

    .etc.init!d.asteris# stop

    /0 Shutting down asteris#1 %2

    $t is safer to define a user called asteris# in group asteris# unless you want to ma#e more changes to 3 files i!e! 4aptel!rules and .etc.init!d.asteris#

    / .usr.sbin.groupadd asteris#

    .usr.sbin.useradd -d .var.lib.asteris# -g asteris# asteris#

    /0 useradd1 warning1 the home directory already exists!

    /0 5ot copying any file from s#el directory into it!

    *odify these directories owner user and group!

    chown -6 asteris#1asteris# .var.lib.asteris#

    chown -6 asteris#1asteris# .var.log.asteris#

    chown -6 asteris#1asteris# .var.run.asteris#

    chown -6 asteris#1asteris# .var.spool.asteris#

    chown -6 asteris#1asteris# .usr.lib.asteris#

    // $f you are using 7aptel run the next line

    chown -6 asteris#1asteris# .dev.4ap

    // $f you are running 8"H8$ run the next line

    chown -6 asteris#1asteris# .dev.dahdi

  • 8/12/2019 Installation Manual for Asterisk Iaxmodem Postfix and HylaFax WinPrintHylaFax

    2/15

    *odify these directories file permissions.

    chmod -6 u9rw,:g9r,:o9 .var.lib.asteris#

    chmod -6 u9rw,:g9r,:o9 .var.log.asteris#

    chmod -6 u9rw,:g9r,:o9 .var.run.asteris#

    chmod -6 u9rw,:g9r,:o9 .var.spool.asteris#chmod -6 u9rw,:g9r,:o9 .usr.lib.asteris#

    // $f you are using 7aptel run the next line

    chmod -6 u9rw,:g9r,:o9 .dev.4ap

    // $f you are using 8"H8$ run the next line

    chmod -6 u9rw,:g9r,:o9 .dev.dahdi

    chown -6 root1asteris# .etc.asteris#

    chmod -6 u9rw,:g9rw,:o9 .etc.asteris#

    'ac#up .etc.steris#.asteris#!conf

    cp .etc.asteris#.asteris#!conf .etc.asteris#.asteris#!conf!org

    Edit .etc.asteris#.asteris#!conf! +hange the following line from1

    / astrundir 90 .var.run

    to1

    /

    / astrundir 90 .var.run.asteris#

    Edit .etc.init!d.asteris# and uncomment "ST;USE6 and "ST;

  • 8/12/2019 Installation Manual for Asterisk Iaxmodem Postfix and HylaFax WinPrintHylaFax

    3/15

    asteris# -U asteris# -< asteris#

    $f that wor#s well: #illall asteris#: and then do asteris# -r to connect to "steris#s command-lineinterface! $f all goes well with no errors: #illall asteris#: .etc.init!d.asteris# start: and thenrun asteris# -r! $f all goes well: congrats on ma#ing your "steris# phone system run as non-root!"steris# does not need =System "dministrator= powers in order to function!

    Thats it for "steris#! 5ow: lets move in to iaxmodem!

    $nstalling $",modem

    $nstall iaxmodem from @ast rpm!

    A$f you use two modems then save it as tty$",): copy AcpB tty$",) to tty$",( and change thedevice to .dev.tty$",(: port to CD(: and peername to iax-fax(!B

    +reate logfile directory in .ver.log. directory!1/ m#dir .var.log.iaxmodem

    *odify the configuration file .etc.iaxmodem.iaxmodem-cfg!tty$",)! This file must contain thefollowing parameters1device

    The device node to be created in .dev! This is the device Hylafax uses to connect to $",modem! @ou can choose

    any name you li#e: but we prefer to adhere to the convention and so choose a device name appropriate for a serial

    interface: tty$",)!

    owner

    This is the owner of the device Ain the form user1groupB! $t is best to use the same user and group under whichHylafax runs!

    port

    The port that $",modem listens on! "steris# uses CDG to listen for $",3 connections: so you must choose

    something else: e!g! CD)!

    refresh

    This sets how long $",modem waits between registrations with "steris#! $f this number is ): the modem does not

    register at all!

    server

    $ address of the server running "steris#! $f this is on the same machine as $",modem: use the localhost address

    (3!)!)!(!

    peername

    The name under which $",modem registers with "steris#!

    secretThe password used for "steris# registration!

    codec

    The codec used by $",modem! "llowed codecs are alaw: ulaw and slinear! +ompressed codecs are not appropriate

    for faxing fax transmissions are themselves compressed and dont tolerate further compression moreover: most

    compressed codecs are lossy and a fax transmission will not tolerate losses! This is one of the maIor reasons why

    faxing over &o$ remains problematic!

    Using an appropriate editor Ae!g! viB we write the following configuration in thefile .etc.iaxmodem.iaxmodem-cfg!tty$",)1device .dev.tty$",)

    owner uucp1uucpmode )

    port CD)

  • 8/12/2019 Installation Manual for Asterisk Iaxmodem Postfix and HylaFax WinPrintHylaFax

    4/15

    refresh J)) /it need that yuo havent iax registration failure on log

    server (3!)!)!(

    peername G))(

    secret password))

    codec ulaw

    $",modem is now configured and can be started! The best way to do this is with @ast System

    Services A6unlevelB if you installed it from rpm!

    The device name tty$",) is the same device name as specified in .etc.iaxmodem!

    To receive faxes: we need a getty that listens for connections on the $",modem! This isaccomplished through an additional entry in .etc.inittab! "dd it with echo=mo))13J1respawn1.usr.lib.fax.faxgetty tty$",)= 00 .etc.inittab!mo))1JD1respawn1.usr.lib.fax.faxgetty tty$",)

    +reate a log directory for $",modem with m#dir .var.log.iaxmodem. and the log files

    with touch .var.log.iaxmodem.tty$",) and touch .var.log.iaxmodem.iaxmodem!/ m#dir .var.log.iaxmodem.

    / touch .var.log.iaxmodem.tty$",)

    / touch .var.log.iaxmodem.iaxmodem

    To ma#e sure everything will start as expected at boot time: reboot the system with shutdown -r now!

    $nstall ostfix

    @ou need setup ostfix from voicemail file and edit .et!postfix!main!cf

    relayhost 9 mail!t-online!husmtp;sasl;password;maps 9 hash1.etc.postfix.sasl;password

    bro#en;sasl;auth;clients 9 yessmtpd;sasl;auth;enable 9 nosmtp;always;send;ehlo 9 yessmtp;sasl;auth;enable 9 yessmtp;sasl;security;options 9myhostname 9 host!domain /your host!domain namemydomain 9 domain /your domain namemyorigin 9 domain!net /your domain FK85masLuerade;domains 9 domain!net /your domain FK85smtp;generic;maps 9 hash1.etc.postfix.generic

    edit!et!postfix!sasl"passwd

    mail!isp!net username1password /your username and passford of $S service

    edit!et!postfix!#eneri

    faxMhost!domain faxMdomain!net /your domain F8K5 or $S domain FK85faxMhost!local faxMdomain!net /your domain F8K5 or $S domain FK85

    edit!et!$osts

    (G3!(N!(!()) hoast!domain host/(3!)!)!( hoast!domain host

    Then run

    mailto:[email protected]:[email protected]:[email protected]:[email protected]
  • 8/12/2019 Installation Manual for Asterisk Iaxmodem Postfix and HylaFax WinPrintHylaFax

    5/15

    postmap .etc.postfix.sasl;password

    postmap .etc.postfix.generic

    rcpostfix restart

    Installing Hylafax

    Well install Hylafax from @ast to simplify installation! 8ependencies are automatically resolved1

    The next step is the configuration of the fax server! 8o this with faxsetup1/ faxsetup

    O!!!P

    Update .var.spool.hylafax.status.any!info!

    HylaF", configuration parameters are1

    O(P $nit script starts faxL1 yes

    O3P $nit script starts hfaxd yes

    OJP Start paging protocol1 no

    "re these o# OyesPQ

    Simply press Enter after the following 3-J Luestions!

    @ou have a HylaF", scheduler process running! faxL will be

    restarted shortly: as soon as some other wor# has been completed!

    +an $ terminate this faxL process AC)CNB OyesPQ

    Should $ restart the HylaF", server processes OyesPQ

    .etc.init!d.hylafax start

    5ot starting HylaF", daemons since they are already running!

    O!!!P

    *odems are configured for use with HylaF", with the faxaddmodemANB comma

    nd!

    8o you want to run faxaddmodem to configure a modem OyesPQ

    We confirm restart of the server processes with yes and are as#ed if we want to install a modem!%ur $",modem is already set up so we can proceed and confirm again with yes!

    Specify the modem and confirm with Enter!Serial port that modem is connected to OttyS)PQ tty$",)

    %#: time to setup a configuration file for the modem! The manual

    page configADB may be useful during this process! "lso be aware

    that at any time you can safely interrupt this procedure!

  • 8/12/2019 Installation Manual for Asterisk Iaxmodem Postfix and HylaFax WinPrintHylaFax

    6/15

    6eading scheduler config file .var.spool.hylafax.etc.config!

    *any Luestions follow: but only a few of them are really important! This is where you setinternational dialing codes: the fax number: country and area code: and the +S$8 A+all Subscriber$8B which is printed on the top line of the fax page on the receivers end! +onfirm with yes!

    5o existing configuration: lets do this from scratch!

    +ountry code O(PQ CC

    "rea code OPQ (

    hone number of fax modem O>(!GGG!DDD!(3(3PQ (3JCD

    ?ocal identification string Afor TS$.+$

  • 8/12/2019 Installation Manual for Asterisk Iaxmodem Postfix and HylaFax WinPrintHylaFax

    7/15

    SessionTracing1 ((

    6ings'efore"nswer1 (

    Spea#er&olume1 off

  • 8/12/2019 Installation Manual for Asterisk Iaxmodem Postfix and HylaFax WinPrintHylaFax

    8/15

    *odem manufacturer is =spandsp=!

    *odem model is =$",modem=!

    Using prototype configuration file iaxmodem!!!

    The modem configuration parameters are1

    *odem6eset+mds1 ="TH(n"T>&+$89(=

    "re these o# OyesPQ

    The modem was detected and we are as#ed if it is a +lass ( modem: and we confirm this because itis exactly what we want! The default reset commands are also acceptable! +onfirm with yes!

    "nswer the first Luestion $n the next dialog with no: since we dont need to configure any further modems! The second

    Luestion is confirmed with by pressing Enter: which starts the fax server!

    +reating new configuration file .var.spool.hylafax.etc.config!tty$",)!!!

    +reating fifo .var.spool.hylafax.F$F%!tty$",) for faxgetty!!! done!

    8one setting up the modem configuration!

    O!!!P

    8o you want to run faxaddmodem to configure another modem OyesPQ no

    O!!!P

    Should $ run faxmodem for each configured modem OyesPQ

    .usr.sbin.faxmodem tty$",)

    8one verifying system setup!

    .var.spool.hylafax

    Hylfax is now configured for sending faxes!

    1) Receiving faxes

    IMPR!"#!! $f you not use Free', need edit configs below: but if you use Free', then youneed setup it on Free', *anager

  • 8/12/2019 Installation Manual for Asterisk Iaxmodem Postfix and HylaFax WinPrintHylaFax

    9/15

    secret9password))

    transfer9no

    host9(3!)!)!(

    port9CD)

    host9dynamic

    context9from-internal

    reLuirecallto#en9no

    disallow9all

    allow9alaw

    Iitterbuffer9no

    Lualify9yes

    deny9)!)!)!).)!)!)!)

    dial9$",3.G))(

    mailbox9G))(Mdevice

    callerid9device G))(0

    setvar96E"?+"??E6$85U*9G))(

    permit9(3!)!)!(.3DD!3DD!3DD!)

    any other modems you have in .etc.iaxmodem. will go here!

  • 8/12/2019 Installation Manual for Asterisk Iaxmodem Postfix and HylaFax WinPrintHylaFax

    10/15

    We can test sending of faxes with sendfax -n -d faxnumber0 file!txt01/ sendfax -n -d )CDDDG .etc.issue!net

    $f you finished then you can send and receive faxes via "steris# using Hylafax!

    The Hylafax website http1..www!hylafax!orghas numerous examples and how-tos that will helpyou integrate your Hylafax installation with your existing office intrastructure effectively!

    &) %ending received faxes as e-mail

    The following steps illustrate how we can configure Hylafax to transmit incoming faxes to a pre-defined e-mail address!The recipient will receive the fax as an e-mail attachment!

    To do this: the configuration file .var.spool.fax.bin.Fax8ispatch must contain the followingparameters1%'#(!

    The destination e-mail address for incoming faxes!I*'!+P'

    The format of the attachment! $n addition to pdf: tiff ATagged $mage File FormatB and ps AostscriptZB are also

    acceptable options!

    *odify these parameters to1SE58T%9usernameMdomain!net /sending to e-mail address

    F$?ET@E9pdf

    "fter the file has been saved: you must restart the fax server with .etc.init!d.hylafax restart!/ rchylafax restart

    Shutting down service HylaF", done

    Starting service HylaF", done

    We can test e-mail transmission by sending ourselves a fax with sendfax -n -d faxnumber0file!txt0/ sendfax -n -d 33(DC .etc.host

    The attachment will be a 8F file!

    5ow you can not only send and receive faxes: but received faxes are also received as e-mail

    attachments!

    ,) "dd faxuser

    %nce youve completed that part of the setup we have to create some users that they can useWinrintHylafax!

    type =faxadduser -a adminpass. -p userpass. -u uid. username.= -a adminpass is a password you ma#e up that allows the user to login with admin privelages

    to the fax server: set it to whatever you li#e -p userpass is the normal user password for the person logging in

    -u uid is a / !!! F%6 E,"*?E1 -u ()

    HE6E $S " S"*?E USE6 TH"T $ SET U =faxadduser -a adminpass -p userpass -u 100username= !!! That will create a user called =username= with the user id of =())= and a

    http://www.hylafax.org/mailto:SENDTO%[email protected]://www.hylafax.org/mailto:SENDTO%[email protected]
  • 8/12/2019 Installation Manual for Asterisk Iaxmodem Postfix and HylaFax WinPrintHylaFax

    11/15

    password of =userpass= with admin privelages accessible via =adminpass= 8oes this ma#esenseQ

    /inPrintHylafax

    I copied here manual 0ecause the installation is very simple and manual is very useful

    Winprint HylaF", is a Windows print monitor designed to send its output directly to a HylaF",Server! %nce installed: you can print to a HylaF", Server from any application: and it will pop upa simple dialog box: allowing you to enter the destination F", number!

    $ts not intended to be fancy or all encompassing: Iust a Luic# and easy way to send F",es from anyWindows application

    $t can be downloaded here! To go to the sourceforge pages for this software to comment: report

    bugs: or get source code: clic# here!

    $t is pac#aged in the form of a Windows $nstaller: which installs the reLuired sets of !8?? files andregisters the monitor with the system! This adds support for a new type of port to your system:called a =Winrint HylaF", ort!= %nce youve successfully installed the files: setup isstraightforward: but it has a number of steps!

    First: youll want to create an appropriate ostScript printer using the ="dd rinter= button! @ouwant to select a =?ocal printer:= but since its not a physical printer: unchec# the ="utomaticallydetect and install my lug and lay printer= box!

    5ext: youll be as#ed what port to use! Select the radio button =create a new port type!= $f theinstallation went well: you should see =Winprint Hylafax= as one of the options!

    http://www.hylafax.org/http://www.hylafax.org/http://prdownloads.sourceforge.net/winprinthylafax/WinprintHylaFAX-1.2.9.exe?downloadhttps://sourceforge.net/projects/winprinthylafax/http://www.hylafax.org/http://www.hylafax.org/http://prdownloads.sourceforge.net/winprinthylafax/WinprintHylaFAX-1.2.9.exe?downloadhttps://sourceforge.net/projects/winprinthylafax/
  • 8/12/2019 Installation Manual for Asterisk Iaxmodem Postfix and HylaFax WinPrintHylaFax

    12/15

    The drop list might scroll: so it may not be obvious that its at the bottom of the list! A$f it doesntappear on the list at all: something went wrong with your installation!B

    5ext: a box will pop up for you to name the port! The name doesnt actually matter: but naming itHF",(1 will help to identify it!

    5ext: select the printer type! Experience has shown that the "pple ?aserWriter (3.C) S is a goodchoice: and $ recommend it! *ost any other ostScript printer willprobablywor#!

  • 8/12/2019 Installation Manual for Asterisk Iaxmodem Postfix and HylaFax WinPrintHylaFax

    13/15

    %f course: name it whatever you want: preferably something that says: =hey: this is going to a F",machine!=

    8onot share the printer! This is rather silly anyway: since you can locally install Winprint HylaF",on any system that needs it: and it communicates directly with the HylaF", server! Since it pops upthe dialog box as#ing where to send the F", Iob locally: this would be ugly: at best! "lso: dont

    print a test page: since youre not done configuring the printer yet!

    6ight-clic# on the printer to call up its properties: and select the =orts= tab! ?ocate the port you Iustcreated!

  • 8/12/2019 Installation Manual for Asterisk Iaxmodem Postfix and HylaFax WinPrintHylaFax

    14/15

    ress the =+onfigure ort= button to configure the connection to your HylaF", server!

    *ost people who have problems are going to have problems because their HylaF", server wontlet them connect! 'rea# out your HylaF", server documentation: and ma#e sure that you have setup the correct permissions: which can be as simple as putting the $ address of your client into.var.spool.fax.etc.hosts!hfaxd! @ou may not need the username -or- password: in which case: you

  • 8/12/2019 Installation Manual for Asterisk Iaxmodem Postfix and HylaFax WinPrintHylaFax

    15/15

    can leave password blan#: but the username is always reLuired: even if it isnt authenticated!

    %#ay: nowyoure ready to print a test Iob! When you send anything to this printer: a dialog box willappear1

    The F", number is completely unedited and unverified! $t relies on HylaF",s dialing rules toma#e sense of it! "s you would expect: the HylaF", server will send an e-mail confirming deliveryAor failure to do soB to the specified e-mail address!

    !est environment

    %S1 openSUSE ((!J xN;C2ernel version1 3!!JC!N-)!3-xen"steris# version1 "steris#-(!!3!()8ahdi version1 dahdi-linux-complete-3!J!)!(>3!J!)?ibpri version1 libpri-(!C!((!Costfix version1 postfix-3!!(-3!!(HylaFax version1hylafax-!)!C-C!J!3iaxmodem version1 iaxmodem-(!3!)Hardware%pen&ox '())