设为首页 收藏本站
开启辅助访问 切换到宽版
注册会员 找回密码

VoIP88

toasterisk 发表于 2015-1-8 11:43 | 显示全部楼层 |阅读模式
如何在FreeSWITCH 安装Sangoma 模拟语音板卡

作者:James.zhu@hiastar.com

准备工作
检测板卡配件, 确认板卡的RJ11 配线,sangoma 附件配置包含了RJ11 的窄头线。
如果支持FXS,板卡必须上电。如果A400 无FXS 也需要上电。并且检测12V 电脑电源接口
插入模拟板卡,支持PCI-E 或者PCI卡。
观看flash 演示,了解A200/A400 模块结构:
板卡模块的端口是如何排序的:
A400: http://www.sangoma.com/assets/demos/a400/demo.swf?width=700&height=550
A200: http://www.sangoma.com/assets/demos/a200/demo.swf?width=572&height=508
A400 模拟板卡需要用户自己做线,请参考线序
下载安装Sangoma 板卡驱动 wanpipe

安装环境:centos+freeSWITCH+Sangoma A200 模拟语音板卡
安装板卡之前使用系统命令lspci -vvv 是否检测到板卡

05:04.0 Network controller: Sangoma Technologies Corp. A200/Remora FXO/FXS Analog AFT card
        Subsystem: NEC Corporation Device 1300
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 255 (1250ns min, 3750ns max)
        Interrupt: pin A routed to IRQ 185
        Region 0: Memory at f7200000 (32-bit, non-prefetchable) [size=64K]

如果系统命令没有检测到sangoma 板卡,把卡拔出来,重新清理板卡金手指部分,重新固定在PCI 插槽。


下载最新Sangoma 板卡驱动

wget ftp://ftp.sangoma.com/linux/current_wanpipe/wanpipe-current.tgz
解压压缩包

tar xfz wanpipe-current.tgz
cd wanpipe-<version>.tgz
编译板卡驱动和freetdm

执行编译安装命令

make freetdm
make install
下载安装配置FreeSWITCH

安装Centos 支持包

yum install expat-devel openssl-devel libtiff-devel libX11-devel unixODBC-devel libssl-devel python-devel \
                 zlib-devel libzrtpcpp-devel alsa-lib-devel libogg-devel libvorbis-devel perl-libs gdbm-devel \
                 libdb-devel uuid-devel @development-tools
安装git 以后,使用git 安装

安装FreeSWITCH

git clone git://git.freeswitch.org/freeswitch.git
  cd freeswitch
  ./bootstrap.sh
编译前,添加freetdm 模块,编辑modules.conf 文件,注释掉libs/freetdm/mod_freetdm 模块,保存文件。 执行

./configure
make
make install
make all install cd-sounds-install cd-moh-install // 安装 语音文件 和语音等待文件
配置Sangoma 板卡

执行 /usr/sbin/wancfg_fs 命令,启动配置脚本,通过选项来一步步配置板卡

[root@localhost sbin]# wancfg_fs
########################################################################
#                          Sangoma Wanpipe                                  #
#        Dahdi/Zaptel/SMG/TDMAPI/BOOT Configuration Script             #
#                             v2.39                                    #
#                     Sangoma Technologies Inc.                        #
#                        Copyright(c) 2013.                            #
########################################################################

Would you like to change FreeSWITCH Configuration Directory?
Default: /usr/local/freeswitch/conf
1. NO
2. YES
[1-2, ENTER='NO']:1  // 选择默认安装目录

-------------------------------------------------------
Configuring T1/E1 cards [A101/A102/A104/A108/A116/T116]
-------------------------------------------------------

No Sangoma ISDN T1/E1 cards detected

Press any key to continue:
-------------------------------------------
Configuring ISDN BRI cards [A500/B500/B700]
-------------------------------------------

No Sangoma ISDN BRI cards detected

Press any key to continue:
------------------------------------
Configuring GSM cards [W400]
------------------------------------

No Sangoma GSM cards detected

Press any key to continue:
------------------------------------
Configuring analog cards [A200/A400/B600/B610/B700/B800]
------------------------------------

-----------------------------------------------------------
A400 detected on slot:4 bus:3
-----------------------------------------------------------

Would you like to configure AFT-400 on slot:4 bus:3
1. YES
2. NO
[1-2]:1   // 选择yes

Which codec will be used?
1. MULAW - North America
2. ALAW - Europe
[1-2]:2  // ALAW

