Архив рубрики: asterisk

Asterisk 11 Centos 6.5 Установка

Образ используемый для установки
CentOS-6.5-x86_64-minimal.iso   md5 0d9dc37b5dd4befa1c440d2174e88a87

VM под астериск
Суффиксы DNS поиска iamroot.ru

[root@ast-01 ~]# uname -r
[root@ast-01 ~]# yum update –y
[root@ast-01 ~]# sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config
[root@ast-01 ~]# yum install -y make wget openssl-devel ncurses-devel newt-devel libxml2-devel kernel-devel gcc gcc-c++ sqlite-devel libuuid-devel nano perl
[root@ast-01 jansson-2.5]# cd ../
[root@ast-01 src]# wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
[root@ast-01 src]# wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4-current.tar.gz
[root@ast-01 src]# wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-11-current.tar.gz
[root@ast-01 src]# tar zxvf dahdi-linux-complete*
[root@ast-01 src]# tar zxvf libpri*
[root@ast-01 src]# tar zxvf asterisk*
[root@ast-01 src]# reboot
[root@ast-01 src]# cd /usr/src/dahdi-linux-complete* && make && make install && makeconfig
[root@ast-01 src]# chkconfig --add dahdi
[root@ast-01 src]# cd /usr/src/libpri* && make && make install
[root@ast-01 libpri-1.4.14]# cd /usr/src/asterisk*
[root@ast-01 asterisk-11.7.0]#./configure --libdir=/usr/lib64 && make menuselect && make && make install
[root@ast-01 asterisk-11.7.0]# make samples
[root@ast-01 asterisk-11.7.0]# yum install doxygen -y && make progdocs
[root@ast-01 asterisk-11.7.0]# make config
[root@ast-01 asterisk-11.7.0]# service dahdi start
[root@ast-01 asterisk-11.7.0]# service asterisk start
[root@ast-01 asterisk-11.7.0]# asterisk -r
Privilege escalation protection disabled!
See https://wiki.asterisk.org/wiki/x/1gKfAQ for more details.
Asterisk 11.7.0, Copyright (C) 1999 - 2013 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
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 11.7.0 currently running on ast-01 (pid = 29706)

[root@ast-01 src]# cd /usr/src/
[root@ast-01 src]# yum install -y python iptables
[root@ast-01 src]# wget sourceforge.net/projects/fail2ban/files/fail2ban-stable/fail2ban-0.8.4/fail2ban-0.8.4.tar.bz2/download
[root@ast-01 src]# tar jxf fail2ban-0.8.4.tar.bz2
[root@ast-01 src]# cd fail2ban-0.8.4
[root@ast-01 fail2ban-0.8.4]# python setup.py install
[root@ast-01 fail2ban-0.8.4]# cp /usr/src/fail2ban-0.8.4/files/redhat-initd /etc/init.d/fail2ban
[root@ast-01 fail2ban-0.8.4]# chmod 755 /etc/init.d/fail2ban
[root@ast-01 files]# touch /etc/fail2ban/filter.d/asterisk.conf
[root@ast-01 files]# cat /etc/fail2ban/filter.d/asterisk.conf
# Fail2Ban configuration file
# Read common prefixes. If any customizations available -- read them from
# common.local
#before = common.conf
#_daemon = asterisk
# Option: failregex
# Notes.: regex to match the password failures messages in the logfile. The
# host must be matched by a group named "host". The tag "" can
# be used for standard IP/hostname matching and is only an alias for
# (?:::f{4,6}:)?(?P\S+)
# Values: TEXT
failregex = NOTICE.* .*: Registration from '.*' failed for '' - Wrong password
NOTICE.* .*: Registration from '.*' failed for '' - No matching peer found
NOTICE.* .*: Registration from '.*' failed for '' - Username/auth name mismatch
NOTICE.* .*: Registration from '.*' failed for '' - Device does not match ACL
NOTICE.* .*: Registration from '.*' failed for '' - Peer is not supposed to register
NOTICE.* .*: Registration from '.*' failed for '' - ACL error (permit/deny)
NOTICE.* .*: Registration from '.*' failed for '' - Device does not match ACL
NOTICE.* failed to authenticate as '.*'$
NOTICE.* .*: No registration for peer '.*' \(from \)
NOTICE.* .*: Host failed MD5 authentication for '.*' (.*)
NOTICE.* .*: Failed to authenticate user .*@.*
# Option: ignoreregex
# Notes.: regex to ignore. If this regex matches, the line is ignored.
# Values: TEXT
ignoreregex = #указываем наш IP с которого не будет проходить блок
[root@ast-01 files]#cat /etc/fail2ban/jail.conf

enabled = true
filter = asterisk
action = iptables-allports[name=ASTERISK, protocol=all]
sendmail-whois[name=ASTERISK, dest=root, sender=fail2ban@localhost]
logpath = /var/log/messages
maxretry = 5
bantime = 259200
[root@ast-01 files]# nano /etc/asterisk/logger.conf
dateformat=%F %T

syslog.local0 => notice
[root@ast-01 files]#service iptables start
[root@ast-01 files]#service fail2ban start

ASTERISKNOW как сменить пароль

Смена стандартных паролей

После установки сервера, обновляемся и начинаем настраивать нашу программную-АТС.
Нам необходимо сменить стандартный пароль
[admin@asteriamroot]# mysql -u freepbx -p
Вводим стандартный пароль: fpbx
Читать далее


