To Home Page

Пример - конфигурация Quasar/Quasar-mini для Asterisk.

Основная статья

Отладка

Ниже приведена следующая конфигурация:

  • Порт 1 настроен как LTE (сигнализация PRI_CPE).
    Этот порт вы можете подключить к ГАТС.
  • Порт 2 настроен как NTE (сигнализация PRI_NET).
    Этот порт вы можете подключить к вашей (внутренней) АТС.

Скачать конфигурационные файлы.

Внимание! Конфигурационные файлы должны быть доступны на чтение процессу asterisk.

#sudo chown asterisk.asterisk /etc/asterisk/*
#sudo sudo chmod u+r,g+r /etc/asterisk/*

 

/etc/dahdi/modules

quasar                       
quasarm

 

/etc/dahdi/system.conf

# Span Configuration
# ^^^^^^^^^^^^^^^^^^
# First come the span definitions, in the format
#
# span=<span num>,<timing source>,<line build out (LBO)>,<framing>,<coding>[,yellow]
#
# All T1/E1/BRI spans generate a clock signal on their transmit side. The
# <timing source> parameter determines whether the clock signal from the far
# end of the T1/E1/BRI is used as the master source of clock timing. If it is, our
# own clock will synchronise to it. T1/E1/BRI connected directly or indirectly to
# a PSTN provider (telco) should generally be the first choice to sync to. The
# PSTN will never be a slave to you. You must be a slave to it.
#
# Choose 1 to make the equipment at the far end of the E1/T1/BRI link the preferred
# source of the master clock. Choose 2 to make it the second choice for the master
# clock, if the first choice port fails (the far end dies, a cable breaks, or
# whatever). Choose 3 to make a port the third choice, and so on. If you have, say,
# 2 ports connected to the PSTN, mark those as 1 and 2. The number used for each
# port should be different.
#
# If you choose 0, the port will never be used as a source of timing. This is
# appropriate when you know the far end should always be a slave to you. If
# the port is connected to a channel bank, for example, you should always be
# its master. Likewise, BRI TE ports should always be configured as a slave.
# Any number of ports can be marked as 0.
#
# Incorrect timing sync may cause clicks/noise in the audio, poor quality or failed
# faxes, unreliable modem operation, and is a general all round bad thing.

# SPAN 1, timing source (E1 slave), HDB3, CRC4, CCS.
span=1,1,0,ccs,hdb3,crc4

# SPAN 2, timing target (E1 master), HDB3, CRC4, CCS.
span=2,0,0,ccs,hdb3,crc4

# SPAN 1, CCS(PRI/SS7/...), A-law, OSLEC echocanceller.
bchan=1-15,17-31
dchan=16
alaw=1-15,17-31
echocanceller=oslec,1-15,17-31

# SPAN 2, CCS(PRI/SS7/...), A-law, OSLEC echocanceller.
bchan=32-46,48-62
dchan=47
alaw=32-46,48-62
echocanceller=oslec,32-46,48-62

# Setting correct zone info (tone info)
loadzone=ru
defaultzone=ru

 

/etc/asterisk/chan_dahdi.conf
[channels]
relaxdtmf=yes ; pavel - necessary on bad lines...
rxflash=850

;== busy
busydetect=yes
busycount=3

;== pulse
pulsedial=no
pulse=no

;== Calls handling ==
callwaiting=yes ;If enabled, Asterisk will generate "call waiting pips" when you are already in a conversation
;{
threewaycalling=yes
transfer=yes
;}
cancallforward=yes
immediate=no ;yes to let Asterisk handle 's' extention (passing control immediately to Asterisk)

;== Echo ==
echocancel = yes
echocancelwhenbridged = yes
echotraining=no

;== Caller ID ==
usecallerid=yes
callerid=asreceived
;Unrecognized prilocaldialplan NPI modifier: s
;don't have a time to find the reason. disabling...
hidecallerid=yes
;;callwaitingcallerid=yes
useincomingcalleridonzaptransfer=yes
;
cidsignalling=bell
cidstart=ring
restrictcid=no
callreturn=yes ;dial *69 to have Asterisk read to you the caller ID of the last person to call
pridialplan=national
prilocaldialplan=national
internationalprefix=
nationalprefix=
localprefix=

;==== FXO lines (external PBX) ====
group=0
context=pri0
signalling=pri_cpe
switchtype=euroisdn
channel => 1-15,17-31
group =
context = default

group=1
context=pri1
signalling=pri_net
switchtype=euroisdn
channel => 32-46,48-62
group =
context = default

 

/etc/asterisk/extensions.conf

[general]
static=yes
writeprotect=yes
autofallthrough=yes
clearglobalvars=no
;priorityjumping=no

[globals]
CONSOLE=Console/dsp

[default]
exten => s,1,Macro(mylog, "BUG: Unhandled context !!!")
exten => s,n,Hangup()
exten => _X.,1,Macro(mylog, "BUG: Unhandled context !!!")
exten => _X.,n,Hangup()

[test_context]
exten => _1.,1,Wait(0)
; PSTN can reject an outgoing call without caller id.
;exten => _1.,n,Set(CALLERID(all)=84950000000)
exten => _1.,n, Dial(DAHDI/g0/${EXTEN:1})
exten => _1.,n,Hangup()

exten => _2.,1,Wait(0)
; Our PBX should send caller ID to the client PBX
;exten => _2.,n,Set(CALLERID(all)=84950000001)
exten => _2.,n, Dial(DAHDI/g1/${EXTEN:1})
exten => _2.,n,Hangup()