Which Operation Mode will be used?
1. FCC
2. TBR21
3. AUSTRALIA
[1-3, ENTER='FCC']: 1   // 无中国制式,暂时选择FCC。 如果修改到中国制式,修改/etc/wanpipe/wanpipe1.conf 文件 的 TDMV_OPERMODE   = CHINA

Press any key to continue:
AFT-400 configured on slot:4 bus:3 span:1

Analog card configuration complete

Press any key to continue:
------------------------------------
Configuring USB devices [U100]
------------------------------------

###################################################################
#                             SUMMARY                             #
###################################################################

  0 T1/E1 port(s) detected, 0 configured
  0 ISDN BRI port(s) detected, 0 configured
  1 analog card(s) detected, 1 configured
  0 GSM card(s) detected, 0 configured
  0 usb device(s) detected, 0 configured

Configurator will create the following files:
        1. Wanpipe config files in /etc/wanpipe
        2. freetdm config file /usr/local/freeswitch/conf/freetdm.conf
        3. freetdm_xml config file /usr/local/freeswitch/conf/freetdm.conf.xml

Your configuration has been saved in /etc/wanpipe/debug-2013-07-31.tgz.
When requesting support, email this file to techdesk@sangoma.com


###################################################################

Configuration Complete! Please select following:
1. YES - Continue
2. NO - Exit
[1-2]:1  // 选择继续

Wanpipe configuration complete: choose action
1. Save cfg: Stop Wanpipe now
2. Do not save cfg: Exit
[1-2]:1  // 选择立即停止wanpipe

sh: asterisk: command not found
sh: asterisk: command not found

Stopping Wanpipe...


Removing old configuration files...

Copying new Wanpipe configuration files...

Copying new freetdm configuration files (/usr/local/freeswitch/conf/freetdm.conf)...

Copying new freetdm configuration files (/usr/local/freeswitch/conf/autoload_configs/freetdm.conf.xml)...

Wanrouter start complete...
Current boot level is 3

Wanrouter boot scripts configuration...

Removing existing wanrouter boot scripts...OK
Would you like wanrouter to start on system boot?
1. YES
2. NO
[1-2]:1   // 选择系统自动启动

Verifying Zaptel boot scripts...
Enabling wanrouter boot scripts ...(level:8)
Enabling wanrouter shutdown scripts ...(level:91)
Sangoma cards configuration complete, exiting...

[root@localhost sbin]# reboot

Broadcast message from root (pts/1) (Wed Jul 31 20:13:04 2013):

The system is going down for reboot NOW!
[root@localhost sbin]#
检测板卡硬件

执行以下命令,检查板卡状态,如果用户购买的是带硬件回声的卡,显示HWEC=32

[root@localhost ~]# wanrouter hwprobe

-------------------------------
| Wanpipe Hardware Probe Info |
-------------------------------
1 . AFT-A400-SH : SLOT=4 : BUS=3 : IRQ=5 : CPU=A : PORT=PRI : HWEC=0 : V=11

Sangoma Card Count: A200=1

[root@localhost ~]#
[root@localhost bin]# wanrouter status

Devices currently active:
        wanpipe1


Wanpipe Config:

Device name | Protocol Map | Adapter  | IRQ | Slot/IO | If's | CLK | Baud rate |
wanpipe1    | N/A          | A200/A400/B600/B700/B800/B610| 169 | 4       | 1    | N/A | 0         |

Wanrouter Status:

Device name | Protocol | Station | Status        |
wanpipe1    | A-ANALOG | N/A     | Connected     |

[root@localhost bin]#

检查配置freetdm.conf文件

这是FreeTDM 配置文件.这里的举例说安装的2FXO/2FXS
编辑:/usr/local/freeSWITCH/conf/freetdm.conf 文件


[span wanpipe FXS]
name => freetdm
trunk_type => fxs
group => grp1
fxs-channel => 1:1
number => 200  // 设置FXS 分机号码
trunk_type => fxs
group => grp1
fxs-channel => 1:2
[span wanpipe FXO]
name => freetdm
trunk_type => fxo
group => grp2
fxo-channel => 1:3

trunk_type => fxo
group => grp2
fxo-channel => 1:4
number =>89700910  // PSTN 模拟线路的号码


编辑freetdm.conf.xml 和tone.conf 文件

autoload_configs/freetdm.conf.xml