Посылаем факс :

sendfax -n -d number file1 file2 ..

Проверяем результаты :

faxstat -s (shows fax in the queue waiting to be sent)
faxstat -d (shows faxes sent)
faxstat -r (shows faxes received)

Удаляем факс из очереди :

faxrm number_of_job

Очистить spool :


Статистика :


Настраиваем факс на астериске

Копи-паст не мой откуда копировал не помню

A fax server with IAXmodem and Hylafax

The IAXmodem application emulates a faxmodem, which may be operated by a fax application of the administrator’s choosing. We’ll use the popular Hylafax. For simplicity and consistency, the installation platform will be the same Debian Linux and Asterisk 1.4 we have used for the other examples (see the section called “Installing Asterisk 1.4.x on Debian Linux 4.0 (Etch)”).
Installing IAXmodem

IAXmodem simulates a faxmodem and makes it available to Asterisk via IAX2. All the steps in this chapter must be performed as the root user.

To install IAXmodem, we need some additional Debian packages, which may be installed with the command apt-get -y install g++ libtiff-tools libtiff4 libtiff4-dev.

debian:~# apt-get -y install g++ libtiff-tools libtiff4 libtiff4-dev
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Die folgenden zusätzlichen Pakete werden installiert:
g++ libjpeg62 libjpeg62-dev libtiffxx0 zlib1g-dev


Richte zlib1g-dev ein (1.2.2-4.sarge.2) …
Richte libtiff4-dev ein (3.7.2-7) …


We switch into the appropriate directory with cd /usr/src to install the IAXmodem source code:

debian:~# cd /usr/src

The sources for IAXmodem can be downloaded with any typical web browser from http://iaxmodem.sourceforge.net (the version used in this example is 0.3.0). After downloading the archive, copy it to /usr/src and unpack it with tar -xvzf iaxmodem-0.3.0.tar.gz.

debian:/usr/src# tar -xvzf iaxmodem-0.3.0.tar.gz



Change into the unpacked directory with cd iaxmodem-0.3.0:

debian:/usr/src# cd iaxmodem-0.3.0

Now compile the sources with ./configure && make:

debian:/usr/src/iaxmodem-0.3.0# ./configure && make
checking for a BSD-compatible install… /usr/bin/install -c
checking whether build environment is sane… yes
checking for gawk… no
checking for mawk… mawk
checking whether make sets $(MAKE)… yes
checking for gcc… gcc


cc -DMODEMVER=»0.3.0″ -DDSPVER=»spandsp-0.0.3-snapshot-20070223+» -D
IAXVER=»libiax2-0.2.3-CVS-20060222+» -Wall -g -DSTATICLIBS -DUSE_UNIX9
8_PTY -std=c99 -Ilib/libiax2/src -Ilib/spandsp/src -c iaxmodem.c
cc -DMODEMVER=»0.3.0″ -DDSPVER=»spandsp-0.0.3-snapshot-20070223+» -D
IAXVER=»libiax2-0.2.3-CVS-20060222+» -Wall -g -DSTATICLIBS -DUSE_UNIX9
8_PTY -std=c99 -Ilib/libiax2/src -Ilib/spandsp/src iaxmodem.o lib/spand
sp/src/.libs/libspandsp.a lib/libiax2/src/.libs/libiax.a -o iaxmodem -lm
-lutil -ltiff



Copy the resulting binary into /usr/bin with cp iaxmodem /usr/bin/:

debian:/usr/src/iaxmodem-0.3.0# cp iaxmodem /usr/bin/

Now we can configure the modem. IAXmodem expects to find configuration files in /etc/iaxmodem. Create it with mkdir /etc/iaxmodem:

debian:/usr/src/iaxmodem-0.3.0# mkdir /etc/iaxmodem

Create the configuration file with touch /etc/iaxmodem/ttyIAX0:

debian:/usr/src/iaxmodem-0.3.0# touch /etc/iaxmodem/ttyIAX0

This file must contain the following parameters:

The device node to be created in /dev. This is the device Hylafax uses to connect to IAXmodem. You can choose any name you like, but we prefer to adhere to the convention and so choose a device name appropriate for a serial interface, ttyIAX0.
This is the owner of the device (in the form user:group). It is best to use the same user and group under which Hylafax runs.
The port that IAXmodem listens on. Asterisk uses 4569 to listen for IAX2 connections, so you must choose something else, e.g. 4570.
This sets how long IAXmodem waits between registrations with Asterisk. If this number is 0, the modem does not register at all.
IP address of the server running Asterisk. If this is on the same machine as IAXmodem, use the localhost address
The name under which IAXmodem registers with Asterisk.
The password used for Asterisk registration.
The codec used by IAXmodem. Allowed codecs are alaw, ulaw and slinear. Compressed codecs are not appropriate for faxing; fax transmissions are themselves compressed and don’t tolerate further compression; moreover, most compressed codecs are lossy and a fax transmission will not tolerate losses. This is one of the major reasons why faxing over VoIP remains problematic.

Using an appropriate editor (e.g. vi) we write the following configuration in the file /etc/iaxmodem/ttyIAX0:

device /dev/ttyIAX0
owner uucp:uucp
mode 660
port 4570
refresh 50
peername iaxmodem
secret password
codec alaw

