Print
Category: Asterisk
Hits: 2456

1. Compile DAHDI บน Debian 8
     ในบทความตอนที่ 2 เราติดตั้ง Asterisk Packages บน Debian 8   ในตอนนี้เราจะติดตั้ง
     การ์ด AEX410   เราจะต้องลง DAHDI เพื่อให้การ์ดทำงานได้
     การลง DAHDI บน Debian 8 มีขั้นตอนดังนี้

     #apt-get install dahdi-source
     #m-a a-i dahdi
     #apt-get install asterisk-dahdi dahi
     #dahdi_span_assignments auto
    
2. ติดตั้งการ์ด AEX410



     

     รูปแทน - ในรูปเป็นการ์ด TDM400P 1 FXS + 1 FXO  

     หลังจากติดตั้งเสร็จเรียบร้อยแล้ว ก็ใช้ software utility scan หาการ์ดได้เลย

    

     DAHDI (Digium Asterisk Hardware Device Interface) ใช้
     dahdi_scan   จะเห็นว่าการ์ด AEX410 อยู่ในสภาพ active และไม่มี alarms (alarms=OK) การ์ดมี 1
     port FXO และ 4 ports จากนั้นจะใช้ dahdi_genconf command
     
     #/usr/sbin/dahdi_genconf

     เพื่อสร้าง config file ซึ่งจะได้ file /etc/dahdi/system.conf ดังรูปข้างล่าง

    

     ส่วนอีก file ที่ dahdi_genconf สร้งขึ้นมาคือ /etc/asterisk/dahdi-channels.conf   ซึ่งเราจะใช้ file นี้เป็นส่วน
     ประกอบใน file /etc/asterisk/chan_dahdi.conf ซึงเป็น file config channels ของการ์ด TDM และการ์ดอื่นๆ

     ตัวอย่าง /etc/asterisk/chan_dahdi.conf

     ===========================================================

     [trunkgroups]

     [channels]
     context=from-pstn 
     signalling=fxs_ks
     usecallerid=yes
     hidecallerid=no
     callwaiting=yes
     usecallingpres=yes
     callwaitingcallerid=yes
     threewaycalling=yes
     transfer=yes
     canpark=yes
     cancallforward=yes
     callreturn=yes
     echocancel=yes
     echocancelwhenbridged=no
     faxdetect=incoming
     echotraining=800
     rxgain=0.0
     txgain=0.0
     callgroup=1
     pickupgroup=1

     ;Uncomment these lines if you have problems with the disconection of your analog lines
     busydetect=yes
     busycount=3


     immediate=no

     #include dahdi-channels.conf
     #include chan_dahdi_additional.conf
     =======================================================
     

     include dahdi-channels.conf     หมายถึงให้รวม file dahdi-channels.conf ที่ถูกสร้างจาก /usr/sbin

     /dahdi_genconf เข้ากับ chan_dahdi.conf

     chan_dahdi_additional.conf     มักจะเป็น file ที่สำหรับคอนฟิกเบอร์ภายในที่เป็นโทรศัพท์ธรรมดา ในขณะที่

     sipphone/softphone

     กำหนดใน sip.conf

     ตัวอย่าง dahdi-channels.conf ที่ถูกสร้างโดย /usr/sbin/dahdi_genconf

    

     เมื่อมีทั้ง /etc/dahdi/system.conf และ /etc/asterisk/chan_dahdi.con เราก็ restart
     asterisk ได้เลย

     #service asterisk stop
     #service asterisk start
     #asterisk -r
     hostname*CLI> dahdi show channels

     ถ้า dahdi show channels ได้ channels ครบ   เราก็พร้อมที่จะ config /etc/asterisk/extensions.conf แล้ว

       

3. ส่งท้าย
     ในตอนหน้าจะคอนฟิก PSTN trunk แล้วเราจะมีทั้ง SIP trunk และ PSTN trunk ไว้ใช้งาน
     เจอกันใหม่นะครับ