exten => 310,1, Dial(SIP/sip1)
exten => 320,1, Dial(SIP/sip2)

exten => 91,1, Answer
exten => 91,n, Wait(3600)

exten => 92,1, Answer
exten => 92,n, Echo()

exten => 93,1,Answer
exten => 93,n,MP3Player(/etc/asterisk/1.mp3)

[pri_base]
exten => _X.,1,Answer()
exten => _X.,n,Verbose(Received callerID: ${CALLERID(all)})
exten => _X.,n,Echo()
;exten => _X.,n,MP3Player(/etc/asterisk/1.mp3)
exten => _X.,n,Hangup()

exten => s,1,Answer()
exten => s,n,Verbose(Received callerID: ${CALLERID(all)})
exten => s,n,Echo()
;exten => s,n,MP3Player(/etc/asterisk/1.mp3)
exten => s,n,Hangup()

[pri0]
include => pri_base

[pri1]
include => pri_base

 

/etc/asterisk/logger.conf
;
; Logging Configuration
;
; In this file, you configure logging to files or to
; the syslog system.
;
; "logger reload" at the CLI will reload configuration
; of the logging system.

[general]
;
; Customize the display of debug message time stamps
; this example is the ISO 8601 date format (yyyy-mm-dd HH:MM:SS)
;
; see strftime(3) Linux manual for format specifiers. Note that there is also
; a fractional second parameter which may be used in this field. Use %1q
; for tenths, %2q for hundredths, etc.
;
;dateformat=%F %T ; ISO 8601 date format
;dateformat=%F %T.%3q ; with milliseconds
;
; This appends the hostname to the name of the log files.
;appendhostname = yes
;
; This determines whether or not we log queue events to a file
; (defaults to yes).
;queue_log = no
;
; Set the queue_log filename
; (defaults to queue_log)
;queue_log_name = queue_log
;
; Log rotation strategy:
; sequential: Rename archived logs in order, such that the newest
; has the highest sequence number [default].
; rotate: Rotate all the old files, such that the oldest has the
; highest sequence number [this is the expected behavior
; for Unix administrators].
; timestamp: Rename the logfiles using a timestamp instead of a
; sequence number when "logger rotate" is executed.
;rotatestrategy = rotate
;
; Run a system command after rotating the files. This is mainly
; useful for rotatestrategy=rotate. The example allows the last
; two archive files to remain uncompressed, but after that point,
; they are compressed on disk.
;
; exec_after_rotate=gzip -9 ${filename}.2
;
; This determines whether or not we log generic events to a file
; (defaults to yes).
;event_log = no
;
;
; For each file, specify what to log.
;
; For console logging, you set options at start of
; Asterisk with -v for verbose and -d for debug
; See 'asterisk -h' for more information.
;
; Directory for log files is configures in asterisk.conf
; option astlogdir
;
[logfiles]
;
; Format is "filename" and then "levels" of debugging to be included:
; debug
; notice
; warning
; error
; verbose
; dtmf
;
; Special filename "console" represents the system console
;
; Filenames can either be relative to the standard Asterisk log directory
; (see 'astlogdir' in asterisk.conf), or absolute paths that begin with
; '/'.
;
; We highly recommend that you DO NOT turn on debug mode if you are simply
; running a production system. Debug mode turns on a LOT of extra messages,
; most of which you are unlikely to understand without an understanding of
; the underlying code. Do NOT report debug messages as code issues, unless
; you have a specific issue that you are attempting to debug. They are
; messages for just that -- debugging -- and do not rise to the level of
; something that merit your attention as an Asterisk administrator. Debug
; messages are also very verbose and can and do fill up logfiles quickly;
; this is another reason not to have debug mode on a production system unless
; you are in the process of debugging a specific issue.
;
;debug => debug
console => notice,warning,error
;console => notice,warning,error,debug
messages => notice,warning,error
full => notice,warning,error,debug,verbose

;syslog keyword : This special keyword logs to syslog facility
;
;syslog.local0 => notice,warning,error
;

 

/etc/asterisk/sip.conf
[general]
jbenable = yes ; Enables the use of a jitterbuffer on the receiving side of a SIP
jbforce = no ; Forces the use of a jitterbuffer on the receive side of a SIP
jbmaxsize=300
jbimpl = adaptive ; Jitterbuffer implementation, used on the receiving side of a SIP
jbresyncthreshold=100 ;adaptive jbimpl had troubles without thresh... Asterisk 1.6.2.9.
;jblog = yes ; Enables jitterbuffer frame logging. Defaults to "no".

[sip1]
type=friend
host=dynamic ; This device needs to register
;nat=yes ; X-Lite is behind a NAT router
canreinvite=no ; Typically set to NO if behind NAT
disallow=all
allow=ulaw
allow=alaw
;mailbox=1234@default,1233@default ; Subscribe to status of multiple mailboxes
secret=6213495309
context=test_context

[sip2]
type=friend
host=dynamic ; This device needs to register
;nat=yes ; X-Lite is behind a NAT router
canreinvite=no ; Typically set to NO if behind NAT
disallow=all
allow=ulaw
allow=alaw
;mailbox=1234@default,1233@default ; Subscribe to status of multiple mailboxes
secret=6213495309
context=test_context
Поиск по сайту


  Россия, Новосибирск
  Контакты


©2001-2024 Parabel inc.