我是靠谱客的博主 香蕉樱桃,最近开发中收集的这篇文章主要介绍利用 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.

最后

以上就是香蕉樱桃为你收集整理的利用 dahdi_monitor 来捕获进入线路上的音频信号的全部内容,希望文章能够帮你解决利用 dahdi_monitor 来捕获进入线路上的音频信号所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(49)

评论列表共有 0 条评论

立即
投稿
返回
顶部