ไฟล์ asterisk.conf

Asterisk Opensource IP Pbx

ไฟล์ asterisk.conf

โพสต์โดย voip4share » 01 ก.พ. 2010 00:03

ไฟล์ asterisk.conf เป็นไฟล์ที่เราใช้บอก Asterisk ว่าคอนฟิก ไดเร็คตอรี่ โมดูล เก็บอยู่ที่ไหน จะให้มันเก็บบันทึกล๊อกไฟล์ไว้ที่ไหน ตอนรันจะให้มันรันด้วยออปชั่นอะไรบ้าง เป็นต้น ปกติไฟล์นี้เราจะไม่แก้ไขมันครับ ใช้ค่าดีฟอลท์ก็พอเว้นแต่ว่าเราต้องการจะแก้ไขมันจริงๆและรู้ว่ากำลังทำอะไรอยู่ ไม่เช่นนั้นแก้ไขแล้วอาจจะรัน Asterisk ไม่ได้ก็ได้นะครับ

ไฟล์ asterisk.conf นี้นะครับ แบ่งออกเป็น 4 ส่วนคือ
[directories] กำหนดไดเร็คตอรี่เก็บไฟล์ต่างๆของ Asterisk ซึ่งจะบอก Asterisk ว่ามันจะหาไฟล์ที่ต้องการได้ที่ไดเร็คตอรี่ไหน อย่าลืมลบ (!) ออกด้วยนะครับ ไม่อย่างนั้นจะไม่มีผลอะไร เราไม่ต้องแก้ไขข้อมูลใน [directory] นี้ก็ได้นะครับ เพราะค่าดีฟอลท์มันก็เป็นอย่างนี้อยู่แล้ว
[options] กำหนดออปชั่นในการสตาร์ทและการทำงานของ Asterisk และ Asterisk Console
[files] กำหนด File Permission
[compat] กำหนดว่าในการเรียกคำสั่งเพื่อสั่งงาน Asterisk นั้นจะใช้เครื่องหมายคั่นตัวแปรแบบ Asterisk 1.4 หรือ Asterisk 1.6 ซึ่งจะมีผลกับการอัพเกรดจาก 1.4 เป็น 1.6 ซึ่งสองเวอร์ชั่นนี้มีเครื่องหมายคั่นตัวแปรไม่เหมือนกันนะครับ

แต่ละส่วนก็มีออปชั่นดังต่อไปนี้

[directories] ; remove the (!) to enable this
astetcdir => /etc/asterisk
astmoddir => /usr/lib/asterisk/modules
astvarlibdir => /var/lib/asterisk
astdbdir => /var/lib/asterisk
astkeydir => /var/lib/asterisk
astdatadir => /var/lib/asterisk
astagidir => /var/lib/asterisk/agi-bin
astspooldir => /var/spool/asterisk
astrundir => /var/run/asterisk
astlogdir => /var/log/asterisk

[options]
;verbose = 3
; เซ็ตจำนวนตัว v ซึ่งจะมีผลกับการแสดงข้อความต่างบน Asterisk Console ตัว v ยิ่งมากยิ่งแสดงละเอียดมาก เมื่อก่อนตอนเราจะสตาร์ท Asterisk เราจะสั่งด้วยคำสั่ง /usrs/sbin/asterisk -vvvvg ใช่มั๊ยครับ แต่ตอนนี้ไม่ต้องใส่ -v อีกแล้ว อาศัย verbose นี้แทน ออปชั่นนี้จะหมายถึง (-v)
;debug = 3
;ให้ Asterisk ทำงานในโหมด Debug และกำหนดระดับของการ Debug มีค่าตั้งแต่ 0, 1-4 โดยที่ 0 คือไม่ Debug
;alwaysfork = yes
;same as -F at startup
;nofork = yes
;ไม่ให้ Asterisk ทำงานในโหมดแบ็คกราวด์ ออปชั่นนี้เที่ยบเท่ากับ -f
;quiet = yes ; same as -q at startup
;timestamp = yes|no
;เวลาแสดงข้อความ Event ต่างๆใน Asterisk Console ให้มีวันที่และเวลากำกับไว้ด้วย
;execincludes = yes|no
;support #exec in config files
;console = yes|no
;Run as console (same as -c at startup)
;highpriority = yes
;Run realtime priority (same as -p at startup)
;initcrypto = yes|no
;Initialize crypto keys (same as -i at startup)