<configuration name="freetdm.conf" description="FreeTDM Configuration">
  <settings>
    <param name="debug" value="0"/>
    <param name="hold-music" value="$${moh_uri}"/>
  </settings>
  <!-- one entry here per freetdm span -->
   <analog_spans>
                <span name="FXO">
                        <!--<param name="hold-music" value="$${moh_uri}"/>-->
                        <param name="dialplan" value="XML"/>
                        <param name="context" value="public"/>
                         <!-- regex to stop dialing when it matches -->
                        <!--<param name="dial-regex" value="5555"/>-->
                        <!-- regex to stop dialing when it does not match -->
                        <!--<param name="fail-dial-regex" value="^5"/>-->
                        <param name="tonegroup" value="cn"/>  // 设置中国振铃制式
                       <param name="enable_callerid" value="true"/>
                </span>

                <span name="FXS">
                        <!--<param name="hold-music" value="$${moh_uri}"/>-->
                        <param name="dialplan" value="XML"/>
                        <param name="context" value="default"/>
                         <!-- regex to stop dialing when it matches -->
                        <!--<param name="dial-regex" value="5555"/>-->
                        <!-- regex to stop dialing when it does not match -->
                        <!--<param name="fail-dial-regex" value="^5"/>-->
                </span>

        </analog_spans>

</configuration>

在 /usr/local/freeswitch/conf/tones.conf 文件中添加支持中国忙音,拨号音

[cn]
generate-dial => v=-7;%(1000,0,450)
detect-dial => 450
generate-ring => v=-7;%(1000,4000,460)
detect-ring => 460
generate-busy => v=-7;%(350,350,460)
detect-busy => 460
generate-attn => v=0;%(100,100,1400,2060,2450,2600)
detect-attn => 460
generate-callwaiting-sas => v=0;%(300,0,440)
detect-callwaiting-sas => 460
generate-callwaiting-cas => v=0;%(80,0,2750,2130)
detect-callwaiting-cas => 460
detect-fail1 => 913.8
detect-fail2 => 1370.6
detect-fail3 => 1776.7
在默认的FreeSWITCH 启动模块中添加添加freetdm 模块

编辑文件 vi /usr/local/freeswitch/conf/autoload_configs/modules.conf.xml 删除注释,确认freetdm 模块已经被添加

<load module="mod_freetdm"/>
检查ftdm 模块加载状态

运行 fs_cli 命令,进入到freeSWITCH CLI,显示的是2FXO 和2FXS 状态

freeswitch@internal> ftdm list
freeswitch@localhost.localdomain> ftdm list

+OK
span: 1 (FXS)
type: analog
physical_status: ok
signaling_status: UP
chan_count: 2
dialplan: XML
context: default
dial_regex:
fail_dial_regex:
hold_music:
analog_options: none
+OK
span: 2 (FXO)
type: analog
physical_status: ok
signaling_status: UP
chan_count: 2
dialplan: XML
context: public
dial_regex:
fail_dial_regex:
hold_music:
analog_options: none

// 检查模拟板卡 span 2 上面的端口 2
freeswitch@localhost.localdomain> ftdm dump 2 2

span_id: 2
chan_id: 2
physical_span_id: 1
physical_chan_id: 4
physical_status: ok
physical_status_red: 0
physical_status_yellow: 0
physical_status_rai: 0
physical_status_blue: 0
physical_status_ais: 0
physical_status_general: 0
signaling_status: UP
type: FXO
state: DOWN
last_state: DOWN
txgain: 0.00
rxgain: 0.00
cid_date:
cid_name:
cid_num:
ani:
aniII:
dnis:
rdnis:
cause: NONE
session: (none)


