เริ่มต้นคอนฟิก Elastix อย่างเป็นขั้นตอน ตอนที่ 3

Elastix IP Pbx

Moderator: jubjang

เริ่มต้นคอนฟิก Elastix อย่างเป็นขั้นตอน ตอนที่ 3

โพสต์โดย voip4share » 21 ม.ค. 2010 11:19

ตอนที่ 3 แล้วนะครับ

1 ไฟล์คอนฟิกของ Elastix (FreePBX) และ Asterisk
ก่อนที่เราจะเริ่มคอนฟิก Elastix ด้วยเว็บอินเตอร์เฟส ผมอยากจะให้ดูไฟล์คอนฟิกของทั้ง Elastix และ Asterisk ก่อนนะครับ อย่างน้อยจะได้รู้ว่าไฟล์เหล่านี้มีไว้ทำอะไรและถูกเก็บไว้ที่ไดเร็คตอรี่ไหน ไฟล์เหล่านี้บางไฟล์เราก็แก้ไขได้ สร้างใหม่ได้ แต่บางไฟล์ดูได้อย่างเดียวแก้ไขไม่ได้เพราะว่าโปรแกรม Elastix จะเป็นตัวจัดการไฟล์เหล่านี้ ประมาณว่าถ้าอยากแก้ไขข้อมูลในไฟล์ที่ห้ามแก้ไขแล้วหล่ะก็ ต้องแก้ไขในเว็บอินเตอร์เฟสของ [url=url=http://www.voip4share.com/elastix-unified-communications-software-f28/]Elastix[/url] นะครับ

บางท่านอาจจะยังงงๆว่าเดี๋ยวผมก็พูดถึง Elastix เดี๋ยวก็ Asterisk เดี๋ยวก็ FreePBX แล้วทั้ง 3 คำนี้มันเกี่ยวข้องกันยังไง ผมขออนุญาตอธิบายไว้ ณ ที่นี้เลยนะครับว่าทั้ง 3 คำมันต่างกันยังไง
Asterisk เป็นชื่อโปรแกรม VoIP Server หรือจะเรียกว่า IP PBX ก็ได้นะครับ ผมมีกระทู้ที่เป็นหัวข้อของ Asterisk โดยเฉพาะด้วยนะครับ เป็นโปรแกรมแบบ Open Source ที่เราสามารถดาวน์โหลดไปติดตั้งหรือแก้ไขซอร์สโค๊ดได้โดยไม่ต้องจ่ายเงินให้ใครหรือกลัวใครมาจับ โปรแกรมนี้ดังมาก เป็น VoIP Server ที่ดังที่สุดในโลกนี้เลยก็ว่าได้ ขนาดที่มีคนนำมันมาทำมาหากินกันจนร่ำรวยมหาศาลกันไปแล้วมากมาย มันทำงานได้ทุกอย่างที่ตู้สาขาโทรศัพท์ (PBX) และมีอีกหลายอย่างที่ตู้สาขาโทรศัพท์ทำไม่ได้ เวลาเราจะใช้งานหรือต้องการให้มันทำอะไร เราต้องคอนฟิกบอกมันครับ ซึ่งการคอนฟิกก็ไม่ได้ยากเท่าไหร่ แต่อาจจะเวียนหัวบ้างสำหรับมือใหม่
FreePBX เป็นโปรแกรมทำงานผ่านเว็บอินเตอร์เฟส เอาไว้คอนฟิก Asterisk โดยเฉพาะ เราไม่ต้องเขียนคำสั่งสั่งงาน Asterisk เองเลยนะครับ โปรแกรมนี้ทำแทนเราเกือบทั้งหมด ที่เหลือเราก็แค่คลิ๊ก ป้อนข้อมูล แล้วก็คลิ๊ก ง่ายซะไม่มี
Elastix เป็นโปรแกรมที่ทำงานผ่านเว็บอินเตอร์เฟสอีกเช่นเดียวกัน โดยจะเอาโปรแกรมหลายๆโปรแกรมซึ่งก็มี Asterisk, FreePBX รวมอยู่ด้วยมารวมๆกัน ให้เราใช้งานได้คล่องขึ้น และสร้างเมนูใหม่ขึ้นมาเพื่อให้ดูเหมือนว่าเขามีทุกอย่างครบ เป็นโปรแกรมของเขาเอง (แต่ที่จริงเอาของคนอื่นมาแทบทั้งหมด) แล้วทำออกมาในรูปแผ่นซีดีให้ดาวน์โหลดไปติดตั้ง เรียกได้ว่าติดตั้ง Elastix ตัวเดียวได้ครบทุกอย่างที่จะให้บริการ VoIP ได้

เวลาที่เราแก้ไขข้อมูลอะไรก็ตามใน Elastix (FreePBX) นะครับ เมื่อเราคลิ๊ก "Submit Change" โปรแกรม Elastix (FreePBX) จะเก็บข้อมูลที่เราคอนฟิกไว้ในดาต้าเบสชื่อ "asterisk" ของ MySQL จากนั้นเมื่อเรากด "Apply Configuration Changes Here" มันจะไรท์ข้อมูลลงไปไว้ในไฟล์คอนฟิกของ Asterisk ซึ่งมีอยู่หลายไฟล์ (แยกกันตามหน้าที่) ในไดเร็คตอรี่ /etc/asterisk จากนั้นจะรีโหลด Asterisk (รีโหลดนะครับไม่ใช่รีสตาร์ท ขณะรีโหลดจะไม่เป็นการขัดจังหวะการทำงานของ Asterisk) แล้ว Asterisk จะอ่านไฟล์คอนฟิกใหม่ไปใช้งาน

ไฟล์ที่แก้ไขได้แสดงว่าเราต้องแก้ไขเอง โดยอาจจะใช้โปรแกรม Text Editor เช่น VI ก็ได้ หรือแก้ไขจากเมนู File Editor ในเว็บอินเตอร์เฟสของ Elastix ก็ได้

1.1 ไฟล์คอนฟิกของ Elastix (FreePBX)
เป็นไฟล์คอนฟิกของ Elastix (FreePBX) นะครับไม่เกี่ยวข้องอะไรกับ Asterisk ไฟล์คอนฟิกหลักของ Elastix คือไฟล์ /etc/amportal.conf ไฟล์นี้เราแก้ไขได้ มาดูข้อมูลในไฟล์นี้กันครับ

Note! ผมเอาไฟล์นี้มาให้ดูเฉยๆนะครับ เพราะปกติเราไม่ได้แก้ไขไฟล์นี้อยู่แล้ว ยกเว้นเปลี่ยนพาสเวอร์ดที่ควรจะเปลี่ยนเท่านั้น เดี๋ยวผมจะมีบอกไว้ตอนท้ายๆของไฟล์นี้ครับ

# AMPDBHOST: the host to connect to the database named 'asterisk'
AMPDBHOST=localhost

# AMPDBUSER: the user to connect to the database named 'asterisk'
# AMPDBUSER=asteriskuser
AMPDBUSER=asteriskuser

# AMPDBENGINE: ดาต้าเบสที่ใช้งาน
AMPDBENGINE=mysql

# AMPDBPASS: พาสเวอร์ดของ AMPDBUSER
# พาสเวอร์ดนี้ไม่ใช่พาสเวอร์ดของ root (ของ MySQL) นะครับ พาสเวอร์ดของ root คือ eLaStIx.2oo7
AMPDBPASS=eLaStIx.asteriskuser.2oo7

# AMPENGINE: the telephony backend engine to use
AMPENGINE=asterisk

# AMPMGRUSER: ยูสเซอร์ที่จะใช้ล๊อกอินเข้า AMI (Astreisk Management Interface) เพื่อสั่งงาน Asterisk เช่น reload แต่ในไฟล์ /etc/asterisk/manager.conf ของ Asterisk ต้องมีข้อมูลยูสเซอร์นี้อยู่ด้วยนะครับ
AMPMGRUSER=admin

# AMPMGRPASS: พาสเวอร์ดของ AMPMGRUSER
AMPMGRPASS=elastix456

# AMPBIN: ไดเร็ตตอรี่เก็บ AGI Script (AGI ย่อมาจาก Asterisk Gateway Interface เป็นสคริปต์ที่เราเขียนขึ้นมาเพื่อสั่งงาน Asterisk)
AMPBIN=/var/lib/asterisk/bin

#AMPSBIN: where (root) command line scripts live
AMPSBIN=/usr/sbin

# AMPWEBROOT: เป็น Root Directory ของเว็บเซอร์เวอร์ (ไม่ต้องมี / ต่อท้าย)
AMPWEBROOT=/var/www/html

# AMPCGIBIN: the path to Apache's cgi-bin dir (leave off trailing slash)
AMPCGIBIN=/var/www/cgi-bin

# AMPWEBADDRESS: ใส่ไอพีแอดเดรสหรือโฮสต์เนมของเครื่องคอมพิวเตอร์ที่จะยอมให้เข้ามาใช้เว็บอินเตอร์เฟสได้ เว้นว่างไว้ครับไม่อย่างนั้นก็ต้องใช้งานได้จากเครื่องที่มีไอพีที่ระบุ
# ไว้เท่านั้น
#AMPWEBADDRESS=192.168.1.101
AMPWEBADDRESS=

# FOPWEBROOT: เป็นไดเร็คตอรี่ที่เก็บ FOP (Flash Operator Panel) ซึ่งใช้ดูสถานะของเบอร์ Extension, Trunk Queue, Conference ของ Asterisk ทางหน้าเว็บ
FOPWEBROOT=/var/www/html/panel

# FOPPASSWORD: บนเว็บของ FOP เราสามารถลากเม๊าส์ระหว่าง Extension, Trunk, Queue, Conference เพื่อโอนสายหรือบังคับให้วางสาย และนี้คือพาสเวอร์ดที่ต้องใส่
FOPPASSWORD=eLaStIx.2oo7

# FOPSORT: FOP should sort extensions by Last Name [lastname] or by Extension [extension]
FOPSORT=extension

# FOPRUN: set to true if you want FOP started by freepbx_engine (amportal_start), false otherwise
# FOPRUN=true

# AUTHTYPE: authentication type to use for web admin
# If type set to 'database', the primary AMP admin credentials will be the AMPDBUSER/AMPDBPASS above
# valid: none, database
AUTHTYPE=database

# AMPADMINLOGO: Defines the logo that is to be displayed at the TOP RIGHT of the admin screen.
# This enables you to customize the look of the administration screen.
# NOTE: images need to be saved in the ..../admin/images directory of your AMP install
# This image should be 55px in height
AMPADMINLOGO=logo.png

# USECATEGORIES: Controls if the menu items in the admin interface are sorted by category (true),
# or sorted alphebetically with no categories shown (false). Defaults to true.
#USECATEGORIES=false

# AMPEXTENSIONS: the type of view for extensions admin
# If set to 'deviceanduser' Devices and Users will be administered seperately, and Users will be able to "login" to devices.
# If set to 'extensions' Devices and Users will me administered in a single screen.
AMPEXTENSIONS=extensions

# ENABLECW: Enable call waiting by default when an extension is created (DEFAULT is yes)
# Set to 'no' to if you don't want phones to be commissioned with call waiting already
# enabled. The user would then be required to dial the CW feature code (*70 default) to
# enable their phone. Most installations should leave this alone. It allows multi-line
# phones to receive multiple calls on their line appearances.
# ENABLECW=yes
ENABLECW=no

# CWINUSEBUSY: Set to yes for extensions that have CW enabled to report as busy if
# they don't answer (resulting in busy voicemail greeting). Otherwise they simply
# report as no-answer (e.g. busy greeting servers no purpose
# CWINUSEBUSY=yes

# AMPBADNUMBER: Set to false if you do not want the bad-number context generated which
# traps any bogus number or freature code and plays a message to the effect. If you use
# the Early Dial feature on some Grandstream phones, you will want to set this to false
# AMPBADNUMBER=true

# The following are used to optionally have the freepbx backup program optionally
# send the generated backup to an ftp server
#
# FTPBACKUP=YES to enable
# FTPUSER, FTPPASSWORD, FTPSERVER must be set
# FTPSUBDIR is an optional subdirectory at the ftp server, it will cause ftp to do a cd
#
# There is no error checking so you should check to make sure these are set correctly. The
# ftp is saved after the backup, so it will not cause the local backup file to be effected
#
# FTPBACKUP=yes
#FTPUSER=asterisk
#FTPPASSWORD=password
#FTPSUBDIR=mybackupfolder
#FTPSERVER=myftpserver

# SSH BACKUP INFO: must have a valid SSHRSAKEY file and server, only supported through
# ssh. SUBDIR is optional and will be created if it does not exist.
#
# If SSHUSER is not set, it will default to the current user which is asterisk in any
# standard configuration.
#
#SSHBACKUP=yes
#SSHUSER=backups
#SSHRSAKEY=/etc/asterisk/backup_rsa
#SSHSUBDIR=mysubdir
#SSHSERVER=mybackupserver.com

# AMPPROVROOT=/var/ftp /tftpboot
# One or more directories where there are provisioning files that should be included in the backup. Currently
# these get backed up only, the FreePBX utility does not automatically restore them.
#
#AMPPROVROOT=/var/ftp /tftpboot
# AMPPROVEXCLUDE=/var/ftp/exclude-from-file-list
# a list of files to exclude, to be used in tar's --exclude-from argument
#
#AMPPROVEXCLUDE=/var/ftp/exclude-from-file-list

# If CUSTOMASERROR is set to false, then the Destination Registry will not report unknow destinations as errors
# this should be left to the default true and custom destinations should be moved into the new custom apps registry
# CUSTOMASERROR=false

# if DYNAMICHINTS is set to true, Core will not statically generate hints. Instead it will make a call to the
# AMPBIN php script, generate_hints.php, through an Asteirsk's #exec call. This requires Asterisk.conf to be
# configured with "execincludes=yes" set in the [options] section.
# DYNAMICHINTS=true

# XTNCONFLICTABORT, BADDESTABORT
# setting either of these to true will result in retrieve_conf aborting during a reload if an extension
# conflict is detected or a destination is detected. It is usually better to allow the reload to go
# through and then correct the problem but these can be set if a more strict behavior is desired
# both default to false if not set
XTNCONFLICTABORT=false
BADDESTABORT=false

# SERVERINTITLE if set to true, the browser title will be preceded with the server name. default false
SERVERINTITLE=false

# USEDEVSTATE = true|false # DEFAULT VALUE false
# If this is set, it assumes that you are running Asterisk 1.4 or higher and want to take advantage of the
# func_devstate.c backport available from Asterisk 1.6 which allows custom hints to be created to support
# BLF for server side feature codes such as daynight, followme, etc.
#
USEDEVSTATE=true

# MODULEADMINWGET=true|false # DEFAULT VALUE false
# Module Admin normally tries to get its online information through direct file open type calls to URLs that
# go back to the freepbx.org server. If it fails, typically because of content filters in firewalls that don't
# like the way PHP formats the requests, the code will fall back and try a wget to pull the information.
# This will often solve the problem. However, in such environemnts there can be a significant timeout before
# the failed file open calls to the URLs return and there are often 2-3 of these that occur. Setting this value
# will force FreePBX to avoid the attempt to open the URL and go straight to the wget calls.
#
MODULEADMINWGET=false

# AMPDISABLELOG=true|false # DEFAULT VALUE true
# Whether or not to invoke the freepbx log facility

# AMPSYSLOGLEVEL=LOG_EMERG|LOG_ALERT|LOG_CRIT|LOG_ERR|LOG_WARNING|LOG_NOTICE|LOG_INFO|LOG_DEBUG|LOG_SQL|SQL # DEFAULT VALUE LOG_ERR
# Where to log if enabled, SQL, LOG_SQL logs to old MySQL table, others are passed to syslog system to determine where to log

# AMPENABLEDEVELDEBUG=true|false # DEFAULT VALUE false
# Whether or not to include log messages marked as 'devel-debug' in the log system

# AMPMPG123=true|false # DEFAULT VALUE true
# When set to false, the old MoH behavior is adopted where MP3 files can be loaded and WAV files converted to MP3
# The new default behavior assumes you have mpg123 loaded as well as sox and will convert MP3 files to WAV. This is
# highly recommended as MP3 files heavily tax the system and can cause instability on a busy phone system.

# CDR DB Settings: Only used if you dont use the default values provided by freepbx.
# CDRDBHOST: hostname of db server if not the same as AMPDBHOST
# CDRDBPORT: Port number for db host
# CDRDBUSER: username to connect to db with if its not the same as AMPDBUSER
# CDRDBPASS: password for connecting to db if its not the same as AMPDBPASS
# CDRDBNAME: name of database used for cdr records
# CDRDBTYPE: mysql or postgres mysql is default
# CDRDBTABLENAME: Name of the table in the db where the cdr is stored cdr is default

# AMPVMUMASK: defaults to 077 allowing only the asterisk user to have any permissions on VM files. If set to something
# like 007, it would allow the group to have permissions. This can be used if setting apache to a different
# user then asterisk, so that the apache user (and thus ARI) can have access to read/write/delete the
# voicemail files. If changed, some of the voicemail directory strucuters may have to be manually changed.

# DASHBOARD_STATS_UPDATE_TIME=integer_seconds
# DEFAULT VALUE: 6
# DASHBOARD_INFO_UPDATE_TIME=integer_seconds
# DEFAULT VALUE: 20
# These can be used to change the refresh rate of the System Status Panel. Most of
# the stats are updated based on the STATS interval but a few items are checked
# less frequently (such as Astersisk Uptime) based on the INFO value

# FOPDISABLE=true|false # DEFAULT VALUE false
# Disables FOP in interface and retrieve_conf. Usefull for sqlite3 or if you don't want FOP.

# ZAP2DAHDICOMPAT=true|false
ZAP2DAHDICOMPAT=true
# DEFAULT VALUE: false
# If set to true, FreePBX will check if you have chan_dadhi installed. If so, it will
# automatically use all your ZAP configuration settings (devices and trunks) and
# silently convert them, under the covers, to DAHDI so no changes are needed. The
# GUI will continue to refer to these as ZAP but it will use the proper DAHDI channels.
# This will also keep Zap Channel DIDs working.

# CHECKREFERER=true|false
# DEFAULT VALUE: true
# When set to the default value of true, all requests into FreePBX that might possibly add/edit/delete settings will
# be validated to assure the request is coming from the server. This will protect the system from CSRF (cross site
# request forgery) attacks. It will have the effect of preventing legitimately entering URLs that could modify
# settings which can be allowed by changing this field to false
#

# AMPMODULEXML lets you change the module repository that you use. By default, it
# should be set to http://mirror.freepbx.org/ - Presently, there are no third
# party module repositories.
AMPMODULEXML=http://mirror.freepbx.org/

# AMPMODULESVN is the prefix that is appended to <location> tags in the XML file.
# This should be set to http://mirror.freepbx.org/modules/
AMPMODULESVN=http://mirror.freepbx.org/modules/

AMPDBNAME=asterisk

# ไดเร็คตอรี่ของ Asterisk ที่ Elastix (FreePBX) จะเข้ามาไรท์ไฟล์หรือดูข้อมูล
ASTETCDIR=/etc/asterisk
ASTMODDIR=/usr/lib/asterisk/modules
ASTVARLIBDIR=/var/lib/asterisk
ASTAGIDIR=/var/lib/asterisk/agi-bin
ASTSPOOLDIR=/var/spool/asterisk
ASTRUNDIR=/var/run/asterisk
ASTLOGDIR=/var/log/asterisk

1.2 ไฟล์คอนฟิกของ Asterisk
ไฟล์คอนฟิกของ Asterisk เก็บไว้ในไดเร็คตอรี่ /etc/asterisk ครับ ภายในมีไฟล์ต่างๆมากมายทั้งไฟล์ที่มีมากับ Asterisk และไฟล์ที่ Elastix (FreePBX) สร้างขึ้นเพื่อที่จะไรท์ข้อมูลลงไป ไฟล์ที่มากับ Asterisk ก็ถูกดัดแปลงจนข้อมูลในไฟล์เปลี่ยนไปมากเมื่อเทียบกับไฟล์ต้นแบบ ไฟล์ที่มีชื่อลงท้ายด้วย _additional หรือ _custom นั้นสร้างโดย FreePBX นะครับ โดยที่ _additional นั้นห้ามแก้ไข ส่วน _custom แก้ไขได้

แรกๆอาจจะยังงงๆกับไฟล์พวกนี้ครับ แต่ผมเชื่อว่าถ้าเราได้ทำคอนฟิกที่เกี่ยวข้องกับแต่ละเรื่อง เราจะเข้าใจมันมากขึ้น

extensions.conf
เป็นไฟล์ Dial Plan ของ Asterisk ไฟล์นี้จะคอนโทรลว่าเราจะกดโทรไปเบอร์ไหนได้บ้าง เบอร์ที่ไม่มีอยู่ในไฟล์นี้จะโทรไม่ได้นะครับ ไฟล์นี้เราแก้ไขได้ครับ แต่ไม่ควรทำอะไรมากนัก ที่ผมเคยทำกับไฟล์นี้คือใส่ชื่อไฟล์ Dial Plan ใหม่ที่ผมสร้างขึ้นมาใช้งานเฉพาะ เพื่อให้ Asterisk รู้จักไฟล์นี้และมันก็จะได้เข้ามาดูได้ว่าเบอร์ที่ผมโทรไปอยู่ในไฟล์นี้หรือเปล่า

extension_additional.conf
เป็นไฟล์ที่ FreePBX สร้างขึ้นมาเพื่อเสริมการทำงานของไฟล์ extensions.conf ไฟล์นี้ห้ามแก้ไขนะครับ เพราะว่า FreePBX จะเป็นตัวที่แก้ไขข้อมูลไฟล์นี้โดยเอาข้อมูลจากดาต้าเบสไรท์ลงไป ข้อมูลที่เราแก้ไขก็จะหายแว๊บไป

extension_custom.conf
เป็นไฟล์ที่ FreePBX สร้างขึ้นมาเช่นกัน แต่เราแก้ไขข้อมูลในไฟล์นี้ได้ เช่นเมื่อต้องการสร้าง Dial Plan เพิ่มเติม

sip.conf
เป็นไฟล์หลักของโปรโตคอล SIP ไฟล์ต้นฉบับมีข้อมูลอยู่เยอะแยะเลยนะครับ แต่ Elastix ก็จัดการย้ายไปไว้ที่ไฟล์อื่น ก็เลยมีข้อมูลอยู่แค่นิดหน่อย เราแก้ไขได้นิดหน่อย

sip_general_additional.conf
ไฟล์นี้สำหรับเก็บเบอร์ Extension, SIP Trunk ไฟล์นี้ห้ามแก้ไขนะครับ เพราะ Elastix จะไรท์ข้อมูลเบอร์ Extension และ SIP จากดาต้าเบสลงไฟล์นี้

sip_general_custom.conf
ไฟล์นี้แก้ไขได้ เอาไว้ใส่พารามิเตอร์ในส่วนของ [general] ของไฟล์ sip.conf เช่น พารามิเตอร์เกี่ยวกับ Codec
disallow=all
allow=g729
allow=g723
allow=ulaw
allow=alaw

sip_custom.conf
ไฟล์นี้แก้ไขได้ ไว้ใส่พารามิเตอร์ในไฟล์ sip.conf ที่อยู่หลัง [general]

sip_custom_post.conf ไฟล์นี้แก้ไขได้ ไฟล์นี้มีไว้เพิ่มพารามิเตอร์ให้เบอร์ Extension ที่ไม่มีให้ใส่ค่าบนหน้าเว็บ เช่นเราต้องการเพิ่มพารามิเตอร์ call-limit ให้แก่เบอร์ Extension 100 แต่พารามิเตอร์นี้ไม่มีให้คอนฟิกบนหน้าเว็บ เราก็เอามาใส่ไว้ในไฟล์นี้ ตัวอย่าง
[100](+)
call-limit=1
แล้วรีโหลด sip

sip_nat.conf
ใส่พารามิเตอร์เกี่ยวกับ Nat โดยเฉพาะเมื่อติดตั้ง Elastix ไว้หลัง NAT Device เช่น ADSL Router ตัวอย่างพารามิเตอร์คือ
nat=yes
localhost=192.168.4.51
externip=voipbkk-dindang.voip4share.com
fromdomain=voipbkk-dindang.voip4share.com

sip_notify.conf
เอาไว้ใส่พารามิเตอร์เพิ่มเติมที่ต้องการให้ส่งไปพร้อมกับ SIP Notify

sip_registrations.conf
ไฟล์นี้ห้ามแก้ไข เพราะ Elastix จะไร้ท์ไฟล์นี้จากดาต้าเบสเมื่อเราคอนฟิกให้ Asterisk ไปรีจิสเตอร์กับ SIP Server อื่น

sip_registrations_custom.conf
ไฟล์นี้แก้ไขได้ ให้เราใส่พารามิเตอร์ที่กี่ยวกับการรีจิสเตอร์ของ Asterisk

iax.conf เหมือนกับ sip.conf แต่เป็นของโปรโตคอล iax2
iax_custom.conf เหมือนกับ sip_custom.conf แต่เป็นของโปรโตคอล iax2
iax_custom_post.conf เหมือนกับ sip_custom_post.conf แต่เป็นของโปรโตคอล iax2
iax_general_additional.conf เหมือนกับ sip_general_additional.conf แต่เป็นของโปรโตคอล iax2
iax_general_custom.conf เหมือนกับ sip_general_custom.conf แต่เป็นของโปรโตคอล iax2
iax_registrations.conf เหมือนกับ sip_registrations.conf แต่เป็นของโปรโตคอล iax2
iax_registrations_custom.conf เหมือนกับ sip_registration_custom.conf แต่เป็นของโปรโตคอล iax2

manager.conf
ไว้คอนฟิก Username/Password ที่ Asterisk จะยอมรับคำสั่งที่ส่งมาเพื่อสั่งให้มันทำงาน เช่นขอดูสถานะ สั่งให้โทรออก สั่งให้วางสาย เป็นต้น เวลา Elastix จะสั่งงาน Asterisk มันต้องส่งคำสั่งไปและ Astrisk จะถาม Username/Password เราเรียกฟีเจอร์ที่สั่งงานแบบนี้ว่า Asterisk Managment Interface หรือ AMI

manager_custom.conf
ไฟล์นี้เอาไว้ใส่ Username/Password ของ AMI ที่เราตั้งขึ้นมาเอง

meetme.conf
เอาไว้คอนฟิกพารามิเตอร์หลักของห้องประชุม

meetme_additional.conf
ไฟล์นี้แก้ไขไม่ได้นะคับ ซึ่ง Elastix จะไรท์คอนฟิกของห้องประชุมที่เราเซ็ตทางหน้าเว็บ

voicemail.conf
ไฟล์นี้เอาไว้คอนฟิกพารามิเตอร์ของวอยส์เมล์ และรายละเอียดวอยส์เมล์ของแต่ละยูสเซอร์ด้วย เราแก้ไขไฟล์นี้ได้

musiconhold.conf
ไฟล์คอนฟิกพารามิเตอร์ของเสียงเพลงรอสาย

musiconhold_additional.conf
ไฟล์นี้แก้ไขไม่ได้ ซึ่ง Elastix จะไรท์คอนฟิกของเสียงรอสายที่เราเซ็ตทางหน้าเว็บ

musiconhold_custom.conf
ไฟล์นี้แก้ไขคอนฟิกเสียงรอสายได้

chan_dahdi.conf
ไฟล์สำหรับเซ็ตคอนฟิกของการ์ดอินเตอร์เฟส FXS/FXO/E1/GSM ที่มีติดตั้งในเครื่อง เราเรียกการ์ดพวกนี้รวมๆว่า DAHDI Hardware

chan_dahdi_additional.conf
ไฟล์นี้แก้ไขไม่ได้นะครับ ซึ่ง Elastix จะไรท์คอนฟิกที่เกี่ยวกับ DAHDI ทุกอย่างที่เราคอนฟิกทางหน้าเว็บ

2 ล๊อกอินเข้าเว็บอินเตอร์เฟสของ Elastix
ใช้พาสเวอร์ดใหม่ที่เพิ่งแก้ไขไปนะครับ
04-login-with-new-password.png
Login To Elastix
04-login-with-new-password.png (8.61 KiB) เปิดดู 17118 ครั้ง


3 การแก้ไขคอนฟิกของ Asterisk
จากหัวข้อที่แล้วที่ผมได้แนะนำไฟล์คอนฟิกของ Asterisk ก็คงทราบเรียบร้อยแล้วนะครับว่ามีไฟล์อยู่ 2 แบบคือ แบบที่แก้ไขได้ และแบบที่แก้ไขไม่ได้ หัวข้อนี้ผมจะแนะนำวิธีเข้าไปแก้ไขไฟล์ที่แก้ไขได้ ซึ่งมีอยู่ 2 วิธีแล้วแต่ความถนัดของแต่ละบุคคลครับ

3.1 ใช้เมนู File Editor ของ Elastix
ล๊อกอินเข้าเว็บอินเตอร์เฟสของ Elastix แล้วคลิ๊กตามนี้ครับ PBX -> Tools -> File Editor
บนหน้าจอจะแสดงรายชื่อไฟล์ที่อยู่ในไดเร็คตอรี่ /etc/asterisk แสดงหน้าละ 25 ไฟล์ อยากดูหรือแก้ไขไฟล์ไหนก็คลิ๊กที่ชื่อไฟล์ได้เลยครับ ถ้าหาไม่เจอก็คลิ๊ก "Next" หรือไม่ก็พิมพ์ชื่อไฟล์ในช่อง "File" แล้วกด Filter การพิมพ์ชื่อไฟล์ถ้าจำชื่อได้ก็พิมพ์ชื่อเต็มๆ แต่ถ้าจำได้แค่ตัวอักษรด้านหน้าก็พิมพ์สัก 1-2 ตัวก็ได้นะครับ แล้วกด "Filter" มันก็จะแสดงรายชื่อไฟล์ที่ขึ้นต้นด้วยตัวอักษรนั้นหรือในชื่อไฟล์มีตัวอักษรนั้นๆอยู่ด้วย
05-menu-file-editor.png
Elastix File Editor
05-menu-file-editor.png (77.31 KiB) เปิดดู 17118 ครั้ง

ค้นหาไฟล์ ใส่ชื่อไฟล์หรือส่วนใดส่วนหนึ่งของชื่อไฟล์ในช่อง "File" แล้วคลิ๊ก "Filter"
06-file-editor-search.png
Elastix File Search
06-file-editor-search.png (51.94 KiB) เปิดดู 17118 ครั้ง

การแก้ไขไฟล์ คลิ๊กที่ชื่อไฟล์ เมื่อแก้ไขเสร็จแล้ว คลิ๊กที่ "Save" เพื่อบันทึกไฟล์
07-file-editor-edit.png
Elastix File Editing
07-file-editor-edit.png (104.72 KiB) เปิดดู 17118 ครั้ง

เมื่อแก้ไขเสร็จแล้วอย่าลืมรีโหลด Asterisk ด้วยนะครับ การรีโหลดนั้นนะครับใช้คำสั่ง reload จาก Asterisk Console

3.2 ใช้โปรแกรม Text Editor
ที่กระทู้นี้ผมได้อธิบายการใช้งานโปรแกรม Text Editor ที่ชื่อ vi ไว้แล้วครับ การใช้งานก็ไม่ยุ่งยากอะไร เข้าไปที่ไดเร็คตอรี่ /etc/asterisk แล้วก็พิมพ์คำสั่ง vi ตามด้วยชื่อไฟล์ได้เลย เช่น vi sip.conf

4 เซ็ตวันที่และเวลาในเครื่อง Elastix ให้ตรงกับเวลาปัจจุบัน
วิธีการเซ็ตวันที่และเวลาในเครื่องให้ตรงกับเวลาปัจจุบันให้แก่ Elastix นั้นมีความสำคัญนะครับ ซึ่งการใช้งานบางฟีเจอร์เช่น Time Condition จำเป็นต้องตั้งเวลาให้ตรงด้วยไม่เช่นนั้นจะทำงานผิดพลาด รวมทั้งการบันทึกเหตุการณ์ต่างๆในขณะที่ Asterisk ทำงานลงไฟล์ Log ด้วย จะบันทึกได้ตรงกับเวลาที่เกิดขึ้นจริง
วิธีการเซ็ต Date และ Time ใน Elastix นะครับ

5 แก้ไขให้ Elasix ยอมรับ Call จากเบอร์ใดๆ
คลิ๊กเมนูตามนี้ครับ "PBX" -> "PBX Configuration" "General Settings"
elastix-general-settings.jpg
General Settings
elastix-general-settings.jpg (237.83 KiB) เปิดดู 17086 ครั้ง

ให้แก้ไขบรรทัด "Allow Anonymous Inbound SIP Calls?" นะครับให้เปลี่ยนเป็น "Yes"
และที่เกี่ยวกับ Voicemail คือบรรทัด "Number of seconds to ring phones before sending callers to voicemail" ซึ่งหมายถึงถ้าไม่ได้รับสายภายใน ... วินาทีจะโอนสายเข้า Voicemail ดีฟอลท์คือ 45 วินาที ถ้าคิดว่านานไปก็ลดลงได้ครับ เช่นเหลือ 30 วินาทีก็ได้

การคอนฟิก Elastix ตอนที่ 4
voip4share
Administrator
 
โพสต์: 656
ลงทะเบียนเมื่อ: 18 พ.ย. 2009 11:26
ที่อยู่: รามคำแหง กรุงเทพฯ

ย้อนกลับไปยัง Elastix - Unified Communications Software

ผู้ใช้งานขณะนี้

่กำลังดูบอร์ดนี้: ไม่มีสมาชิกใหม่ และ บุคคลทั่วไป 1 ท่าน

cron