;nocolor = yes ; Disable console colors
;dontwarn = yes ; Disable some warnings
;dumpcore = yes
;Dump core เมื่อเกิดเหตุการณ์ที่ Asterisk ไม่สามารถรับมือได้ เที่ยบเท่ากับ -g
;languageprefix = yes ; Use the new sound prefix path syntax
;internal_timing = yes|no
;ใช้ internal timing
;systemname = my_system_name
;prefix uniqueid with a system name for global uniqueness issues
;autosystemname = yes
;automatically set systemname to hostname - uses 'localhost' on failure, or systemname if set
;maxcalls = 10
;กำหนดจำนวน Concurrent Call สูงสุดที่จะให้ Asterisk รองรับ
;maxload = 0.9 ; Asterisk stops accepting new calls if the load average exceed this limit
;maxfiles = 1000 ; Maximum amount of openfiles
;minmemfree = 1 ; in MBs, Asterisk stops accepting new calls if the amount of free memory falls below this watermark
;cache_record_files = yes
;ในขณะที่มีการบันทึกเสียง ให้แค๊ชไฟล์เสียงที่กำลังบันทึกไว้ในไดเร็คตอรี่อื่นก่อน
;record_cache_dir = /tmp
;ชื่อไดเร็คตอรี่ที่จะใช้เก็บแค๊ชไฟล์เสียง
;transmit_silence_during_record = yes
;ให้ส่งเสียงเงียบแบบ SLINEAR ในขณะที่กำลังบันทึกเสียง เอาไว้แอบฟังแชนแนลที่กำลังบันทึกเสียงอยู่ ในระบบคอลเซ็นเตอร์
;transmit_silence = yes
;ให้ส่งเสียงเงียบแบบ SLINEAR ในขณะที่กำลังบันทึกเสียง หรือกำลังสร้าง DTMF
;transcode_via_sln = yes ; Build transcode paths via SLINEAR, instead of directly
;runuser = asterisk
;ยูสเซอร์ที่จะใช้รัน Asterisk (เทียบเท่ากับ -U)
;กรุ๊ปที่จะใช้รัน Asterisk (เหมือนกับใช้ -G)
;lightbackground = yes
;If your terminal is set for a light-colored background
documentation_language = en_US ; Set the Language you want Documentation displayed in. Value is in the same format as locale names
;hideconnect = yes ; Hide messages displayed when a remote console connects and disconnects

; Changing the following lines may compromise your security.
;[files]
;astctlpermissions = 0660
;astctlowner = root
;astctlgroup = apache
;astctl = asterisk.ctl

[compat]
pbx_realtime=1.6
res_agi=1.6
app_set=1.6

ขออธิบาย [compat] เพิ่มเติมอีกสักนิดนะครับ
สำหรับท่านที่เดิมใช้ Asterisk 1.4 อยู่ แล้วมีการเขียน Dial Plan ไว้พอสมควรและมีส่งคำสั่งพร้อมตัวแปรไปสั่งงาน AGI ด้วย ต่อมาภายหลังมีการอัพเกรดเป็น Asterisk 1.6 แต่ไม่อยากไปแก้ Dialpaln หรือ AGI ใหม่ ตรงนี้ช่วยท่านได้ครับ
pbx_realtime ถ้าใช้คอนฟิก Dial Plan แบบ Asterisk Realtime จะให้ใช้แบบ Asterisk 1.4 หรือว่า Asterisk 1.6
res_agi กำหนดว่าในการสั่งรัน AGI และต้องมีการส่งค่าไปด้วยนั้น จะให้ใช้เครื่องหมาย | อย่างใน Asterisk 1.4 หรือว่าเครื่องหมาย , อย่างใน Asterisk 1.6
app_set
voip4share
Administrator
 
โพสต์: 656
ลงทะเบียนเมื่อ: 18 พ.ย. 2009 11:26
ที่อยู่: รามคำแหง กรุงเทพฯ

ย้อนกลับไปยัง Asterisk SIP Server

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

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

cron