-- States --                   -- Function --                 -- Location --                 -- Time Offset --
RING  => HANGUP                [channel_on_hangup]            [mod_freetdm.c:590]            0ms
HANGUP => DOWN                 [ftdm_analog_channel_run]      [ftmod_analog.c:562]           515ms
DOWN  => DIALING               [analog_fxo_outgoing_call]     [ftmod_analog.c:62]            161968ms
DIALING => UP                  [ftdm_analog_channel_run]      [ftmod_analog.c:509]           7900ms
UP    => HANGUP                [channel_on_hangup]            [
确认freetdm 模块已经加载。

设置呼入路由规则

呼入路由设置

修改拨号规则的配置文件 dialplan/public/00_inbound_did.xml,修改成如下例子,任何从外线呼入的号码转到FXS 端口1。


<include>
  <extension name="public_did">
    <condition field="destination_number" expression="^(.*)$">
      <!--
          If you're hosting multiple domains you will want to set the
          target_domain on these calls so they hit the proper domain after you
          transfer the caller into the default context.

          $${domain} is the default domain set from vars.xml but you can set it
          to any domain you have setup in your user directory.

      -->
      <action application="set" data="domain_name=$${domain}"/>
      <!-- This example maps the DID 5551212 to ring 1000 in the default context -->
      <action application="bridge" data="freetdm/1/1"/>   // 这里是让呼入的来电转到板卡端口 span 1 上面的端口1
    </condition>
  </extension>

</include>
此设置会让一个FXO 线路呼入的电话转接到FXS span 1 的端口1.通过打印信息可以看到呼入来电的具体流程。这里仅显示部分日志信息。 如果用户没有FXS 模块,可以添加一个SIP帐号,让呼入的电话transfer到SIP分机。当然用户必须做相应的呼叫路由添加。

OK console log level set to DEBUG


freeswitch@localhost.localdomain> 2015-01-08 03:26:29.088388 [DEBUG] ftmod_wanpipe.c:1677 [s2c2][1:4] read wanpipe event 7
2015-01-08 03:26:29.088388 [DEBUG] ftmod_analog.c:999 [s2c2][1:4] Received event [RING_START] in state [DOWN]
2015-01-08 03:26:29.088388 [DEBUG] ftmod_analog.c:1027 [s2c2][1:4] Changed state from DOWN to GET_CALLERID
2015-01-08 03:26:29.088388 [DEBUG] ftmod_analog.c:437 [s2c2][1:4] ANALOG CHANNEL thread starting. //启动通道事件线程
2015-01-08 03:26:29.088388 [DEBUG] ftmod_wanpipe.c:749 [s2c2][1:4] Enabled DTMF events  // 开启DTMF 检测事件
2015-01-08 03:26:29.088388 [DEBUG] ftmod_analog.c:457 [s2c2][1:4] Initialized DTMF detection
2015-01-08 03:26:29.088388 [DEBUG] ftmod_analog.c:638 [s2c2][1:4] Completed state change from DOWN to GET_CALLERID in 0 ms
2015-01-08 03:26:29.088388 [DEBUG] ftmod_analog.c:644 [s2c2][1:4] Executing state handler on 2:2 for GET_CALLERID
2015-01-08 03:26:29.088388 [DEBUG] ftmod_analog.c:780 [s2c2][1:4] Initializing cid data!  // 获得来电显示的电话号码数据,然后解析
2015-01-08 03:26:29.108388 [DEBUG] ftmod_wanpipe.c:1002 [s2c2][1:4] First packet read stats: Rx queue len: 0, Rx queue size: 10
2015-01-08 03:26:30.188392 [DEBUG] ftmod_wanpipe.c:1677 [s2c2][1:4] read wanpipe event 19
2015-01-08 03:26:30.188392 [DEBUG] ftmod_wanpipe.c:1566 [s2c2][1:4] Got polarity reverse
2015-01-08 03:26:30.188392 [DEBUG] ftmod_analog.c:999 [s2c2][1:4] Received event [POLARITY_REVERSE] in state [GET_CALLERID]
2015-01-08 03:26:30.188392 [DEBUG] ftmod_analog.c:1139 [s2c2][1:4] Ignoring polarity reversal because this channel is not configured for it
2015-01-08 03:26:30.208389 [DEBUG] ftmod_wanpipe.c:1677 [s2c2][1:4] read wanpipe event 7
2015-01-08 03:26:30.208389 [DEBUG] ftmod_analog.c:999 [s2c2][1:4] Received event [RING_STOP] in state [GET_CALLERID]
2015-01-08 03:26:30.208389 [DEBUG] ftmod_analog.c:1163 [s2c2][1:4] Ignoring event [RING_STOP] in state [GET_CALLERID]
2015-01-08 03:26:31.288389 [DEBUG] ftdm_io.c:4158 FSK: TYPE DATETIME LEN 8 VAL [01010043]  // 获得来电显示的类型 此处是FSK 类型
2015-01-08 03:26:31.288389 [DEBUG] ftdm_io.c:4158 FSK: TYPE PHONE_NUM LEN 11 VAL [18665301040]   // 获得电话号码
2015-01-08 03:26:31.288389 [DEBUG] ftmod_analog.c:495 [s2c2][1:4] Changed state from GET_CALLERID to RING
2015-01-08 03:26:31.308392 [DEBUG] ftmod_analog.c:638 [s2c2][1:4] Completed state change from GET_CALLERID to RING in 20 ms
2015-01-08 03:26:31.308392 [DEBUG] ftmod_analog.c:644 [s2c2][1:4] Executing state handler on 2:2 for RING
2015-01-08 03:26:31.308392 [DEBUG] mod_freetdm.c:2262 got FXO sig 2:2 [START]
2015-01-08 03:26:31.308392 [DEBUG] ftmod_wanpipe.c:749 [s2c2][1:4] Enabled DTMF events
2015-01-08 03:26:31.308392 [DEBUG] mod_freetdm.c:403 Set codec PCMA 20ms
2015-01-08 03:26:31.308392 [DEBUG] mod_freetdm.c:1899 Connect inbound channel FreeTDM/2:2/
2015-01-08 03:26:31.308392 [NOTICE] switch_channel.c:1054 New Channel FreeTDM/2:2/ [158b9e5a-96a3-11e4-9f88-1571e7432ade]
2015-01-08 03:26:31.308392 [DEBUG] mod_freetdm.c:2102 (FreeTDM/2:2/) State Change CS_NEW -> CS_INIT
2015-01-08 03:26:31.308392 [DEBUG] switch_core_session.c:1387 Send signal FreeTDM/2:2/ [BREAK]
2015-01-08 03:26:31.308392 [DEBUG] switch_core_state_machine.c:467 (FreeTDM/2:2/) Running State Change CS_INIT
2015-01-08 03:26:31.328548 [DEBUG] switch_core_state_machine.c:507 (FreeTDM/2:2/) State INIT
2015-01-08 03:26:31.328548 [DEBUG] mod_freetdm.c:430 (FreeTDM/2:2/) State Change CS_INIT -> CS_ROUTING
2015-01-08 03:26:31.328548 [DEBUG] switch_core_session.c:1387 Send signal FreeTDM/2:2/ [BREAK]
2015-01-08 03:26:31.328548 [DEBUG] switch_core_state_machine.c:507 (FreeTDM/2:2/) State INIT going to sleep
2015-01-08 03:26:31.328548 [DEBUG] switch_core_state_machine.c:467 (FreeTDM/2:2/) Running State Change CS_ROUTING



呼出路由设置

修改呼出设置文件 dialplan/default.xml file, 添加一段呼叫规则,使用模拟分机 FXS 1 拨打100 号码,通过span 2 的FXO 2 呼出到测试号码。

  < <extension name="freetdm.example.com">

    <condition field="destination_number" expression="^(100)$">
    <action application="tone_detect" data="busy 450 r 0 hangup 'normal_clearing' 3"/>
    <action application="bridge" data="freetdm/2/2/018665301040"/> // 呼出测试
    </condition>
  </extension>

以上设置可以通过FXS 模拟分机博打100,然后呼出到一个测试的手机号码。当然用户也可以注册一个SIP分机,修改拨号规则做进一步测试。

reeswitch@localhost.localdomain>
freeswitch@localhost.localdomain> 2015-01-08 03:38:44.448393 [DEBUG] ftmod_wanpipe.c:1677 [s1c1][1:1] read wanpipe event 5
2015-01-08 03:38:44.448393 [DEBUG] ftmod_wanpipe.c:1461 [s1c1][1:1] Got wanpipe OFFHOOK // 获得摘机相应事件
2015-01-08 03:38:44.448393 [DEBUG] ftmod_wanpipe.c:1684 [s1c1][1:1] Ignoring event for now
2015-01-08 03:38:44.588387 [DEBUG] ftmod_wanpipe.c:1641 [s1c1][1:1] Diff since last event = 151 ms, delivering OFFHOOK now
2015-01-08 03:38:44.588387 [DEBUG] ftmod_analog.c:999 [s1c1][1:1] Received event [OFFHOOK] in state [DOWN]
-------------------------------------
2015-01-08 03:38:46.028391 [DEBUG] ftmod_analog.c:828 [s1c1][1:1] Changed state from DIALTONE to COLLECT
2015-01-08 03:38:46.028391 [DEBUG] mod_freetdm.c:2372 got FXS sig [COLLECTED_DIGIT]
2015-01-08 03:38:46.028391 [DEBUG] mod_freetdm.c:2542 got DTMF sig [1]
2015-01-08 03:38:46.048393 [DEBUG] ftmod_analog.c:638 [s1c1][1:1] Completed state change from DIALTONE to COLLECT in 20 ms
2015-01-08 03:38:46.048393 [DEBUG] ftmod_analog.c:644 [s1c1][1:1] Executing state handler on 1:1 for COLLECT
2015-01-08 03:38:46.628392 [DEBUG] ftmod_wanpipe.c:1677 [s1c1][1:1] read wanpipe event 3
2015-01-08 03:38:46.688392 [DEBUG] ftmod_wanpipe.c:1677 [s1c1][1:1] read wanpipe event 3
2015-01-08 03:38:46.688392 [DEBUG] ftmod_wanpipe.c:1546 [s1c1][1:1] Queuing wanpipe DTMF: 0
2015-01-08 03:38:46.688392 [DEBUG] ftdm_io.c:3778 [s1c1][1:1] Queuing DTMF 0 (debug = 0)
2015-01-08 03:38:46.688392 [DEBUG] mod_freetdm.c:2372 got FXS sig [COLLECTED_DIGIT]
2015-01-08 03:38:46.688392 [DEBUG] mod_freetdm.c:2542 got DTMF sig [10]
2015-01-08 03:38:46.848392 [DEBUG] ftmod_wanpipe.c:1677 [s1c1][1:1] read wanpipe event 3
2015-01-08 03:38:46.928391 [DEBUG] ftmod_wanpipe.c:1677 [s1c1][1:1] read wanpipe event 3
2015-01-08 03:38:46.928391 [DEBUG] ftmod_wanpipe.c:1546 [s1c1][1:1] Queuing wanpipe DTMF: 0
2015-01-08 03:38:46.928391 [DEBUG] ftdm_io.c:3778 [s1c1][1:1] Queuing DTMF 0 (debug = 0)
2015-01-08 03:38:46.928391 [DEBUG] mod_freetdm.c:2372 got FXS sig [COLLECTED_DIGIT]
2015-01-08 03:38:46.928391 [DEBUG] mod_freetdm.c:2542 got DTMF sig [100]
2015-01-08 03:38:48.948392 [DEBUG] ftmod_analog.c:849 [s1c1][1:1] Number obtained [100]
2015-01-08 03:38:48.948392 [DEBUG] ftmod_analog.c:850 [s1c1][1:1] Changed state from COLLECT to RING
2015-01-08 03:38:48.968392 [DEBUG] ftmod_analog.c:638 [s1c1][1:1] Completed state change from COLLECT to RING in 19 ms
----------------------
<0000000000>->100 in context default
Dialplan: FreeTDM/1:1/100 parsing [default->freetdm.example.com] continue=false
Dialplan: FreeTDM/1:1/100 Regex (PASS) [freetdm.example.com] destination_number(100) =~ /^(100)$/ break=on-false
Dialplan: FreeTDM/1:1/100 Action tone_detect(busy 450 r 0 hangup 'normal_clearing' 3)
Dialplan: FreeTDM/1:1/100 Action bridge(freetdm/2/2/018665301040) // 通过FXO 端口2 呼出
2015-01-08 03:38:48.968392 [DEBUG] switch_core_state_machine.c:214 (FreeTDM/1:1/100) State Change CS_ROUTING -> CS_EXECUTE








常见问题排查

1)板卡启动以后,模块的灯会自动显示不同的颜色:FXO 为红色,FXS 为绿色。方便辨认。
2)如何检测模拟板卡的摘挂机状态(onhook/offhook)和电压变化:wanpipemon -i w1g1 -c astats -m 1 // -i 代表接口,-c 代表 执行的命令,-m 代表 接口通道。这里检测到是接口1的通道1.这里显示的是我们板卡上的两个FXS(1,2)和两个FXO(3,4)的状态情况。

