การ Patch TDM1600 Analog Interface Card Driver

การ Patch TDM1600 Driver

The TDM1600 is a PCI 2.2 compliant card that supports FXS and FXO station interfaces for connecting analog telephones and analog POTS lines through a PC, It supports a combination of S2, O2 or SO modules for a total of 16 lines.

Using Asterisk PBX software and standard PC hardware a user can create a SOHO telephony environment which includes all the sophisticated features of a high end PBX / Voicemail platform


SO Module(1 FXS & 1 FXO Ports): Unique PSTN Fallback Function! Make/receive calls even when system powers down.
S2 Module(2 FXS Ports): The S2 is a module with 2 FXS ports to terminate two analog telephone.
O2 Module(2 FXO Ports): The O2 is a module with 2 FXO ports to terminate two analog PSTN(POTS) lines.

Ref : http://www.yeastar.com/products/tdm1600.asp

1. ไปยัง Path  /usr/src เพื่อทำการติดตั้ง File
[shell]
# cd /usr/src
[/shell]

2.ทำการติดตั้ง patch เพื่อให้สามารถใช้คำสั่ง patch ได้
[shell]
# yum install patch
[/shell]

3.ทำการ Download Zaptel Driver และ Zaptel Patch ของ Yeaster
[shell]
# wget http://downloads.digium.com/pub/zaptel/releases/zaptel-1.4.12.1.tar.gz
# wget http://www.yeastar.com/download/ystdm16xx-zaptel-1.4.12.1.patch.tar.gz
[/shell]

4.แตกไฟล์ zaptel-1.4.12.1.tar.gz  และ ystdm16xx-zaptel-1.4.12.1.patch.tar.gz
[shell]
# tar xzvf zaptel-1.4.12.1.tar.gz
# tar xzvf ystdm16xx-zaptel-1.4.12.1.patch.tar.gz
[/shell]

5.ทำการ Patch Driver
[shell]
# patch -p0 < ystdm16xx-zaptel-1.4.12.1.patch
patching file zaptel-1.4.12.1/kernel/ystdm16xx.c
patching file zaptel-1.4.12.1/kernel/ystdm8xx.c
patching file zaptel-1.4.12.1/Makefile
patching file zaptel-1.4.12.1/zaptel.sysconfig
[/shell]

6. ติดตั้ง Kernel code และ gcc complier เพื่อใช้ในการติดตั้ง
[shell]
# yum install kernel-devel
# yum install kernel
# yum install gcc
[/shell]

7. ทำการ Download newt.h จาก Website : http://www.yeastar.com/ และย้ายไฟล์ newt.h ไปไว้ยัง path  /usr/include/
[shell]
# wget http://www.yeastar.com/download/newt.h
# mv newt.h /usr/include/
[shell]

8. Restart เครื่อง Server
[shell]
# reboot
[/shell]

9. Compile และติดตั้ง Driver TDM1600 เมื่อติดตั้งเสร็จให้ Restart เครื่อง Server
[shell]
# cd /usr/src/zaptel-1.4.12.1
# ./configure
configure: creating ./config.status
config.status: creating build_tools/menuselect-deps
config.status: creating makeopts
config.status: creating build_tools/make_firmware_object
configure: *** Zaptel build successfully configured ***
[/shell]
[shell]
# make clean
# make && make install
# reboot
[/shell]

10. ทำการแก้ไขไฟล์ zapata.conf หาที่ #include zapata-auto.conf  แล้วแก้ไขเป็น #include zapata-channels.conf
[shell]
# vi /etc/asterisk/zapata.conf

จากเดิม

;Include genzaptelconf configs
#include zapata-auto.conf

group=1

;Include AMP configs
#include zapata_additional.conf

แก้เป็น

;Include genzaptelconf configs
#include zapata-channels.conf

group=1

;Include AMP configs
#include zapata_additional.conf
[/shell]

11. Generate ข้อมูลของ Card TDM1600 ( อ่านข้อมูลของ Card )
[shell]
# genzaptelconf
# asterisk -r
Connected to Asterisk 1.4.21.2-2 RPM by vc-rpms@voipconsulting.nl currently running on trixbox1 (pid = 2365)
Verbosity is at least 3
trixbox1*CLI> restart now

# asterisk -r
Connected to Asterisk 1.4.21.2-2 RPM by vc-rpms@voipconsulting.nl currently running on trixbox1 (pid = 2365)
Verbosity is at least 3
trixbox1*CLI> zap show channels
Chan Extension  Context         Language   MOH Interpret
pseudo            default         en         default
1            from-internal   en         default
2            from-pstn       en         default
3            from-internal   en         default
4            from-pstn       en         default
5            from-internal   en         default
6            from-pstn       en         default
7            from-internal   en         default
8            from-pstn       en         default
9            from-internal   en         default
10            from-pstn       en         default
11            from-internal   en         default
12            from-pstn       en         default
13            from-internal   en         default
14            from-pstn       en         default
15            from-internal   en         default
16            from-pstn       en         default
[/shell]
12. Run Command ztcfg –v และ ztcfg –vv เพื่อดูข้อมูลของการ์ด ซึ่งจะแสดงว่าพบกี่ช่องสัญญาณ
[shell]
# ztcfg -v