IAXmodem is now configured and can be started. The best way to do this is with init. Add a line to start IAXmodem to /etc/inittab with echo «IA00:23:respawn:/usr/bin/iaxmodem ttyIAX0» >> /etc/inittab:

debian:/usr/src/iaxmodem-0.3.0# echo «IA00:23:respawn:/usr/bin/iaxmodem
ttyIAX0″ >> /etc/inittab

The device name ttyIAX0 is the same device name as specified in /etc/iaxmodem.

To receive faxes, we need a getty that listens for connections on the IAXmodem. This is accomplished through an additional entry in /etc/inittab. Add it with echo «mo00:23:respawn:/usr/sbin/faxgetty ttyIAX0» >> /etc/inittab.

mo00:23:respawn:/usr/local/sbin/faxgetty ttyIAX0

Create a log directory for IAXmodem with mkdir /var/log/iaxmodem/ and the log files with touch /var/log/iaxmodem/ttyIAX0 and touch /var/log/iaxmodem/iaxmodem.

debian:/usr/src/iaxmodem-0.3.0# mkdir /var/log/iaxmodem/
debian:/usr/src/iaxmodem-0.3.0# touch /var/log/iaxmodem/ttyIAX0
debian:/usr/src/iaxmodem-0.3.0# touch /var/log/iaxmodem/iaxmodem

To make sure everything will start as expected at boot time, reboot the system with shutdown -r now.

debian:/usr/src/iaxmodem-0.3.0# shutdown -r now

Broadcast message from root@debian (pts/1) (Sat May 5 00:15:49 2007):

The system is going down for reboot NOW!

Installing Hylafax

We’ll install Hylafax from the Debian Repository to simplify installation. Do this with apt-get -y install hylafax-server . Dependencies are automatically resolved:

debian:~# apt-get install -y hylafax-server
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Die folgenden zusätzlichen Pakete werden installiert:
enscript gs-common gs-esp hylafax-client libcupsimage2 libcupsys2 mail
x metamail psmisc
Vorgeschlagene Pakete:
gv postscript-viewer lpr gs-pdfencrypt gs-cjk-resource mgetty-viewfax
hylafax-doc mgetty cupsys-common
Empfohlene Pakete:
psfontmgr netpbm transfig
Die folgenden NEUEN Pakete werden installiert:
enscript gs-common gs-esp hylafax-client hylafax-server libcupsimage2
libcupsys2 mailx metamail psmisc


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

HylaFAX configuration parameters are:

[1] Init script starts faxq: yes
[2] Init script starts hfaxd yes
[3] Start old protocol: no
[4] Start paging protocol: no
Are these ok [yes]?
Modem support functions written to /var/spool/hylafax/etc/setup.modem.
Configuration parameters written to /var/spool/hylafax/etc/setup.cache.

Restarting HylaFAX server processes.

Should I restart the HylaFAX server processes [yes]?
You do not appear to have any modems configured for use. Modems are
configured for use with HylaFAX with the faxaddmodem(8) command.
Do you want to run faxaddmodem to configure a modem [yes]?
Done verifying system setup.
Updating /etc/hylafax/setup.cache from /var/spool/hylafax/etc/setup.cach
Updating /etc/hylafax/setup.modem from /var/spool/hylafax/etc/setup.mode
m.apt-get -y install hylafax-server
Starting HylaFAX: faxq hfaxd faxgetty.


The next step is the configuration of the fax server. Do this with faxsetup:

debian:/usr/src/hylafax-4.3.4# faxsetup


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

HylaFAX configuration parameters are:

[1] Init script starts faxq: yes
[2] Init script starts hfaxd yes
[3] Start old protocol: no
[4] Start paging protocol: no

Are these ok [yes]?

Simply press Enter after the following 2-3 questions.

You have a HylaFAX scheduler process running. faxq will be
restarted shortly, as soon as some other work has been completed.
Can I terminate this faxq process (4048) [yes]?
Should I restart the HylaFAX server processes [yes]?

/etc/init.d/hylafax start
Not starting HylaFAX daemons since they are already running.


Modems are configured for use with HylaFAX with the faxaddmodem(8) comma
Do you want to run faxaddmodem to configure a modem [yes]?

We confirm restart of the server processes with yes and are asked if we want to install a modem. Our IAXmodem 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 [ttyS0]? ttyIAX0

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.

Many questions follow, but only a few of them are really important.[44]This is where you set international dialing codes, the fax number, country and area code, and the CSID (Call Subscriber ID) which is printed on the top line of the fax page on the receiver’s end. Confirm with yes.

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

Country code [1]? 1
Area code []? 403
Phone number of fax modem [+1.999.555.1212]? +1 888 555 4091
Local identification string (for TSI/CIG) [«NothingSetup»]?
Long distance dialing prefix [1]? 1
International dialing prefix [011]? 011
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]?
Protection mode for session logs [0600]?
Protection mode for ttyIAX0 [0600]?
Rings to wait before answering [1]?
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/h
ylafax) [«»]?
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]?
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 [«»]?

A confirmation page follows where you can double-check your entries:

The non-default server configuration parameters are:

CountryCode: 1
AreaCode: 403
FAXNumber: +1 888 555 4091
LongDistancePrefix: 0
InternationalPrefix: 00
DialStringRules: etc/dialrules
SessionTracing: 11
RingsBeforeAnswer: 1
SpeakerVolume: off
GettyArgs: «-h %l dx_%s»
LocalIdentifier: «NothingSetup»
TagLineFont: etc/lutRS18.pcf
TagLineFormat: «From %%l|%c|Page %%P of %%T»
MaxRecvPages: 25

