1.模拟接口 (www.afuns.cn)
FXO-Foreign Exchange Office
FXS-Foreign Exchange Station
两者的差别就是FXS馈电(提供电压),而FXO不提供.普通模拟电话就是一个典型的FXO设备.
在真实的世界中,FXS和FXO总是成对出现的.由FXS接口向FXO接口馈电(提供电压),振铃;FXO向FXS传送号码(DTMF/FSK).所以对接时会出现fxs侧的用户需要首先呼叫到fxs,再二次拨号呼叫到被叫侧,而fxo侧用户可以一次直接呼叫被叫用户(一次拨号)。
在Asterisk中,FXO接口接受的是fxs信令和FXS提供给fxo信令.所以你在zapata中看到fxsXX(ls,gs,ks) 这个端口是FXO接口,如果是fxoXX(ls,gs,ks) 这个端口是FXS接口.
FXO用于连接PSTN(因为PSTN(FXS)向Asterisk的FXO接口馈电)
FXS用于连接普通电话机,(因为Asterisk通过FXS接口向模拟话机(FXO)提供馈电--这也就是为什么Asterisk接口卡上的FXS接口板需要外接电源的原因)
如果Asterisk位于企业程控交换机(PBX)的后面,Asterisk的FXO接口和PBX的模拟分机口相连,asterisk的FXS接口和PBX的模拟中继端口相连
2.模拟信令(www.afuns.cn)
loop start
Kewl start
grand start
这三个术语的具体区别牵扯到通讯专业领域了,普通用户需要了解的是grand start是需要专门申请的,一般用于中继线(它的好处就在于可以避免进线和出线的碰撞,提高线路使用率),而普通的电话线路一般是loop start的.Asterisk推荐的kewlstart也是一种loop start,只不过它识别supervisor disconnect信号(就是远端拆线后在发送忙音之前,发送这个信号.所以如果你的局端提供的是kewlstart信号,Asterisk默认的配置可以很正确的识别远端拆线,这也就是为什么默认的zapata.conf中不启用busydetect的原因).在中国大陆,主要采用的是loop start而北美采用的是kewlstart.
所以当你正确安装了卡板和驱动,但用默认的fxsks信令,拨号到pstn得到"all circuit busy now"的提示语时,尝试将zaptel.conf和zapata.conf中默认的fxsks改为fxsls--(修改完毕后需要重启机器而不是单纯重启asterisk)
3.恼人的忙音识别和拆线
前文提到FXO是被动接受型的,也就是说在真实世界FXS发送模拟信令,而FXO识别来自FXS的信令.这些信令工作在特定的频率,有特殊的断通比.如果局端交换能正确提供这些信号,FXO就能正确的判断线路的状态(使用中,已挂机),但实际上由于中国的国情,很多地区的信号音是非标准的,比如,规范的忙音信号应该是(0.35秒通,0.35秒断,工作频率是450kz),Asterisk在indications.conf对cn的定义就是如此
[general]
country=cn
....
[cn]
ringcadence = 1000,4000
dial = 450 ;拨号音
busy = 450/350,0/350 ;中国忙音标准
ring = 450/1000,0/4000 ;振铃音
congestion = 450/700,0/700 ;拥塞音
callwaiting = 450/400,0/4000 ;呼入等待音
dialrecall = 450
record = 950/400,0/10000
info = 450/100,0/100,450/100,0/100,450/100,0/100,450/400,0/400
stutter = 450+425
中国标准信号音
拨号音:(450Hz,-10±3dBm0,连续)——“嗡…”的连续音。
忙音:(450Hz,-10±3dBm0,0.35s on/0.35s off)——“嘟,嘟,嘟…”短促音(响0.35秒,断0.35秒)。
拥塞音:(450Hz,-10±3dBm0、0.7s on/0.7s off)——这是一种“嘟,嘟…”的短音(响0.7秒,音隔0.7秒)。拥塞音有点像忙音,但比忙音声音要长,它表示程控交换机因某种原因机线拥塞不通。
呼入等待音:(450Hz,-20±3dBm0、0.4s on/4.0s off)——在用户登记了“呼叫等待”服务项目后,如果该用户正与对方通话时,又有第三者呼叫该用用,则该用户在受话器中会听到一种微弱的信号音,这种信号是“嘟…”的短促音(响0.4秒,音隔0.4秒,再响0.4秒)。它表示有第三者在呼叫,提醒该用户是否要与第三者通话。
特种拨号音:(450Hz,-10±3dBm0,0.4s on/0.04s off)这是一种“嘟,嘟…”的一短一长的声音,当用户的电话中登记了某种程控电话服务项目后,摘机听到的拨号音就是这种特种拨号音,用以提醒该用户。这种拨号音不妨碍该用户打电话,只要在规定产时间(5秒)内拨号即可。
二次拨号音:(400Hz,-10±3dBm0、连续)
回铃音:(450Hz,-10±3dBm0,1.0s on/4.0s off)——“嘟,嘟…”的断续音(响1秒,断4秒)表示用户拨叫的对方电话已接通,正在振铃。
空号音:(450Hz,-10±3dBm0、0.1s on/0.1s off/0.1s on/0.1s off/0.1s on/0.1s off/0.4s on/0.4s off)--“嘟、嘟、嘟-”的450赫的三短一长音(短音为0.1秒,间断0.1秒,长音为0.4秒)
三方通话提醒音:(950Hz,-20±3dBm0、0.4s on/10.0s off)
催挂音:(950HZ 0.4dB)——当用户用完电话,没有挂机或话机手柄没有放好时,程控电话局会发出一种由小逐渐变大的连续音(950HZ),提醒该用户把话机挂好。
长途通知音:(450Hz,-10±3dBm0,0.2s on/0.2s off/0.2s on/0.6s off)——当用户在市内电话通话过程中,又听到“嘟,嘟”声,跟着一小段间歇,又再“嘟,嘟”,这样的短音(响0.2秒,断0.2秒,音隙0.6秒)就是“长途电话通知音”,告诉用户有人工长途电话要和您通话,请尽快结束市内通话,准备接听长途电话。这种长途电话通知音随着我国长途电话自动化的普及也越来越少了。
如果电信给你的忙音信号根本就不是这样的,Asterisk怎么可能识别呢,必然出现无法正确判断拆线的状况.(大城市这种情况就好得多).如果出现这种情况,就不得不通过ztmonitor录音后,判别它通断比,然后将这些数值填入zapata.conf的busypattern中,重启asterisk所在的服务器(例如beep持续600号码,静音400毫秒,那么busypattern=600,400)
kewlstart优于传统的Loop start的地方就在于supervisor disconnect信号.你可以看到北美的论坛上没有讨论忙音识别或者无法拆线的,而在UK,Australia就有很多类似的帖子.但是UK的经验拿到中国来也不行,因为UK的电信普遍采用了7号信令,通过CPC(Calling party Control-主叫控制)来处理拆线(remote hang up).
如果你的局端提供给你CPC,或supervisor disconnect,恭喜您,你可以摆脱恼人的忙音识别问题了.
备注: 如何确定自己的线路是否支持kewlstart
将一个支持拨号盘高亮的(不需要外接电源,直接从市话取电)普通模拟电话连接到PSTN线路上,拨通你的手机,接听手机,然后手机挂机,如果那部模拟电话在远端(手机)挂线后拨号盘灯熄灭(drop battery),那么这条线路是支持kewlstart的.不需设置busyXXX和callprogress
在中国,Asterisk的zapata.conf需要启用busydetect=yes,以及busycount=6可以解决大多数忙音识别和无法拆线的问题(基于loopstart)
zapata.conf(或zapata-channels.conf)
busydetect=yes
busycount=6 ;设置的值过小会引起通话中中断的故障
....................
loadzone = cn
defaultzone = cn
备注:
不要盲目按照国外的帖子随便增加busypattern这个参数。除非你明确知道这么作的原因。没有这个参数,Asterisk接受任何有规律的断通信号在busycount规定的次数内判别为忙音。如果busy tone的通断间隔不相等(如前文提到的beep 600毫秒,静默400毫秒),才需要手工设置.
不要把callprogress和busyxxx属性混用,这是两种不同的工作方式.目前默认工作方式的callprogress仅对北美生效
如果上述设置在你的机器上不生效,请检查线路质量,检测是否有回声,有的时候线路的杂音会干扰到Asterisk的忙音识别。
启用回声消除(见本文回声一节)
启用增益 (见本文增益一节)
如果是话务量比较密集的应用或对计费数据比较敏感的环境,建议去电信申请反极信号,同时在zapata.conf中增加
zapata.conf(zapata-channels.conf)
hanguponpolarityswitch=yes ;拆线
answeronpolarityswitch=yes ;对端应答(用于计费)
(不要和busydetect=yes或callprogress=yes同时使用)
4.CID(主叫号码)(www.afuns.cn)
CID主叫号码在使用中一般不会碰到问题,CID工作在FSK(美规)或DTMF方式,中国这两种情况都有,甚至还有欧规的情况.如果不幸你也有这种问题,呵呵,或者购买一个转换器(几十块一个),或者采用国产的卡(如(www.afuns.cn)就支持Global CLID).
备注:如何确定CLID的制式
拿家里原来的可以来显的电话机,必须是有时间显示的电话机.
1、先把机器的时间调乱.(随便调,但月份一定调)
2、然后用自己的手机打进去,电话响5声后挂掉,不要接.
3、然后看时间自动改过来了没.
如果是改过来了(年份不改不要紧,但月份一定要),那证明您家里是FSK制式。如果没改过来那您家里就是DTMF制式。
区分了fsk之后,如果在第一声之前,就显示了号码,那么就是欧制的,如果在第一声和第二声之间显示了来电,那么就是美制的。
南方电信一般为DTMF北方网通(联通)一般是FSK,如果您遇到DTFM那没办法,一个是买转换器,我淘宝店里有售(就是那个FSK转DTMF台湾产的50元一个)或修改驱动程序来解决。可以参照OPENVOX的方法,修改两个文件并重新编译zaptel驱动,将OPENVOS的wctdm.c覆盖掉,opvxa1200.c里面的……。
5.DTMF(www.afuns.cn)
分为RFC2833、info、inband,在zapata里设置为 dtmf=xxxxx也可以设置为auto好像不管用,
ZAP/DAHDI的DTMF检测是不可设置,如果检测有问题,可以放宽DTMF检测的参数
relaxdtmf=yes
6.回声(www.afuns.cn)
zapata.conf(zapata-channels.conf)
echocancel=yes
echocancelwhenbridged=yes,
echotraining=800
7.增益(www.afuns.cn)
其它常见问题链接:
===Q32, A1200P "TRUNK Dial failed due to CONGESTION" Problem===
please refer this link:
http://www.openvox.cn/bbs/viewth ... &extra=page%3D1
===Q33, A1200P Installation on Ubuntu 8.10 Server===
if you have a installation problem with A1200P/A800P,
please refer this:http://bbs.openvox.cn/viewthread.php?tid=819&extra=page%3D1
===Q34, Can't retrieve Taiwan's CID===
please refer this for your problem:
link:http://bbs.openvox.cn/viewthread.php?tid=726&extra=page%3D3
===Q35, FXO sends the digits of speed===
if you want to add speed dialup for FXO, please refer this:
http://bbs.openvox.cn/viewthread.php?tid=666&extra=page%3D3
===Q36, Trick to solve buffer re-sync issue of A1200P/A800P===
if your system keeps flushing the "buffer re-sync problems"
please refer this link:
http://bbs.openvox.cn/viewthread.php?tid=405&extra=page%3D6
===Q37, How do you report a problem===
In order to solve customer's problems very effective and efficiency,
when seeking a help from us, please give these information:
1) versions of kernel and Linux distribution
2) versions of asterisk and zaptel/dahdi
3) the name of cards used in your system
4) debug and error information from your system and asterisk
5) sending us zaptel(zaptel.conf and zapata.conf) or dahdi (system.conf and chan_dahdi.conf)
configuration files and extension.conf
6) after loading the driver, run the command: demsg and send the information to us
7) sending us the result of the command: cat /proc/interrupts
sending us the message of asterisk console when you making a call
9) inform the protocols you are using in your system
10) send us a working ssh account with root permission if you need us to check the system.
11) make a backup for your important files
12) describe the problem in details
===Q38,bug: FXO can not call out!===
The problem is this:
1) I cannot make outbound calls on an FXO card (Using FXSKS signalling)until I've received an incoming call
2) resetting the hookstate to offhook(A single ring is good enough),
or alternatively, disconnecting and reconnecting the telephone line.
please refer this link:
http://bbs.openvox.cn/viewthread.php?tid=740&extra=page%3D2
===Q39,FATAL: Module wctdm not found ===
if this problem occurred, please make sure:
1) the module is compiled and installed properly
2) you entered a right kernel, which you used to compile the zaptel
3) make sure you have a access permission to load the module.
4) make sure the wctdm.ko is under /lib/modules/2.6.XX/extra
===Q40,FATAL: Module opvxa1200 not found ===
if this problem occurred, please make sure:
1) the module is compiled and installed properly
2) you entered a right kernel, which you used to compile the zaptel
3) make sure you have a access permission to load the module.
4) make sure the opvxa1200.ko is under /lib/modules/2.6.XX/extra
===Q41,Tools for wctdm and opvxa1200 ===
you can use these tools to test the wctdm and opvxa1200
1) zttest
http://www.asteriskguru.com/tuto ... p_te405p_noise.html
2) zttool
http://www.voip-info.org/wiki/view/Asterisk+zttool
3) ztmonitor
http://www.voip-info.org/wiki/vi ... ata+gain+adjustment
4) fxotune
http://www.voip-info.org/wiki/view/Asterisk+fxotune
http://kb.digium.com/entry/134/
===Q42,check information of wctdm.ko/opvxa1200.ko ===
Under /lib/modules/2.6.18-128.el5/misc
run command: modinfo wctdm.ko, run modinfo opvxa1200 if checking opvxa1200
[root@bogon misc]# modinfo wctdm.ko
filename: wctdm.ko
license: GPL
alias: wcfxs
author: Mark Spencer <[email protected]>
description: Wildcard TDM400P Zaptel Driver
srcversion: 5E22C66ED4D5B1ADE573C83
alias: pci:v0000E159d00000001sv0000A901sd*bc*sc*i*
alias: pci:v0000E159d00000001sv0000A908sd*bc*sc*i*
alias: pci:v0000E159d00000001sv0000A801sd*bc*sc*i*
alias: pci:v0000E159d00000001sv0000A800sd*bc*sc*i*
alias: pci:v0000E159d00000001sv0000A8FDsd*bc*sc*i*
alias: pci:v0000E159d00000001sv0000A9FDsd*bc*sc*i*
alias: pci:v0000E159d00000001sv0000B119sd*bc*sc*i*
alias: pci:v0000E159d00000001sv0000B118sd*bc*sc*i*
alias: pci:v0000E159d00000001sv0000B1D9sd*bc*sc*i*
alias: pci:v0000E159d00000001sv0000B100sd*bc*sc*i*
alias: pci:v0000E159d00000001sv0000E159sd*bc*sc*i*
alias: pci:v0000E159d00000001sv0000A159sd*bc*sc*i*
depends: zaptel
vermagic: 2.6.18-128.el5 SMP mod_unload 686 REGPARM 4KSTACKS gcc-4.1
parm: debug:int
parm: loopcurrent:int
parm: reversepolarity:int
parm: robust:int
parm: opermode:charp
parm: timingonly:int
parm: lowpower:int
parm: boostringer:int
parm: fastringer:int
parm: fxshonormode:int
parm: battdebounce:uint
parm: battalarm:uint
parm: battthresh:uint
parm: ringdebounce:int
parm: fwringdetect:int
parm: alawoverride:int
parm: fastpickup:int
parm: fxotxgain:int
parm: fxorxgain:int
parm: fxstxgain:int
parm: fxsrxgain:int
[root@bogon misc]# pwd
/lib/modules/2.6.18-128.el5/misc
===Q43, How to debug wctdm or opvxa1200 ===
When loading the wctdm or opvxa1200 with a debug mode,
please loadding the driver in this way:
modprobe wctdm debug=1 // open the debug and check the /var/log/message
===Q44, RHEL/Centos 5.2: xpp/xdefs.h:117: error: conflicting types for ‘bool’ ===
please refer this:
https://issues.asterisk.org/view.php?id=12889
===Q45, xpp modules do not compile with kernel 2.6.19-1.2919.fc7===
please refer this:
https://issues.asterisk.org/view.php?id=9006
===Q46, spinlock.h error with RHEL 4===
please refer this link:
http://forums.digium.com/viewtop ... 37576c7aa92518fe48b
===Q47, Compile error on CentOS-4.6 with Kernel-2.6.9-67.0.15.ELsmp and CONFIG_DAHDI_NET===
please refer this link:
https://issues.asterisk.org/view.php?id=13427
===Q48, dahdi_compat.h:31:27: error: zaptel/zaptel.h: No such file ===
please read this:
https://issues.asterisk.org/view.php?id=14121
===Q49, when compiling zaptel, error: You do not appear to have the sources for...===
please refer this:
http://forums.digium.com/viewtopic.php?t=7061
http://lists.digium.com/pipermai ... 07-June/189259.html
===Q50, Bug#439814: zaptel-source: oslec_echo_can_identify undefined symbol===
please refer this:
http://lists.alioth.debian.org/p ... -August/009225.html
===Q51, DID YOU REMEMBER TO PLUG IN THE HD POWER CABLE TO THE TDM400P?? ===
please check from here:
http://www.openvox.com.cn/bbs/vi ... f500d9c9ea7edb52bfb
http://www.openvox.cn/download/other_docs/A800P_A1200P_FAQ(Chinese).pdf
===Q52, How to install Octasic SoftEcho ===
please refer these links:
http://www.openvox.cn/download/u ... n/Octvqeug_5000.pdf
http://www.octasic.com/en/products/softecho/softecho_asterisk.php
http://www.octasic.com/en/products/softecho/support.php
===Q53, Bug in Zaptel 1.2.20.1 and 1.4.5.1 - Only MG2 ===
please refer this:
http://trixbox.org/node/21080
http://www.rowetel.com/ucasterisk/oslec.html
===Q54, Howto: OSLEC echo canceling + DAHDI 2.1.0.4 + Asterisk 1.4 ===
please refer this:
http://www.asterisk.org/forum/vi ... dc698e89467c3d49a86
===Q55, Difference between zaptel and dahdi ===
please refer these links:
http://www.voip-info.org/wiki/view/DAHDI
http://docs.tzafrir.org.il/dahdi-linux/
http://docs.tzafrir.org.il/dahdi-tools/
===Q56, Tonezones for wctdm and opvxa1200 ===
The file zonedata.c contains the information about the tone zones used in libtonezone (and hence also in ztcfg). Here is a list of those zones:
us United States / North America
au Australia
fr France
nl Netherlands
uk United Kingdom
fi Finland
es Spain
jp Japan
no Norway
at Austria
nz New Zealand
it Italy
us-old United States Circa 1950 / North America
gr Greece
tw Taiwan
cl Chile
se Sweden
be Belgium
sg Singapore
il Israel
br Brazil
hu Hungary
lt Lithuania
pl Poland
za South Africa
pt Portugal
ee Estonia
mx Mexico
in India
de Germany
ch Switzerland
dk Denmark
cz Czech Republic
cn China
ar Argentina
my Malaysia
th Thailand
bg Bularia
ve Venezuela
ph Philippines
ru Russian Federation
tr Turkey
===Q57, Tools from zaptel to dahdi===
ztcfg -> dahdi_cfg
ztmonitor -> dahdi_monitor
ztscan -> dahdi_scan
ztspeed -> dahdi_speed
zttest -> dahdi_test
zttool -> dahdi_tool
zapconf -> dahdi_genconf (deprecates genzaptelconf)
=== Q58, the list of opermode===
when loading the driver wctdm/opvxa1200,
modprobe wctdm opermode=YOUR COUNTRY
please check from the list: fxo_mudules.h
===Q59, Callerid with DTMF and FSK ===
please refer these links:
http://www.ainslie.org.uk/callerid/cli_faq.htm
http://www.asteriskguru.com/tutorials/calleridall_function.html
https://issues.asterisk.org/view.php?id=7787
http://asterisk.pbx.in/callerid-standards
http://kb.digium.com/entry/3/
===Q60, Why are you unable to call out with Asterisk 1.4.22? ===
If you are using wctdm or opvxa1200 with Zaptel and Asterisk 1.4.22 then there is a known issue with outbound calls. The reason you are not able to call out is because Asterisk 1.4.22 has a new feature which detects if a analog line is plugged in or not, but this feature only works with Dahdi. So to fix the issue you can do one of the following.
edit the file under /asterisk-1.4.22、channels/chan_dahdi.c" find this line
#ifdef DAHDI_CHECK_HOOKSTATE return 0;
#else return 1;
Change the "0" to a "1"
#ifdef DAHDI_CHECK_HOOKSTATE return 1;
#else return 1;
=== Q61, Sound quality issue with wctdm and opvxa1200===
you can try these possible solutions:
1) Check the IRQ, make sure system handle IRQ properly
2) Use zttest to check the result
3) Disable the X window and framebuffer(set vga=normal from grub)
4) When using IDE driver, please open the DMA control
5) Bind the card IRQ to particular CPU, for example:
echo 1 > /proc/irq/217/smp_affinity #wcfxo
6) Set the latency timer: setpci -v -s 04:06.0 LATENCY_TIMER=f8 #wcfxo
===Q62, Echotraining and OSLEC===
if you use the OSLEC, you must disable the echotraining.
otherwise, the channel will be silent.
===Q63, Far side disconnected with disconnect supervisions===
possible solutions:
1) Your PSTN provider uses voltage/battery drop for disconnect supervision,
pleas try to edit DCT in zaptel.h to 100 ms or higher.
2) If you PSTN provider provides reverse polarity/battery
disconnect supervision:
hanguponpolarityswitch=yes
answeruponpolarityswitch=yes
3) If your PSTN provider has disconnect/busy tone disconnect supervision
busydetect=yes busycount=6
or try to callprogress, and set your progzone to your country code in zapata.conf
=====Q64, Cabling for wctdm and opvxa1200===
wctdm/opvxa1200 uses RJ11 cable. please refer this:
http://www.tech-faq.com/rj-11.shtml
http://en.wikipedia.org/wiki/RJ11,_RJ14,_RJ25
===Q65, Splitter for A1200P/A800P===
http://openvox.cn/products/show.php?itemid=120&lang=2