利用 dahdi_monitor 来捕获进入线路上的音频信号

原文在这  http://wiki.ljackson.us/Asterisk_Echo  直接看这个可能还方便些

Visually Monitor a Zaptel channel:监视一个通道

[root@asterisk ~]# dahdi_monitor<channel num> -v

Record a Zaptel channel 记录/录制一个通道

[root@asterisk ~]# dahdi_monitor<channel num> -f <filename.raw>


Convert the raw file to a wav file for review. 转换成wav格式的文件
sox -r 8000 -s -w -c 1 <filename.raw> <filename.wav>

eMail the recording to yourself:以附件的形式发送邮件

uuencode <filename.wav> <filename.wav> | mail -s <filename.wav> <email@server.ext>

Next we need to make sure our echo settings, these settings are in /etc/asterisk/zapata.conf

The settings we will be looking at are listed below with typical default settings.

echocancel=yes

echocancelwhenbridged=no

echotraining=800

rxgain=0.0

txgain=0.0

Let's take a look at what these settings actually do.

echocancel Obviously this disables or enables echo cancellation, it is recommended to not turn this off. The yes setting sets the value to 128, this is the number of taps that are used. Each tap is one sample from the data stream. You can specify the number of taps to use as 16, 32, 64, 128, or 256. It is very rare that you need anything other than setting this to the yes setting.

echocancelwhenbridged This enabled or disabled echo cancellation when TDM calls are bridged. TDM calls should not need any echo cancellation but some people report improved call quality with this option turned on.

echotraining A common echo symptom is that at the beginning of a conversation there is a good deal of echo and then it fades away as it it trains itself. If this delay is too long, you can adjust the training cycle. The setting is represented as milliseconds and can accept any value between 10 to 4000. Making the setting to low will not enable the system to train properly. I find that setting this to 128 is often a good starting point.

rxgain This adjust the gain of the inbound signal. While Asterisk will accept any number from -100 to 100 (-100% to 100% of capacity) it is recommended to never put the values to more than -11 to +11 and in some case anything outside of the -5 to +5 range will actually cause audio loss (mostly on the TDM400 cards).

txgain This adjusts the audio gain for the signal being sent out to the phone line. While Asterisk will accept any number from -100 to 100 (-100% to 100% of capacity) it is recommended to never put the values to more than -11 to +11 and in some case anything outside of the -5 to +5 range will actually cause audio loss (mostly on the TDM400 cards).

One of the first questions commonly asked is "what is the best settings for the rxgain/txgain?" and simply put, there is no "best settings" that will work for everyone. Every installation is different as there is no perfect consistency between telephone line quality, impendence, line length, etc. So how do you know what settings to use to make the system work properly? Well, the zaptel developers have created some handy tools to help us with that. The primary tool we will use is ztmonitor This tool allows us to visually see the audio levels on the RX and TX sides allowing us a guide to adjusting the levels in the zapata.conf file.

The command format is:

ztmonitor <zap channel> -v
An example of monitoring zap channel 3 during a conversation is shown here:
[root@asterisk1 ~]# ztmonitor 3 -v

Visual Audio Levels

Use zapata.conf file to adjust the gains if needed.

( # = Audio Level * = Max Audio Hit )

<-------------(RX)-------------> <-------------(TX)------------->

################ * ######################### *

If those were the maximum levels that we were seeing during a call, we would know that the RX gain is set pretty good but the TX level is way too high. What we are looking for are peaks that don't go past the middle of the meter.

Although this may sound complicated, it is fairly simple to adjust these settings on the fly. My prefered way is to use an SSH client such as Putty to have three sessions open at the same time. One window will have the Asterisk CLI, the second will be running ztmonitor, and the third will have zapata.conf file open in an editor. During the call, if you need to adjust a setting, make the change to the file and save it, then switch to the Asterisk CLI and type the following:

asterisk1*CLI> reload chan_zap.so

This will reload the zap module without hanging up the call. When you have made you adjustment, stop and restart Asterisk just to make sure you have the right settings. With a little practice you should be able to do these basic echo adjustments in just a few minutes.

Again, this will not solve every echo problem, but for the majority of installations we have done, this was all we needed to do to virtually eliminate the echo problems from the TDM and TE connections.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值