Are these ok [yes]?

Answering yes brings us to modem detection:

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.

If you’re unsure and your modem supports it, use Class 1.

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

Hmm, this looks like a Class 1 modem.
Product code (ATI0) is «spandsp».
Other information (ATI3) is «www.soft-switch.org».
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]?

The modem was detected and we are asked if it is a Class 1 modem, and we confirm this because it is exactly what we want. The default reset commands are also acceptable. Confirm with yes.

Answer the first question In the next dialog with no, since we don’t need to configure any further modems. The second question is confirmed with by pressing Enter, which starts the fax server.

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


Do you want to run faxaddmodem to configure another modem [yes]? no


Should I run faxmodem for each configured modem [yes]?
/usr/sbin/faxmodem ttyIAX0

Done verifying system setup.


Hylfax is now configured for sending faxes.
Receiving faxes

Our fax solution still has to be integrated into Asterisk. To do this, we configure the IAXmodem as an IAX2 peer by adding a section to /etc/asterisk/iax.conf (see also ???):

bindport = 4569
bindaddr =


Global settings are defined in the general section. In this example we are binding the standard IAX2 port of 4569. The bindaddr defines the IP address (and thereby the interface) on which the IAX2 channel driver listens for connections; in this case, it is set to listen on all interfaces.

The IAXmodem is set to type friend, which allows both incoming and outgoing connections. The secret and port parameters match those in the IAXmodem configuration we did above, and context defines the entry context for outgoing connections.

Enter iax2 show peers in the Asterisk console to see our new IAXmodem:

*CLI> iax2 show peers
Name/Username Host Mask Port Sta
iaxmodem (D) 4570 Unm
1 iax2 peers [0 online, 0 offline, 1 unmonitored]

We are, of course, not done yet. Asterisk still needs an extension so that it knows what to do with an incoming fax. Our objective is to ensure that any incoming faxes are passed on to Hylafax. In this example, we assume that all faxes come in through a SIP provider. A real configuration will have to reflect the installation and account settings of the SIP provider you use; for the sake of example, a configuration in sip.conf might look like this:




The corresponding context in extensions.conf would look like this:

exten => _X.,1,Dial(IAX2/iaxmodem)

Any faxes coming in will now be routed to Hylafax via IAXmodem and ultimately e-mailed to the user address defined in the faxmaster alias.
Sending faxes

The next obvious step is configuring our system to send faxes. Here, too, we need a context (this time it is [fax-out]) in extensions.conf. If IAXmodem wants to send a fax, it will automatically land in this context. If the faxes are to go out our hypothetical SIP connection 123456, the entry in extensions.conf will look like this:

exten => _X.,1,Dial(SIP/123456/${EXTEN})

We can test sending of faxes with sendfax -n -d :

debian:~# sendfax -n -d 6045557977 /etc/issue.net

We should see this in the CLI:

— Accepting AUTHENTICATED call from
> requested format = alaw,
> requested prefs = (),
> actual format = alaw,
> host prefs = (alaw),
> priority = mine
— Executing Answer(«IAX2/iaxmodem-3», «») in new stack
— Executing Dial(«IAX2/iaxmodem-3», «SIP/123456/6045557977») in new
— Called 123456/6045557977
— SIP/123456-0818f630 is making progress passing it to IAX2/iaxmode
— SIP/123456-0818f630 answered IAX2/iaxmodem-3
— parse_srv: SRV mapped to host my-voip-provider.com, port 5060
== Spawn extension (fax-out, 6045557977, 2) exited non-zero on ‘IAX2/i
— Executing Hangup(«IAX2/iaxmodem-3», «») in new stack
== Spawn extension (fax-out, h, 1) exited non-zero on ‘IAX2/iaxmodem-3

— Hungup ‘IAX2/iaxmodem-3’

If we issue the command faxstat -s during the transmission, we will see:

debian:~# faxstat -s
HylaFAX scheduler on w077.example.com: Running
Modem ttyIAX0 (123456): Sending job 7

JID Pri S Owner Number Pages Dials TTS Status
7 127 R root 06912345678 0:1 0:12

Done! Now you can send and receive faxes via Asterisk using Hylafax.

The Hylafax website http://www.hylafax.org has numerous examples and how-tos that will help you integrate your Hylafax installation with your existing office intrastructure effectively.
Sending 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.[45]The recipient will receive the fax as an e-mail attachment.

To do this, the configuration file /var/spool/hylafax/etc/FaxDispatch must contain the following parameters:

The destination e-mail address for incoming faxes.
The format of the attachment. In addition to pdf, tiff (Tagged Image File Format) and ps (Postscript™) are also acceptable options.


After the file has been saved, you must restart the fax server with /etc/init.d/hylafax restart.

debian:~# /etc/ini.d/hylafax restart
Starting HylaFAX: faxq hfaxd.

We can test e-mail transmission by sending ourselves a fax with sendfax -n -d

debian:~# sendfax -n -d 6045557977 /etc/issue.net

After a short time your target e-mail address should receive an e-mail in the following format:

recvq/fax000000016.tif (ftp://debian:4559/recvq/fax000000016.tif):

Sender: IAXmodem
Pages: 4
Quality: Normal
Size: North American Letter
Received: 2007:06:02 02:49:45
Time To Receive: 1:58
Signal Rate: 9600 bit/s
Data Format: 2-D MMR
Error Correct: Yes
CallID1: 2007
CallID2: IAXmodem 1
Received On: ttyIAX0
CommID: 000000033 (ftp://debian:4559/log/c000000033)


Jun 02 02:51:46.99: [ 3320]: RECV FAX: bin/faxrcvd «recvq/fax000000016.t
if» «ttyIAX0» «000000033» «COMREC received DCN» «2007» «IAXmodem 1» «<NO
NE>» «s»
Jun 02 02:51:47.00: [ 3320]: RECV FAX: end
Jun 02 02:51:47.00: [ 3320]: SESSION END
Jun 02 02:51:47.01: [ 3320]: RECV FAX (000000033): recvq/fax000000016.ti
f from IAXmodem, route to , 4 pages in 2:08

The attachment will be a PDF file. In this example, the PDF is named fax000000016.pdf.

Now you can not only send and receive faxes, but received faxes are also received as e-mail attachments.
IAXmodem and Hylafax FAQ

Where does Hylafax save received faxes?

In /var/spool/hylafax/recvq .

Can I use something other than Hylafax?

Yes, absolutely. Nevertheless, Hylafax has proven to be very robust and flexible and is widely used.

Is there an easy to use Faxclient for Windows?

Yes, please have a look at the Hylafax Client page at http://www.hylafax.org/content/Client_Software.

Does Hylafax have its own FAQ?

Yes. You can find it at http://www.hylafax.org/content/FAQ.

[44] May those who have tuned Hylafax before forgive us; for now, the defaults will do.

[45] Our example assumes a properly configured MTA (e.g. Sendmail, Postfix or a lightweight SMTP engine like ssmtp).

Debian asterisk howto

Итак- для начала установим дебиан — при установке выбирайте минимальную конфигурацию, настраивайте подключение к интернет,
и, зайдя под рутом, дайте
aptitude update
aptitude upgrade

после ребута поставим

aptitude install ssh ntp screen

Далее для нормальной работы нам будет необходимо скомпилить ядро с некоторыми изменениями, которые, если верить первоисточнику, влияют на работу конкретно Asterisk

для этого установим всё необходимое

aptitude install kernel-package libncurses5-dev fakeroot wget bzip2 build-essential

Загрузим исходники ядра
cd /usr/src
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-
(можно посвежее)

tar xjf linux-2.6.*

ln -s /usr/src/linux- /usr/src/linux
cd /usr/src/linux

Копируем текущую конфигурацию в /usr/src/linux:
make clean && make mrproper
cp /boot/config-`uname -r` ./.config
make menuconfig

в меню выбираем «Load alternate configuration…» и выбираем конфигурационный файл который скопировали в /usr/src/linux
— /usr/src/linux/.config

Нужно поправить несколько параметров в конфиге ядра
В разделе «Processor type and features» выбираем:
«Enable IRQ balancing» is disabled
«Timer frequency» change the value 250 Hz by 1000 Hz.
«High Resolution Timer Option» and «HPET Timer Support» as built-in.

После всего сохраняем конфиг и выходим
Компилим ядро и хедеры
make-kpkg clean
fakeroot make-kpkg —initrd —append-to-version=-custom kernel_image kernel_headers

Компилится долго. После этого должно появиться два .deb пакета в каталоге /usr/src/
Инсталлируем их:

cd /usr/src
dpkg -i linux-image-
dpkg -i linux-headers-

Смотрим запустилось ли то ядро что нужно:
uname -a
Должно вывести что-то наподобие «Linux asterisk».

Дабы удовлетворить зависимости в дальнейшем ставим:

aptitude install build-essential libcurl3-dev libvorbis-dev libspeex-dev unixodbc unixodbc-dev libiksemel-dev flex xsltproc
aptitude install linux-headers-`uname -r` g++ libncurses5-dev libnewt-dev libusb-dev subversion git-core

Качаем и распаковываем исходники:

cd /usr/src
wget http://downloads.digium.com/pub/asterisk/asterisk-1.4-current.tar.gz
wget http://downloads.digium.com/pub/zaptel/zaptel-1.4-current.tar.gz
wget http://downloads.digium.com/pub/libpri/libpri-1.4-current.tar.gz
wget http://www.misdn.org/downloads/mISDN.tar.gz
wget http://www.misdn.org/downloads/mISDNuser.tar.gz
wget http://downloads.digium.com/pub/asterisk/asterisk-addons-1.4-current.tar.gz
tar xvzf asterisk-1.4-current.tar.gz && tar xvzf zaptel-1.4-current.tar.gz && tar xvzf libpri-1.4-current.tar.gz && tar xvzf mISDN.tar.gz && tar xvzf mISDNuser.tar.gz && tar xvzf asterisk-addons-1.4-current.tar.gz

Ставим всё что нужно для работы Asterisk:
aptitude install build-essential libcurl3-dev libvorbis-dev libspeex-dev unixodbc unixodbc-dev libiksemel-dev flex xsltproc
aptitude install linux-headers-`uname -r` g++ libncurses5-dev libnewt-dev libusb-dev subversion git-core

Скачиваем и распаковываем:
cd /usr/src
wget http://downloads.digium.com/pub/asterisk/asterisk-1.4-current.tar.gz
wget http://downloads.digium.com/pub/zaptel/zaptel-1.4-current.tar.gz
wget http://downloads.digium.com/pub/libpri/libpri-1.4-current.tar.gz
wget http://www.misdn.org/downloads/mISDN.tar.gz
wget http://www.misdn.org/downloads/mISDNuser.tar.gz
wget http://downloads.digium.com/pub/asterisk/asterisk-addons-1.4-current.tar.gz
tar xvzf asterisk-1.4-current.tar.gz && tar xvzf zaptel-1.4-current.tar.gz && tar xvzf libpri-1.4-current.tar.gz && tar xvzf mISDN.tar.gz && tar xvzf mISDNuser.tar.gz && tar xvzf asterisk-addons-1.4-current.tar.gz

Ставим Zaptel:
cd /usr/src/zaptel-1.4*
./install_prereq test
./install_prereq install
make install
make config
modprobe ztdummy

Cтавим Libpri:
cd /usr/src/libpri-1.4*
make && make install

Ставим mISDN:
Не ставьте версию (1.1.7) с ядром ( В доках написано что не работает. Я ставил всё самое последнее — работает.
cd /usr/src
git-clone git://git.misdn.org/git/mISDN.git/
git-clone git://git.misdn.org/git/mISDNuser.git/
cd /usr/src/mISDN
make install
cd /usr/src/mISDNuser/
make && make install

mISDN scan
mISDN config
будет создан /etc/mISDN.conf котрый можно смотреть и дополнять.
vi /etc/mISDN.conf
Если всё ок то стартуем:
mISDN start

Проверяем всё ли в порядке
Системные скрипты для старта mISDN:
/usr/sbin/update-rc.d mISDN defaults 15 30

Собственно установка Asterisk
cd /usr/src/asterisk-1.4*

Можно выбрать дополнительные звуковые дорожки для голосового меню
make menuselect
Выберите core-sounds которые будете использовать и другие если нужно . Выходите через «x» с записью изменений. Затем:
make install
make samples
make config
asterisk -vvvc
stop now
echo «ztdummy» >> /etc/modules

Если ошиблись и компиляция закончилась неудачно то
make clean
make install


Перезагрузитесь и проверьте как работает Asterisk.
asterisk -r

Установка аддонов:
cd /usr/src/asterisk-addons*
./configure && make && make install
make samples

Установимl Asterisk-GUI
Конфиги сохраним
cp -r /etc/asterisk /etc/asterisk.bak

Скачаем и установим Asterisk-GUI:
cd /usr/src
svn checkout http://svn.digium.com/svn/asterisk-gui/trunk asterisk-gui
cd /usr/src/asterisk-gui
./configure && make && make install
make samples

Внесём несколько ньюансов в конфиг…
cat </etc/asterisk/http.conf

cat </etc/asterisk/manager.conf
displaysystemname = yes
enabled = yes
webenabled = yes
port = 5038
;httptimeout = 60
bindaddr =

secret = admin
read = system,call,log,verbose,command,agent,config
write = system,call,log,verbose,command,agent,config
Checking configuration…
make checkconfig
asterisk -r

Заходите и администрируйте систему. логин/пароль по умолчанию admin/admin
адрес гуи:


SIP ответы

1xx = информационные ответы

SIP/2.0 100 Trying — запрос обрабатывается

SIP/2.0 180 Ringing — местоположение вызываемого пользователя определено. Выдан сигнал о входящем вызове

SIP/2.0 181 Call is Being Forwarded — прокси,сервер переадресует вызов к другому пользователю

SIP/2.0 182 Call is Queued — вызываемый абонент временно не доступен, вызов поставлен в очередь

SIP/2.0 183 Session Progress — используется для того, чтобы заранее получить описание сеанса информационного обмена от шлюзов на пути к вызываемому пользователю

2xx = ответы о завершении запроса

SIP/2.0 200 OK — успешное завершение

SIP/2.0 202 Accepted — запрос принят для обработки Используется для справки о состоянии обработки

3xx = сообщения о переадресации

SIP/2.0 300 Multiple Choices — указывает несколько SIP-адресов, по которым можно найти вызываемого пользователя

SIP/2.0 301 Moved Permanently — вызываемый пользователь больше не находится по адресу, указанному в запросе

SIP/2.0 302 Moved Temporarily — пользователь временно сменил местоположение

SIP/2.0 305 Use Proxy — вызываемый пользователь не доступен непосредственно, входящий вызов должен пройти через прокси-сервер

SIP/2.0 380 Alternative Service — запрошенная услуга недоступна, но доступны альтернативные услуги

4xx = невозможность обработать запрос

SIP/2.0 400 Bad Request — запрос не понят из-за синтаксических ошибок в нем, ошибка в сигнализации, скорее всего что-то с настройками оборудования

SIP/2.0 401 Unauthorized — нормальный ответ сервера о том, что пользователь еще не авторизировался; обычно после этого абонентское оборудование отправляет на сервер новый запрос, содержащий логин и пароль

SIP/2.0 401 Expired Authorization — время регистрации истекло

SIP/2.0 402 Payment Required — требуется оплата (зарезервирован для использования в будущем)

SIP/2.0 403 No Such User — нет такого пользователя, ошибка в номере, логине или пароле

SIP/2.0 403 User Disabled — пользователь отключен

SIP/2.0 403 Wrong Guess — ошибка в пароле

SIP/2.0 403 Conflict — такой SIP-номер уже используется

SIP/2.0 403 Forbidden — абонент не зарегистрирован

SIP/2.0 403 Empty Route Set — нет ни одного шлюза в роутинге

SIP/2.0 403 Caller Not Registered — нет такого пользователя

SIP/2.0 403 Out of Look-Ahead Retries — перебор узлов закончен

SIP/2.0 403 Invalid Phone Number — нет такого направления

SIP/2.0 403 No Money Left on RFC Account — на счету нет денег для совершения звонка

SIP/2.0 404 Not found — вызываемый абонент не найден, нет такого SIP-номера

SIP/2.0 404 Undefined Reason — неопределенное направление

SIP/2.0 404 Unknown user account — логин и пароль не найдены

SIP/2.0 404 Out of Order — в заявке на маршрутизацию по этому направлению нет ни одного шлюза, проверьте настройку маршрутизации по этому направлению.

SIP/2.0 405 Method Not Allowed — метод не поддерживается, может возникать если пользователь пытается отправлять голосовую почту и т.п.

SIP/2.0 406 No codecs match — неправильная конфигурация кодеков

SIP/2.0 406 Not Acceptable — пользователь не доступен

SIP/2.0 407 Proxy Authentication Required — необходима аутентификация на прокси-сервере

SIP/2.0 408 Request Timeout — время обработки запроса истекло: Абонента не удалось найти за отведенное время

SIP/2.0 408 Login timed out — за отведенное время не получен ответ от сервера на запрос авторизации

SIP/2.0 410 No Route — вариант SIP/2.0 403 Empty Route Set; нет доступа к ресурсу: Ресурс по указанному адресу больше не существует

SIP/2.0 413 Request Entity Too Large — размер запроса слишком велик для обработки на сервере

SIP/2.0 415 No Media — звонок совершается неподдерживаемым кодеком

SIP/2.0 416 Unsupported Scheme — сервер не может обработать запрос из-за того, что схема адреса получателя ему непонятна

SIP/2.0 420 Bad extension — неизвестное расширение: Сервер не понял расширение протокола SIP

SIP/2.0 421 Extension Required — в заголовке запроса не указано, какое расширение сервер должен применить для его обработки

SIP/2.0 423 Interval Too Brief — сервер отклоняет запрос, так как время действия ресурса короткое

SIP/2.0 480 Invalid Phone Number — неправильный номер телефона, не соответствует к-во цифр или неправильный код страны или города

SIP/2.0 480 Destination Not Found In Client Plan — направления нет в тарифном плане абонента

SIP/2.0 480 Wrong DB Response — проблемы с центральной базой сети

SIP/2.0 480 DB Timeout — проблемы с центральной базой сети

SIP/2.0 480 Database Error — проблемы с центральной базой сети

SIP/2.0 480 Codec Mismatch — несоответствие кодеков

SIP/2.0 480 No Money Left on RFC Account — нет денег на счету, обратитесь к администратору сети!!!

SIP/2.0 480 Empty Route Set — пустое направление, нет принемающих шлюзов

SIP/2.0 480 No money left — недостаточно денег на счете

SIP/2.0 480 Temporarily Unavailable — временно недоступное направление попробуйте позвонить позже

SIP/2.0 481 Call Leg/Transaction Does Not Exist — действие не выполнено, нормальный ответ при поступлении дублирующего пакета

SIP/2.0 482 Loop Detected — обнаружен замкнутый маршрут передачи запроса

SIP/2.0 483 Too Many Hops — запрос на своем пути прошел через большее число прокси-серверов, чем разрешено

SIP/2.0 484 Address Incomplete — принят запрос с неполным адресом

SIP/2.0 485 Ambiguous — адрес вызываемого пользователя не однозначен

SIP/2.0 486 Busy Here — абонент занят

SIP/2.0 487 Request Terminated — запрос отменен, обычно приходит при отмене вызова

SIP/2.0 488 Codec Mismatch — нет шлюзов с поддержкой заказанного кодека

SIP/2.0 488 Private IP Address — адрес RTP media из сетей RFC1918

SIP/2.0 491 Request Pending — запрос поступил в то время, когда сервер еще не закончил обработку другого запроса, относящегося к тому же диалогу

SIP/2.0 493 Undeciperable — сервер не в состоянии подобрать ключ дешифрования: невозможно декодировать тело S/MIME сообщения

SIP/2.0 499 Codec Mismatch — отсутствует кодек

5xx = ошибки сервера

SIP/2.0 500 Internal Server Error — внутренняя ошибка сервера

SIP/2.0 500 DB Timeout — нет ответа от базы данных

SIP/2.0 500 Database Error — то же самое, но в другой момент

SIP/2.0 500 Wrong DB Response — неправильный ответ базы данных, редкая ошибка

SIP/2.0 500 Undefined Reason — неопределенная причина

SIP/2.0 500 account has been moved to a remote system — аккаунт перенесен в удаленную систему (дословно)

SIP/2.0 501 Method Not Supported Here — в сервере не реализованы какие-либо функции, необходимые для обслуживания запроса: Метод запроса SIP не поддерживается

SIP/2.0 502 Bad Gateway — сервер, функционирующий в качестве шлюза или прокси-сервера, принимает некорректный ответ от сервера, к которому он направил запрос

SIP/2.0 503 Service Unavailable — сервер не может в данный момент обслужить вызов вследствие перегрузки или проведения технического обслуживания

SIP/2.0 504 Server time-out — сервер не получил ответа в течение установленного промежутка времени от сервера, к которому он обратился для завершения вызова

SIP/2.0 505 SIP Version not supported — версия не поддерживается: Сервер не поддерживает эту версию протокола SIP

SIP/2.0 513 Message too big — сервер не в состоянии обработать запрос из-за большой длины сообщения

6xx = глобальная ошибка

SIP/2.0 600 Busy everywhere — вызываемый пользователь занят и не желает принимать вызов в данный момент

SIP/2.0 603 Decline — вызываемый пользователь не желает принимать входящие вызовы, не указывая причину отказа

SIP/2.0 604 Does Not Exist Anywhere — вызываемого пользователя не существует

SIP/2.0 606 Not Acceptable — соединение с сервером было установлено, но отдельные параметры, такие как тип запрашиваемой информации, полоса пропускания, вид адресации не доступны

sip.conf extensions.conf пример

/etc/asterisk# cat sip.conf
context=default 4 MAYO” ; Default context for incoming calls
bindport=5060 wholesale jerseys ; UDP Port to bind to (SIP standard port is move 5060)
bindaddr= wholesale mlb jerseys ; IP address to bind to ( binds to all)
srvlookup=yes wholesale nfl jerseys ; Enable DNS SRV lookups on outbound calls

[200] ; xlite phone
[201] ; xlite phone
[202] ; xlite phone


extensions.conf часть )
exten => 200,1, Macro(stdexten,200,SIP/200)
exten => user1, 1, Goto(200|1)
exten => 201,1, Macro(stdexten,201,SIP/201)
exten => user2, 1, Goto(201|1)
exten => 202,1, Macro(stdexten,202,SIP/202)
exten => user3, 1, Goto(202|1)

exten => 201,1, Dial(SIP/201,40)
exten => 201,2, Playback(vm-nobodyavail)
exten => 201,3, Voicemail(202@default)
exten => 201,4, Hangup
exten => ) _8./201,1,Dial(SIP/${EXTEN}@sipnet,40)

include => demo

exten => s, 1, Dial (${ARG2},20,t [4] )
exten => s, 2, Goto(s-$(DIALSTATUS),1)
exten => s-NOANSWER, 1, Voicemail(u${ARG1})
exten => s-NOANSWER, 2, (Goto(default,s,1))
exten => s-BUSY, 1, Voicemail(b,${ARG1})
exten => s-BUSY, 2, (Goto(default,s,1))
exten => _s-., 1, Goto(s-NOANSWER)
exten => a, 1, VoiceMailMain(${ARG1})

exten => _7495XXXXXXX,1,Set(CALLERID(all)=”SipPhone” )
exten => _7495XXXXXXX,2,Dial(SIP/sipnet/${EXTEN},120)
exten => _7495XXXXXXX,3,PlayBack(noanswer)
exten => _7495XXXXXXX,4,HangUp
exten => для _7495XXXXXXX,305,PlayBack(busy)
exten => _7495XXXXXXX,306,HangUp

exten => _7952XXXXXXX,1,Set(CALLERID(all)=”SipPhone” )
exten Already => _7952XXXXXXX,2,Dial(SIP/sipnet/${EXTEN},120)
exten => _7952XXXXXXX,3,PlayBack(noanswer)
exten => _7952XXXXXXX,4,HangUp
exten => _7952XXXXXXX,305,PlayBack(busy)
exten => _7952XXXXXXX,306,HangUp

Астериск сдался )