没有电话互相接听时代每个端口(1,2,3,4)的电压状态
[root@localhost ~]# wanpipemon -i w1g1 -c astats -m 1

        ------- Voltage Status  (FXS,port 0) -------

TIP     : - 5.6400 Volts
RING    : -54.5200 Volts
VBAT    : -63.5440 Volts

[root@localhost ~]# wanpipemon -i w1g1 -c astats -m 2

        ------- Voltage Status  (FXS,port 1) -------

TIP     : - 6.0160 Volts
RING    : -54.1440 Volts
VBAT    : -63.5440 Volts


[root@localhost ~]# wanpipemon -i w1g1 -c astats -m 3

        ------- Voltage Status  (FXO,port 2) -------

VOLTAGE : 1 Volts

        ------- Line Status  (FXO,port 2) -------

Line    : disconnected
// 没有接电话线


[root@localhost ~]# wanpipemon -i w1g1 -c astats -m 4

        ------- Voltage Status  (FXO,port 3) -------

VOLTAGE : 47 Volts

        ------- Line Status  (FXO,port 3) -------

Line    : connected
// 已经接连电话线
开始通话的状态,注意 端口1 和端口4,现在端口1(FXS)接听了端口4(FXO)的通话

[root@localhost ~]# wanpipemon -i w1g1 -c astats -m 4

        ------- Voltage Status  (FXO,port 3) -------