Zaptel Version: 1.4.12.1
Echo Canceller: MG2
Configuration
======================

16 channels to configure.

# ztcfg -vv

Zaptel Version: 1.4.12.1
Echo Canceller: MG2
Configuration
======================

Channel map:

Channel 01: FXO Kewlstart (Default) (Slaves: 01)
Channel 02: FXS Kewlstart (Default) (Slaves: 02)
Channel 03: FXO Kewlstart (Default) (Slaves: 03)
Channel 04: FXS Kewlstart (Default) (Slaves: 04)
Channel 05: FXO Kewlstart (Default) (Slaves: 05)
Channel 06: FXS Kewlstart (Default) (Slaves: 06)
Channel 07: FXO Kewlstart (Default) (Slaves: 07)
Channel 08: FXS Kewlstart (Default) (Slaves: 08)
Channel 09: FXO Kewlstart (Default) (Slaves: 09)
Channel 10: FXS Kewlstart (Default) (Slaves: 10)
Channel 11: FXO Kewlstart (Default) (Slaves: 11)
Channel 12: FXS Kewlstart (Default) (Slaves: 12)
Channel 13: FXO Kewlstart (Default) (Slaves: 13)
Channel 14: FXS Kewlstart (Default) (Slaves: 14)
Channel 15: FXO Kewlstart (Default) (Slaves: 15)
Channel 16: FXS Kewlstart (Default) (Slaves: 16)

16    hannels to configure.
[/shell]

13.Run Command zttest เพื่อตรวจสอบการทำงานของ Card
[shell]
# zttest
Opened pseudo zap interface, measuring accuracy...
99.998436% 99.992477% 99.997368% 99.997368% 99.997650% 99.997368% 99.997665%
99.997360% 99.996773% 99.997467% 99.997559% 99.997757% 99.997261% 99.997368%
--- Results after 14 passes ---
Best: 99.998 -- Worst: 99.992 -- Average: 99.997134, Difference: 99.997135

[trixbox1.localdomain ~]# zttest -v
Opened pseudo zap interface, measuring accuracy...

8192 zaptel samples in 8191.952 system clock sample intervals (99.999%)
8192 zaptel samples in 8191.504 system clock sample intervals (99.994%)
--- Results after 2 passes ---
Best: 99.999 -- Worst: 99.994 -- Average: 99.996677, Difference: 99.996680
[/shell]

Note : การ patch อุกปรณ์ตัวนี้ผมได้เขียนไว้นานแล้วนะครับคงจะประมาณ 2 ปีได้แล้ว แต่เพิ่งจะมาเขียนไว้ใน blog แห่งนี้ ยังไงแล้วก็จะพยายามอัพเดตบทความเรื่อยๆ นะครับ เผื่อว่าอาจจะมีประโยชน์แก่ใครบ้างนะครับผม


 

การ Patch TDM1600 Driver สำหรับ Trixbox


1.ไปยัง Path /usr/src เพื่อทำการติดตั้ง File











[trixbox1.localdomain ~]# cd /usr/src





2.ทำการติดตั้ง patch เพื่อให้สามารถใช้คำสั่ง patch ได้











[trixbox1.localdomain src]# yum install patch





3.ทำการ Download Zaptel Driver และ Zaptel Patch ของ Yeaster











[trixbox1.localdomain src]# wget http://downloads.digium.com/pub/zaptel/releases/zaptel-1.4.12.1.tar.gz



[trixbox1.localdomain src]# wget http://www.yeastar.com/download/ystdm16xx-zaptel-1.4.12.1.patch.tar.gz






4.แตกไฟล์ zaptel-1.4.12.1.tar.gzและ ystdm16xx-zaptel-1.4.12.1.patch.tar.gz











[trixbox1.localdomain src]# tar xzvf zaptel-1.4.12.1.tar.gz


[trixbox1.localdomain src]# tar xzvf ystdm16xx-zaptel-1.4.12.1.patch.tar.gz


ystdm16xx-zaptel-1.4.12.1.patch





5.ทำการ Patch Driver











[trixbox1.localdomain src]# patch -p0 < ystdm16xx-zaptel-1.4.12.1.patch


patching file zaptel-1.4.12.1/kernel/ystdm16xx.c


patching file zaptel-1.4.12.1/kernel/ystdm8xx.c


patching file zaptel-1.4.12.1/Makefile


patching file zaptel-1.4.12.1/zaptel.sysconfig








6.ติดตั้ง Kernel code และ gcc complier เพื่อใช้ในการติดตั้ง











[trixbox1.localdomain src]# yum install kernel-devel


[trixbox1.localdomain src]# yum install kernel


[trixbox1.localdomain src]# yum install gcc





7.ทำการ Download newt.h จาก Website : http://www.yeastar.com/ และย้ายไฟล์ newt.h ไปไว้ยัง path/usr/include/











[trixbox1.localdomain src]# wget http://www.yeastar.com/download/newt.h


[trixbox1.localdomain src]# mv newt.h /usr/include/