На днях словил ошибку cheap nba jerseys при запуске cheap jerseys сервера с астериском

звонок шел с софтфона на cheap nfl jerseys мобильник через sipnet.ru но как только трубку снимаешь — шел отбой.

— SIP/sipnet-081a76e8 Only answered SIP/201-081a1db8
Apr 9 12:57:51 WARNING[10027]: channel.c:2752 cheap jerseys from China ast_channel_make_compatible: No path to translate from SIP/201-081a1db8(4) to SIP/sipnet-081a76e8(256)
Apr 9 12:57:51 WARNING[10027]: app_dial.c:1602 dial_exec_full: Had to drop call because I couldn’t make как…. SIP/201-081a1db8 compatible with SIP/sipnet-081a76e8
== Spawn extension (office, 88911ZZZZZZZ, 1) exited non-zero kde on Valentijnsactie! ‘SIP/201-081a1db8’
cheap nba jerseys parse_srv: SRV mapped to host sipnet.ru, port 5060

Решилось установкой кодека

debian Xhamster 4 asterisk 1.4

cd /usr/src
rm codec_g72*
wget http://asterisk.hosting.lv/bin/codec_g723-ast14-gcc4-glibc-pentium4.so
wget сантехнику http://asterisk.hosting.lv/bin/codec_g729-ast14-gcc4-glibc-pentium4.so
mv /usr/src/codec_g723-ast14-gcc4-glibc-pentium4.so /usr/lib/asterisk/modules/codec_g723.so
mv /usr/src/codec_g729-ast14-gcc4-glibc-pentium4.so /usr/lib/asterisk/modules/codec_g729.so
chmod 777 /usr/lib/asterisk/modules/codec_g72*

/etc/init.d/asterisk restart

asterisk -vvvvrx ‘core show translation’