VOLTAGE : 5 Volts  // 电压已经发生了变化

        ------- Line Status  (FXO,port 3) -------

Line    : connected



[root@localhost ~]# wanpipemon -i w1g1 -c astats -m 1

        ------- Voltage Status  (FXS,port 0) -------

TIP     : - 5.2640 Volts
RING    : -13.9120 Volts   
VBAT    : -22.9360 Volts


[root@localhost ~]# wanpipemon -i w1g1 -c astats -m 2

        ------- Voltage Status  (FXS,port 1) -------

TIP     : - 6.0160 Volts
RING    : -54.1440 Volts
VBAT    : -63.5440 Volts


[root@localhost ~]# wanpipemon -i w1g1 -c astats -m 3

        ------- Voltage Status  (FXO,port 2) -------

VOLTAGE : 0 Volts

        ------- Line Status  (FXO,port 2) -------

Line    : disconnected

3)如何检测硬件回声芯片的打印信息
wan_ec_client wanpipe1 stats_full 4
[root@localhost ~]# wan_ec_client wanpipe1 stats_full 4


wanpipe1: Running Get stats command to Echo Canceller device... Done!

  wanpipe1: 4: Echo Channel Operation Mode                      : NORMAL
  wanpipe1: 4: Enable Tone Disabler                                     : TRUE
  wanpipe1: 4: Mute Ports                                       : NONE
  wanpipe1: 4: Enable Extended Tone Detection                           : FALSE
  wanpipe1: 4: Current Echo Return Loss                         : Invalid
  wanpipe1: 4: Current Echo Return Loss Enhancement             : Invalid
  wanpipe1: 4: Maximum value of the ERL                         : Invalid
  wanpipe1: 4: Maximum value of the ERLE                        : Invalid
  wanpipe1: 4: Number of Echo Path changes                      : 2
  wanpipe1: 4: Current Echo Delay                               : Invalid
  wanpipe1: 4: Maximum Echo Delay                               : Invalid
  wanpipe1: 4: Tone Disabler Status                             : Enabled
  wanpipe1: 4: Voice activity is detected on SIN port           : FALSE
  wanpipe1: 4: Echo canceller has detected and converged        : FALSE
  wanpipe1: 4: Average power of signal level on RIN             : -57 dBm0
  wanpipe1: 4: Average power of signal level on SIN             : -66 dBm0
  wanpipe1: 4: Current gain applied to signal level on RIN      : 0 dB
  wanpipe1: 4: Current gain applied to signal level on SOUT     : 0 dB
  wanpipe1: 4: Average power of the comfort noise injected      : -66 dBm0
  wanpipe1: 4: (TDM) PCM Law type on SIN                        : ALAW
  wanpipe1: 4: (TDM) TDM timeslot on SIN port                   : 1
  wanpipe1: 4: (TDM) TDM stream on SIN port                     : 6
  wanpipe1: 4: (TDM) PCM Law type on RIN                        : ALAW
  wanpipe1: 4: (TDM) TDM timeslot on RIN port                   : 1
  wanpipe1: 4: (TDM) TDM stream on RIN port                     : 4
  wanpipe1: 4: (TDM) PCM Law type on SOUT                       : ALAW
  wanpipe1: 4: (TDM) TDM timeslot on SOUT port                  : 1
  wanpipe1: 4: (TDM) TDM stream on SOUT port                    : 7
  wanpipe1: 4: (TDM) PCM Law type on ROUT                       : ALAW
  wanpipe1: 4: (TDM) TDM timeslot on ROUT port                  : 1
  wanpipe1: 4: (TDM) TDM stream on ROUT port                    : 5
  wanpipe1: 4: (VQE) NLP status                                 : TRUE
  wanpipe1: 4: (VQE) Enable Tail Displacement                   : FALSE
  wanpipe1: 4: (VQE) Offset of the Echo Cancellation window (ms)        : 0
  wanpipe1: 4: (VQE) Maximum tail length                        : 128 ms
  wanpipe1: 4: (VQE) Rin Level control mode                     : TRUE
  wanpipe1: 4: (VQE) Rin Control Signal gain                    : 0 dB
  wanpipe1: 4: (VQE) Sout Level control mode                    : TRUE
  wanpipe1: 4: (VQE) Sout Control Signal gain                   : 0 dB
  wanpipe1: 4: (VQE) RIN Automatic Level Control                : FALSE
  wanpipe1: 4: (VQE) RIN Target Level Control                   : -20 dBm0
  wanpipe1: 4: (VQE) SOUT Automatic Level Control               : FALSE
  wanpipe1: 4: (VQE) SOUT Target Level Control                  : -20 dBm0
  wanpipe1: 4: (VQE) Comfort noise mode                         : NORMAL
  wanpipe1: 4: (VQE) Remove any DTMF tone detection on SIN port : FALSE
  wanpipe1: 4: (VQE) Acoustic Echo                              : FALSE
  wanpipe1: 4: (VQE) Non Linearity Behavior A                   : 1
  wanpipe1: 4: (VQE) Non Linearity Behavior B                   : 0
  wanpipe1: 4: (VQE) Double Talk algorithm                      : NORMAL
  wanpipe1: 4: (VQE) Default ERL (not converged)                : -6 dB
  wanpipe1: 4: (VQE) Acoustic Echo Cancellation default ERL     : 0 dB
  wanpipe1: 4: (VQE) Maximum Acoustic Echo tail length          : 128 ms
  wanpipe1: 4: (VQE) Attenuation Level applied to the noise signal      : -18 dB
  wanpipe1: 4: (VQE) Silence period before the re-activation of VQE features    : 1836 ms
  wanpipe1: 4: (CODEC) Encoder channel port                     : SOUT
  wanpipe1: 4: (CODEC) Encoder rate                             : G.711 64 kBps
  wanpipe1: 4: (CODEC) Decoder channel port                     : RIN
  wanpipe1: 4: (CODEC) Decoder rate                             : G.711 64 kBps




