Agenzia di Comunicazione e Web Marketing | Milano | Novara | Varese | Ravenna

Installazione e Configurazione Asterisk PBX + IaxModem + Hylafax Server (1a parte) (Demo)

NOVITA’ – Video Guida Articolo disponibile al seguente indirizzo YouTube:

Siccome in queste settimane ho perso un sacco di tempo per cercare di installare e configurare Asterisk sul mio server Debian Squeeze ho deciso di fare una guida passo passo all’installazione ed alla configurazione del centralino.

Quello che andremo a creare è un sistema telefonico che smisti le chiamate voce agli interni e le chiamate fax al fax server che automaticamente ce li manderà via email in PDF.

1 – Accediamo come root e controlliamo / installiamo eventuali aggiornamenti software

su -l root
apt-get update
apt-get upgrade

2 – Scarichiamo ed installiamo Iaxmodem

apt-get install iaxmodem

3 – creiamo un nuovo file in /etc/iaxmodem/ dove andiamo a dichiarare il modem “virtuale” e lo chiamiamo ttyIAX1

nano /etc/iaxmodem/ttyIAX1

4 – ed inseriamo i seguenti parametri e salviamo il file (CTRL+O da tastiera)

device /dev/ttyIAX1
owner uucp:uucp
mode 660
port 4570
refresh 60
peername iaxmodem1
secret INSERISCI QUI LA TUA PASSWORD Es. mia_password
codec ulaw

5 – fatto ciò riavviamo iaxmodem e verifichiamo che in /dev/ sia presente ttyIAX1

service iaxmodem stop
service iaxmodem start
ls /dev

il comando “ls /dev” mostra il convenuto della cartella /dev, se il file ttyIAX1 è presente allora iaxmodem è installo e configurato correttamente, se così non fosse controllate il contenuto del file ttyIAX1 e correggete eventuali errori

6- scarichiamo ed installiamo hylafax-server ed i eventuali pacchetti dipendenti che ci verranno proposti

apt-get install hylafax-server

7 – a questo punto dobbiamo aggiungere il modem precedentemente creato (ttyIAX1) e lo facciamo con il comando faxaddmodem


8 – e rispondiamo alle domande che ci vengono proposte (come qui sotto modificando i dati in grassetto con il vostri dati)

Serial port that modem is connected to [ttyS0]? ttyIAX1

Ok, time to setup a configuration file for the modem. The manual
page config(5) may be useful during this process. Also be aware
that at any time you can safely interrupt this procedure.

Reading scheduler config file /var/spool/hylafax/etc/config.

No existing configuration, let’s do this from scratch.

Country code [1]? 039
Area code [415]? 02
Phone number of fax modem [+1.999.555.1212]? +39.02.12345678
Local identification string (for TSI/CIG) [“NothingSetup”]? Mio Fax
Long distance dialing prefix [1]? 0
International dialing prefix [011]? 00
Dial string rules file (relative to /var/spool/hylafax) [etc/dialrules]?
Tracing during normal server operation [1]?
Tracing during send and receive sessions [11]?
Protection mode for received facsimile [0600]? 0666
Protection mode for session logs [0600]? 0666
Protection mode for ttyIAX1 [0600]? 0666
Rings to wait before answering [1]? 2
Modem speaker volume [off]?
Command line arguments to getty program [“-h %l dx_%s”]?
Pathname of TSI access control list file (relative to /var/spool/hylafax) [“”]?
Pathname of Caller-ID access control list file (relative to /var/spool/hylafax) [“”]?
Tag line font file (relative to /var/spool/hylafax) [etc/lutRS18.pcf]?
Tag line format string [“From %%l|%c|Page %%P of %%T”]?
Time before purging a stale UUCP lock file (secs) [30]?
Hold UUCP lockfile during inbound data calls [Yes]?
Hold UUCP lockfile during inbound voice calls [Yes]?
Percent good lines to accept during copy quality checking [95]?
Max consecutive bad lines to accept during copy quality checking [5]? 3
Max number of pages to accept in a received facsimile [25]?
Syslog facility name for ServerTracing messages [daemon]?
Set UID to 0 to manipulate CLOCAL [“”]?
Use available priority job scheduling mechanism [“”]?

Your facsimile phone number (+0212345678) does not agree with your
country code (039) or area code (02). The number
should be a fully qualified international dialing number of the form:

+039 02 <local phone number>

Spaces, hyphens, and periods can be included for legibility. For example,


is a possible phone number (using your country and area codes).

The non-default server configuration parameters are:

CountryCode: 039
AreaCode: 02
FAXNumber: +39.02.12345678
LongDistancePrefix: 0
InternationalPrefix: 00
DialStringRules: etc/dialrules
SessionTracing: 11
RecvFileMode: 0666
LogFileMode: 0666
DeviceMode: 0666
RingsBeforeAnswer: 2
SpeakerVolume: off
GettyArgs: “-h %l dx_%s”
LocalIdentifier: Mio Fax
TagLineFont: etc/lutRS18.pcf
TagLineFormat: “From %%l|%c|Page %%P of %%T”
MaxConsecutiveBadLines: 3
MaxRecvPages: 25

Are these ok [yes]? yes

9 – dopo di che hylafax procederà a testare la velocità del modem e ci fara altre domande, rispondiamo sempre come indico qui sotto, l’unica raccomandazione è di inserire classe di modem 1 e non 1.0 

Now we are going to probe the tty port to figure out the type
of modem that is attached. This takes a few seconds, so be patient.
Note that if you do not have the modem cabled to the port, or the
modem is turned off, this may hang (just go and cable up the modem
or turn it on, or whatever).

Probing for best speed to talk to modem: 38400 OK.

About fax classes:

The difference between fax classes has to do with how HylaFAX interacts
with the modem and the fax protocol features that are used when sending
or receiving faxes. One class isn’t inherently better than another;
however, one probably will suit a user’s needs better than others.

Class 1 relies on HylaFAX to perform the bulk of the fax protocol.
Class 2 relies on the modem to perform the bulk of the fax protocol.
Class 2.0 is similar to Class 2 but may include more features.
Class 1.0 is similar to Class 1 but may add V.34-fax capability.
Class 2.1 is similar to Class 2.0 but adds V.34-fax capability.

HylaFAX generally will have more features when using Class 1/1.0 than
when using most modems’ Class 2 or Class 2.0 implementations. Generally
any problems encountered in Class 1/1.0 can be resolved by modifications
to HylaFAX, but usually any problems encountered in Class 2/2.0/2.1 will
require the modem manufacturer to resolve it.

Use Class 1 unless you have a good reason not to.

This modem looks to have support for Class 1.0 and 1.
How should it be configured [1.0]? 1

Hmm, this looks like a Class 1 modem.
Product code (ATI0) is “spandsp”.
Other information (ATI3) is “”.
DTE-DCE flow control scheme [default]?
Modem manufacturer is “spandsp”.
Modem model is “IAXmodem”.

Using prototype configuration file iaxmodem…

The modem configuration parameters are:

ModemResetCmds: “ATH1nAT+VCID=1”

Are these ok [yes]? yes

Creating new configuration file /var/spool/hylafax/etc/config.ttyIAX1…
Creating fifo /var/spool/hylafax/FIFO.ttyIAX1 for faxgetty… done.
Done setting up the modem configuration.

Checking /var/spool/hylafax/etc/config for consistency…
…everything looks ok; leaving existing file unchanged.

Don’t forget to restart hylafax in order to run faxgetty on this new modem

10 – e come suggerito riavviamo hylafax

service hylafax stop
service hylafax start

11 – a questo punto non ci rimane che installare asterisk

apt-get install asterisk

12 – ora possiamo provare ad entrare nella console di asterisk (CLI)

asterisk -r

13 – e se tutto va deve dovremmo vedere il seguente messaggio a terminale

Asterisk, Copyright (C) 1999 – 2010 Digium, Inc. and others.
Created by Mark Spencer <>
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘core show license’ for details.
Connected to Asterisk currently running on centralino (pid = 2750)

Bene abbiamo finito!!

Nella prossima guida configureremo gli interni, i canali SIP (VOIP), i fax, la voicemail (segreteria) e perchè no, metteremo una musica di attesa al posto del solito squillo (odioso quando suona all’infinito)

Per chiarimenti, informazioni o suggerimenti scrivetemi.

% Commenti (2)

[…] Installazione e Configurazione Asterisk PBX + IaxModem + Hylafax Server (1a parte) […]

[…] Video Guida del seguente Articolo: Installazione e Configurazione Asterisk PBX + IaxModem + Hylafax … […]

Leave a comment