8.Restart เครื่อง Server











[trixbox1.localdomain src]# reboot





9.Compile และติดตั้ง Driver TDM1600 เมื่อติดตั้งเสร็จให้ Restart เครื่อง Server











[trixbox1.localdomain ~]# cd /usr/src/zaptel-1.4.12.1


[trixbox1.localdomain zaptel-1.4.12.1]# ./configure


configure: creating ./config.status


config.status: creating build_tools/menuselect-deps


config.status: creating makeopts


config.status: creating build_tools/make_firmware_object


configure: *** Zaptel build successfully configured ***




[trixbox1.localdomain zaptel-1.4.12.1]# make clean


[trixbox1.localdomain zaptel-1.4.12.1]# make && make install


[trixbox1.localdomain zaptel-1.4.12.1]# reboot





10.ทำการแก้ไขไฟล์ zapata.conf หาที่ #include zapata-auto.confแล้วแก้ไขเป็น #include zapata-channels.conf











[trixbox1.localdomain ~]# vi /etc/asterisk/zapata.conf





จากเดิม











;Include genzaptelconf configs


#include zapata-auto.conf



group=1



;Include AMP configs


#include zapata_additional.conf





แก้เป็น











;Include genzaptelconf configs


#include zapata-channels.conf



group=1



;Include AMP configs


#include zapata_additional.conf





11.Generate ข้อมูลของ Card TDM1600 ( อ่านข้อมูลของ Card )











[trixbox1.localdomain ~]# genzaptelconf


[trixbox1.localdomain ~]# asterisk -r


Connected to Asterisk 1.4.21.2-2 RPM by vc-rpms@voipconsulting.nl currently running on trixbox1 (pid = 2365)


Verbosity is at least 3


trixbox1*CLI> restart now



[trixbox1.localdomain ~]# asterisk -r


Connected to Asterisk 1.4.21.2-2 RPM by vc-rpms@voipconsulting.nl currently running on trixbox1 (pid = 2365)


Verbosity is at least 3


trixbox1*CLI> zap show channels


Chan ExtensionContextLanguageMOH Interpret


pseudodefaultendefault


1from-internalendefault


2from-pstnendefault


3from-internalendefault


4from-pstnendefault


5from-internalendefault


6from-pstnendefault


7from-internalendefault


8from-pstnendefault


9from-internalendefault


10from-pstnendefault


11from-internalendefault


12from-pstnendefault


13from-internalendefault


14from-pstnendefault


15from-internalendefault


16from-pstnendefault




12.Run Command ztcfg –v และ ztcfg –vv เพื่อดูข้อมูลของการ์ด ซึ่งจะแสดงว่าพบกี่ช่องสัญญาณ











[trixbox1.localdomain ~]# ztcfg -v



Zaptel Version: 1.4.12.1


Echo Canceller: MG2


Configuration


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




16 channels to configure.




[trixbox1.localdomain ~]# ztcfg -vv



Zaptel Version: 1.4.12.1


Echo Canceller: MG2


Configuration


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




Channel map:



Channel 01: FXO Kewlstart (Default) (Slaves: 01)


Channel 02: FXS Kewlstart (Default) (Slaves: 02)


Channel 03: FXO Kewlstart (Default) (Slaves: 03)


Channel 04: FXS Kewlstart (Default) (Slaves: 04)


Channel 05: FXO Kewlstart (Default) (Slaves: 05)


Channel 06: FXS Kewlstart (Default) (Slaves: 06)


Channel 07: FXO Kewlstart (Default) (Slaves: 07)


Channel 08: FXS Kewlstart (Default) (Slaves: 08)


Channel 09: FXO Kewlstart (Default) (Slaves: 09)


Channel 10: FXS Kewlstart (Default) (Slaves: 10)


Channel 11: FXO Kewlstart (Default) (Slaves: 11)


Channel 12: FXS Kewlstart (Default) (Slaves: 12)


Channel 13: FXO Kewlstart (Default) (Slaves: 13)


Channel 14: FXS Kewlstart (Default) (Slaves: 14)


Channel 15: FXO Kewlstart (Default) (Slaves: 15)


Channel 16: FXS Kewlstart (Default) (Slaves: 16)



16hannels to configure.





13.Run Command zttest เพื่อตรวจสอบการทำงานของ Card











[trixbox1.localdomain ~]# zttest


Opened pseudo zap interface, measuring accuracy...


99.998436% 99.992477% 99.997368% 99.997368% 99.997650% 99.997368% 99.997665%


99.997360% 99.996773% 99.997467% 99.997559% 99.997757% 99.997261% 99.997368%


--- Results after 14 passes ---


Best: 99.998 -- Worst: 99.992 -- Average: 99.997134, Difference: 99.997135



[trixbox1.localdomain ~]# zttest -v


Opened pseudo zap interface, measuring accuracy...



8192 zaptel samples in 8191.952 system clock sample intervals (99.999%)


8192 zaptel samples in 8191.504 system clock sample intervals (99.994%)


--- Results after 2 passes ---


Best: 99.999 -- Worst: 99.994 -- Average: 99.996677, Difference: 99.996680






Comments