[root@localhost ~]# wan_ec_client wanpipe1 stats


wanpipe1: Running Get stats command to Echo Canceller device... Done!

****** Echo Canceller Chip Get Stats wanpipe1 ******
  wanpipe1: Number of channels currently open                   4
  wanpipe1: Number of conference bridges currently open         0
  wanpipe1: Number of playout buffers currently loaded          0
  wanpipe1: Number of framing error on H.100 bus                0
  wanpipe1: Number of errors on H.100 clock CT_C8_A             0
  wanpipe1: Number of errors on H.100 frame CT_FRAME_A          0
  wanpipe1: Number of errors on H.100 clock CT_C8_B             0
  wanpipe1: Number of internal read timeout errors              0
  wanpipe1: Number of SDRAM refresh too late errors             0
  wanpipe1: Number of PLL jitter errors                         0
  wanpipe1: Number of HW tone event buffer has overflowed       0
  wanpipe1: Number of SW tone event buffer has overflowed       0
  wanpipe1: Number of SW Playout event buffer has overflowed    0

4) 如何关闭一个通道的回声抑制功能,开启回声抑制功能。如果用户不确定这些命令的使用结果,请不要进行以下操作。

wan_ec_client wanpipe1 mpd 1  // mpd 代表 Mode Power Down
wan_ec_client wanpipe1 mn 1  // mn 代表 Mode Normal 模式
wan_ec_client wanpipe1 msr 1 // msr 代表 Mode Speech Recognition 模式
5)查看模块的具体外观:http://wiki.sangoma.com/A200-2-P ... e-Analog-Voice-Card
cnasterisk 发表于 2015-1-12 10:07 | 显示全部楼层
好麻烦,不喜欢freeswitch。
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

关闭

站长推荐上一条 /1 下一条

手机版|VoIP88 ( 粤ICP备11095982号   填写您的邮件地址,订阅我们的精彩内容:

GMT+8, 2017-9-22 18:04 , Processed in 0.323661 second(s), 22 queries .

Powered by VoIP88

© 2001-2017 VoIP88

快速回复 返回顶部 返回列表