Linux/FreeSwitch/FreeTDM/Sangoma安装

来自VoIP88 Wiki
跳转到: 导航, 搜索

目录

介绍

本文章介绍如何在FreeSWITCH linux 环境下安装配置Sangoma A200/A400。本例中使用了A400的2FXO 板卡,可以拓展到24 口。 现在我们介绍如何安装Sangoma wanpile 驱动,FreeTDM,FreeSWITCH,并且介绍如何配置相关的文件,和如何做简单的呼叫路由规则。

准备工作

下载安装Sangoma 板卡驱动 wanpipe

安装板卡之前使用系统命令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
2015-01-08 03:26:31.328548 [DEBUG] switch_channel.c:2178 (FreeTDM/2:2/) Callstate Change DOWN -> RINGING
2015-01-08 03:26:31.328548 [DEBUG] switch_core_state_machine.c:523 (FreeTDM/2:2/) State ROUTING
2015-01-08 03:26:31.328548 [DEBUG] mod_freetdm.c:453 FreeTDM/2:2/ CHANNEL ROUTING
2015-01-08 03:26:31.328548 [DEBUG] mod_freetdm.c:456 [s2c2][1:4] Indicating PROCEED in state RING
2015-01-08 03:26:31.328548 [DEBUG] switch_core_state_machine.c:164 FreeTDM/2:2/ Standard ROUTING
2015-01-08 03:26:31.328548 [INFO] mod_dialplan_xml.c:558 Processing unknown <18665301040>-> in context public
Dialplan: FreeTDM/2:2/ parsing [public->unloop] continue=false
Dialplan: FreeTDM/2:2/ Regex (PASS) [unloop] ${unroll_loops}(true) =~ /^true$/ break=on-false
Dialplan: FreeTDM/2:2/ Regex (FAIL) [unloop] ${sip_looped_call}() =~ /^true$/ break=on-false
Dialplan: FreeTDM/2:2/ parsing [public->outside_call] continue=true
Dialplan: FreeTDM/2:2/ Absolute Condition [outside_call]
Dialplan: FreeTDM/2:2/ Action set(outside_call=true) 
Dialplan: FreeTDM/2:2/ Action export(RFC2822_DATE=${strftime(%a, %d %b %Y %T %z)}) 
Dialplan: FreeTDM/2:2/ parsing [public->call_debug] continue=true
Dialplan: FreeTDM/2:2/ Regex (FAIL) [call_debug] ${call_debug}(false) =~ /^true$/ break=never
Dialplan: FreeTDM/2:2/ parsing [public->public_extensions] continue=false
Dialplan: FreeTDM/2:2/ Regex (FAIL) [public_extensions] destination_number() =~ /^(10[01][0-9])$/ break=on-false
Dialplan: FreeTDM/2:2/ parsing [public->public_did] continue=false
Dialplan: FreeTDM/2:2/ Regex (PASS) [public_did] destination_number() =~ /^(.*)$/ break=on-false
Dialplan: FreeTDM/2:2/ Action set(domain_name=192.168.1.221) 
Dialplan: FreeTDM/2:2/ Action bridge(freetdm/1/1)  // 匹配到呼入的流程,转接到第一个FXS 口
2015-01-08 03:26:31.328548 [DEBUG] switch_core_state_machine.c:214 (FreeTDM/2:2/) State Change CS_ROUTING -> CS_EXECUTE
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:523 (FreeTDM/2:2/) State ROUTING going to sleep
2015-01-08 03:26:31.328548 [DEBUG] switch_core_state_machine.c:467 (FreeTDM/2:2/) Running State Change CS_EXECUTE
2015-01-08 03:26:31.328548 [DEBUG] switch_core_state_machine.c:530 (FreeTDM/2:2/) State EXECUTE
2015-01-08 03:26:31.328548 [DEBUG] mod_freetdm.c:473 FreeTDM/2:2/ CHANNEL EXECUTE
2015-01-08 03:26:31.328548 [DEBUG] switch_core_state_machine.c:256 FreeTDM/2:2/ Standard EXECUTE
EXECUTE FreeTDM/2:2/ set(outside_call=true)
2015-01-08 03:26:31.328548 [DEBUG] mod_dptools.c:1435 FreeTDM/2:2/ SET [outside_call]=[true]
EXECUTE FreeTDM/2:2/ export(RFC2822_DATE=Thu, 08 Jan 2015 03:26:31 +0800)
2015-01-08 03:26:31.328548 [DEBUG] switch_channel.c:1246 EXPORT (export_vars) [RFC2822_DATE]=[Thu, 08 Jan 2015 03:26:31 +0800]
EXECUTE FreeTDM/2:2/ set(domain_name=192.168.1.221)
2015-01-08 03:26:31.328548 [DEBUG] mod_dptools.c:1435 FreeTDM/2:2/ SET [domain_name]=[192.168.1.221]
EXECUTE FreeTDM/2:2/ bridge(freetdm/1/1)
2015-01-08 03:26:31.328548 [DEBUG] switch_channel.c:1200 FreeTDM/2:2/ EXPORTING[export_vars] [RFC2822_DATE]=[Thu, 08 Jan 2015 03:26:31 +0800] to event
2015-01-08 03:26:31.328548 [DEBUG] switch_ivr_originate.c:2078 Parsing global variables
2015-01-08 03:26:31.328548 [DEBUG] mod_freetdm.c:403 Set codec PCMA 20ms
2015-01-08 03:26:31.328548 [DEBUG] mod_freetdm.c:1251 Connect outbound channel FreeTDM/1:1/
2015-01-08 03:26:31.328548 [NOTICE] switch_channel.c:1054 New Channel FreeTDM/1:1/ [158ccb54-96a3-11e4-9f90-1571e7432ade]
2015-01-08 03:26:31.328548 [DEBUG] mod_freetdm.c:1260 (FreeTDM/1:1/) State Change CS_NEW -> CS_INIT
2015-01-08 03:26:31.328548 [DEBUG] switch_core_session.c:1387 Send signal FreeTDM/1:1/ [BREAK]
2015-01-08 03:26:31.328548 [DEBUG] mod_freetdm.c:1279 Attached session 158ccb54-96a3-11e4-9f90-1571e7432ade to channel 1:1
2015-01-08 03:26:31.328548 [DEBUG] ftmod_analog.c:83 [s1c1][1:1] Changed state from DOWN to GENRING
2015-01-08 03:26:31.328548 [DEBUG] ftmod_analog.c:437 [s1c1][1:1] ANALOG CHANNEL thread starting.
2015-01-08 03:26:31.328548 [DEBUG] ftmod_wanpipe.c:749 [s1c1][1:1] Enabled DTMF events
2015-01-08 03:26:31.328548 [DEBUG] ftmod_analog.c:457 [s1c1][1:1] Initialized DTMF detection
2015-01-08 03:26:31.328548 [DEBUG] ftmod_analog.c:638 [s1c1][1:1] Completed state change from DOWN to GENRING in 0 ms
2015-01-08 03:26:31.328548 [DEBUG] ftmod_analog.c:644 [s1c1][1:1] Executing state handler on 1:1 for GENRING
2015-01-08 03:26:31.328548 [DEBUG] mod_freetdm.c:2372 got FXS sig [PROGRESS]
2015-01-08 03:26:31.328548 [NOTICE] mod_freetdm.c:2389 Ring-Ready FreeTDM/1:1/!
2015-01-08 03:26:31.328548 [DEBUG] switch_channel.c:3271 (FreeTDM/1:1/) Callstate Change DOWN -> RINGING
2015-01-08 03:26:31.348387 [DEBUG] ftmod_wanpipe.c:1002 [s1c1][1:1] First packet read stats: Rx queue len: 0, Rx queue size: 10
2015-01-08 03:26:31.828393 [DEBUG] switch_core_state_machine.c:467 (FreeTDM/1:1/) Running State Change CS_INIT
2015-01-08 03:26:31.828393 [DEBUG] switch_core_state_machine.c:507 (FreeTDM/1:1/) State INIT
2015-01-08 03:26:31.828393 [DEBUG] mod_freetdm.c:430 (FreeTDM/1:1/) State Change CS_INIT -> CS_ROUTING
2015-01-08 03:26:31.828393 [DEBUG] switch_core_session.c:1387 Send signal FreeTDM/1:1/ [BREAK]
2015-01-08 03:26:31.828393 [DEBUG] switch_core_state_machine.c:507 (FreeTDM/1:1/) State INIT going to sleep
2015-01-08 03:26:31.828393 [DEBUG] switch_core_state_machine.c:467 (FreeTDM/1:1/) Running State Change CS_ROUTING
2015-01-08 03:26:31.828393 [DEBUG] switch_core_state_machine.c:523 (FreeTDM/1:1/) State ROUTING
2015-01-08 03:26:31.828393 [DEBUG] mod_freetdm.c:453 FreeTDM/1:1/ CHANNEL ROUTING
2015-01-08 03:26:31.828393 [DEBUG] switch_ivr_originate.c:67 (FreeTDM/1:1/) State Change CS_ROUTING -> CS_CONSUME_MEDIA
2015-01-08 03:26:31.828393 [DEBUG] switch_core_session.c:1387 Send signal FreeTDM/1:1/ [BREAK]
2015-01-08 03:26:31.828393 [DEBUG] switch_core_state_machine.c:523 (FreeTDM/1:1/) State ROUTING going to sleep
2015-01-08 03:26:31.828393 [DEBUG] switch_core_state_machine.c:467 (FreeTDM/1:1/) Running State Change CS_CONSUME_MEDIA
2015-01-08 03:26:31.828393 [DEBUG] switch_core_state_machine.c:542 (FreeTDM/1:1/) State CONSUME_MEDIA
2015-01-08 03:26:31.828393 [DEBUG] switch_core_state_machine.c:542 (FreeTDM/1:1/) State CONSUME_MEDIA going to sleep
2015-01-08 03:26:31.828393 [DEBUG] switch_core_session.c:907 Send signal FreeTDM/2:2/ [BREAK]
2015-01-08 03:26:31.828393 [NOTICE] switch_ivr_originate.c:527 Ring Ready FreeTDM/2:2/!
2015-01-08 03:26:31.828393 [NOTICE] switch_ivr_originate.c:527 Ring-Ready FreeTDM/2:2/!
2015-01-08 03:26:34.108389 [DEBUG] ftmod_wanpipe.c:1677 [s2c2][1:4] read wanpipe event 7
2015-01-08 03:26:34.108389 [DEBUG] ftmod_analog.c:999 [s2c2][1:4] Received event [RING_START] in state [RING]
2015-01-08 03:26:34.828393 [DEBUG] ftmod_wanpipe.c:938 [s1c1][1:1] First packet write stats: Tx queue len: 1, Tx queue size: 5, Tx idle: 3500
2015-01-08 03:26:35.228392 [DEBUG] ftmod_wanpipe.c:1677 [s2c2][1:4] read wanpipe event 7
2015-01-08 03:26:35.228392 [DEBUG] ftmod_analog.c:999 [s2c2][1:4] Received event [RING_STOP] in state [RING]
2015-01-08 03:26:35.228392 [DEBUG] ftmod_analog.c:1163 [s2c2][1:4] Ignoring event [RING_STOP] in state [RING]
2015-01-08 03:26:39.068389 [DEBUG] ftmod_wanpipe.c:1677 [s2c2][1:4] read wanpipe event 7
2015-01-08 03:26:39.068389 [DEBUG] ftmod_analog.c:999 [s2c2][1:4] Received event [RING_START] in state [RING]
2015-01-08 03:26:40.228407 [DEBUG] ftmod_wanpipe.c:1677 [s2c2][1:4] read wanpipe event 7
2015-01-08 03:26:40.228407 [DEBUG] ftmod_analog.c:999 [s2c2][1:4] Received event [RING_STOP] in state [RING]
2015-01-08 03:26:40.228407 [DEBUG] ftmod_analog.c:1163 [s2c2][1:4] Ignoring event [RING_STOP] in state [RING]
2015-01-08 03:26:44.068392 [DEBUG] ftmod_wanpipe.c:1677 [s2c2][1:4] read wanpipe event 7
2015-01-08 03:26:44.068392 [DEBUG] ftmod_analog.c:999 [s2c2][1:4] Received event [RING_START] in state [RING]
2015-01-08 03:26:45.208392 [DEBUG] ftmod_wanpipe.c:1677 [s2c2][1:4] read wanpipe event 7
2015-01-08 03:26:45.208392 [DEBUG] ftmod_analog.c:999 [s2c2][1:4] Received event [RING_STOP] in state [RING]
2015-01-08 03:26:45.208392 [DEBUG] ftmod_analog.c:1163 [s2c2][1:4] Ignoring event [RING_STOP] in state [RING]
2015-01-08 03:26:47.328392 [DEBUG] ftmod_wanpipe.c:1677 [s1c1][1:1] read wanpipe event 5
2015-01-08 03:26:47.328392 [DEBUG] ftmod_wanpipe.c:1461 [s1c1][1:1] Got wanpipe OFFHOOK
2015-01-08 03:26:47.328392 [DEBUG] ftmod_wanpipe.c:1684 [s1c1][1:1] Ignoring event for now
2015-01-08 03:26:47.468392 [DEBUG] ftmod_wanpipe.c:1641 [s1c1][1:1] Diff since last event = 151 ms, delivering OFFHOOK now
2015-01-08 03:26:47.468392 [DEBUG] ftmod_analog.c:999 [s1c1][1:1] Received event [OFFHOOK] in state [GENRING]
2015-01-08 03:26:47.468392 [DEBUG] ftmod_analog.c:1087 [s1c1][1:1] Changed state from GENRING to UP
2015-01-08 03:26:47.488390 [DEBUG] ftmod_analog.c:638 [s1c1][1:1] Completed state change from GENRING to UP in 8 ms
2015-01-08 03:26:47.488390 [DEBUG] ftmod_analog.c:644 [s1c1][1:1] Executing state handler on 1:1 for UP
2015-01-08 03:26:47.488390 [DEBUG] mod_freetdm.c:2372 got FXS sig [UP]
2015-01-08 03:26:47.488390 [DEBUG] switch_channel.c:3629 Send signal FreeTDM/2:2/ [BREAK]
2015-01-08 03:26:47.488390 [NOTICE] mod_freetdm.c:2379 Channel [FreeTDM/1:1/] has been answered  // 对FXO 2 呼入的通话应答
2015-01-08 03:26:47.488390 [DEBUG] switch_channel.c:3683 (FreeTDM/1:1/) Callstate Change RINGING -> ACTIVE
2015-01-08 03:26:47.488390 [DEBUG] ftmod_wanpipe.c:749 [s1c1][1:1] Enabled DTMF events
2015-01-08 03:26:47.488390 [DEBUG] mod_freetdm.c:1053 [s2c2][1:4] Indicating ANSWER in state RING
2015-01-08 03:26:47.488390 [DEBUG] mod_freetdm.c:1053 [s2c2][1:4] Changed state from RING to PROGRESS
2015-01-08 03:26:47.488390 [DEBUG] ftmod_analog.c:638 [s2c2][1:4] Completed state change from RING to PROGRESS in 9 ms
2015-01-08 03:26:47.488390 [DEBUG] ftmod_analog.c:644 [s2c2][1:4] Executing state handler on 2:2 for PROGRESS
2015-01-08 03:26:47.488390 [DEBUG] ftmod_wanpipe.c:982 [s2c2][1:4] Rx Queue length exceeded 80% threshold (9/10)
2015-01-08 03:26:47.488390 [DEBUG] mod_freetdm.c:1053 [s2c2][1:4] Changed state from PROGRESS to PROGRESS_MEDIA
2015-01-08 03:26:47.488390 [DEBUG] ftmod_wanpipe.c:982 [s2c2][1:4] Rx Queue length exceeded 80% threshold (8/10)
2015-01-08 03:26:47.488390 [DEBUG] ftmod_analog.c:638 [s2c2][1:4] Completed state change from PROGRESS to PROGRESS_MEDIA in 0 ms

设置呼出路由规则

呼出路由设置

修改呼出设置文件 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:44.588387 [DEBUG] ftmod_analog.c:1092 [s1c1][1:1] Changed state from DOWN to DIALTONE
2015-01-08 03:38:44.588387 [DEBUG] ftmod_analog.c:437 [s1c1][1:1] ANALOG CHANNEL thread starting.
2015-01-08 03:38:44.588387 [DEBUG] ftmod_wanpipe.c:749 [s1c1][1:1] Enabled DTMF events
2015-01-08 03:38:44.588387 [DEBUG] ftmod_analog.c:457 [s1c1][1:1] Initialized DTMF detection
2015-01-08 03:38:44.588387 [DEBUG] ftmod_analog.c:638 [s1c1][1:1] Completed state change from DOWN to DIALTONE in 0 ms
2015-01-08 03:38:44.588387 [DEBUG] ftmod_analog.c:644 [s1c1][1:1] Executing state handler on 1:1 for DIALTONE
2015-01-08 03:38:44.608387 [DEBUG] ftmod_wanpipe.c:1002 [s1c1][1:1] First packet read stats: Rx queue len: 0, Rx queue size: 10
2015-01-08 03:38:44.608387 [DEBUG] ftmod_wanpipe.c:938 [s1c1][1:1] First packet write stats: Tx queue len: 1, Tx queue size: 5, Tx idle: 20
2015-01-08 03:38:45.928392 [DEBUG] ftmod_wanpipe.c:1677 [s1c1][1:1] read wanpipe event 3
2015-01-08 03:38:46.008394 [DEBUG] ftmod_wanpipe.c:1677 [s1c1][1:1] read wanpipe event 3
2015-01-08 03:38:46.008394 [DEBUG] ftmod_wanpipe.c:1546 [s1c1][1:1] Queuing wanpipe DTMF: 1
2015-01-08 03:38:46.008394 [DEBUG] ftdm_io.c:3778 [s1c1][1:1] Queuing DTMF 1 (debug = 0)
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
2015-01-08 03:38:48.968392 [DEBUG] ftmod_analog.c:644 [s1c1][1:1] Executing state handler on 1:1 for RING
2015-01-08 03:38:48.968392 [DEBUG] mod_freetdm.c:2372 got FXS sig [START]
2015-01-08 03:38:48.968392 [DEBUG] ftmod_wanpipe.c:749 [s1c1][1:1] Enabled DTMF events
2015-01-08 03:38:48.968392 [DEBUG] mod_freetdm.c:403 Set codec PCMA 20ms
2015-01-08 03:38:48.968392 [DEBUG] mod_freetdm.c:1899 Connect inbound channel FreeTDM/1:1/100
2015-01-08 03:38:48.968392 [NOTICE] switch_channel.c:1054 New Channel FreeTDM/1:1/100 [cd39358e-96a4-11e4-9f95-1571e7432ade]
2015-01-08 03:38:48.968392 [DEBUG] mod_freetdm.c:2102 (FreeTDM/1:1/100) State Change CS_NEW -> CS_INIT
2015-01-08 03:38:48.968392 [DEBUG] switch_core_session.c:1387 Send signal FreeTDM/1:1/100 [BREAK]
2015-01-08 03:38:48.968392 [DEBUG] switch_core_state_machine.c:467 (FreeTDM/1:1/100) Running State Change CS_INIT
2015-01-08 03:38:48.968392 [DEBUG] switch_core_state_machine.c:507 (FreeTDM/1:1/100) State INIT
2015-01-08 03:38:48.968392 [DEBUG] mod_freetdm.c:430 (FreeTDM/1:1/100) State Change CS_INIT -> CS_ROUTING
2015-01-08 03:38:48.968392 [DEBUG] switch_core_session.c:1387 Send signal FreeTDM/1:1/100 [BREAK]
2015-01-08 03:38:48.968392 [DEBUG] switch_core_state_machine.c:507 (FreeTDM/1:1/100) State INIT going to sleep
2015-01-08 03:38:48.968392 [DEBUG] switch_core_state_machine.c:467 (FreeTDM/1:1/100) Running State Change CS_ROUTING
2015-01-08 03:38:48.968392 [DEBUG] switch_channel.c:2178 (FreeTDM/1:1/100) Callstate Change DOWN -> RINGING
2015-01-08 03:38:48.968392 [DEBUG] switch_core_state_machine.c:523 (FreeTDM/1:1/100) State ROUTING
2015-01-08 03:38:48.968392 [DEBUG] mod_freetdm.c:453 FreeTDM/1:1/100 CHANNEL ROUTING
2015-01-08 03:38:48.968392 [DEBUG] mod_freetdm.c:456 [s1c1][1:1] Indicating PROCEED in state RING
2015-01-08 03:38:48.968392 [DEBUG] switch_core_state_machine.c:164 FreeTDM/1:1/100 Standard ROUTING
2015-01-08 03:38:48.968392 [INFO] mod_dialplan_xml.c:558 Processing freetdm <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
2015-01-08 03:38:48.968392 [DEBUG] switch_core_session.c:1387 Send signal FreeTDM/1:1/100 [BREAK]
2015-01-08 03:38:48.968392 [DEBUG] switch_core_state_machine.c:523 (FreeTDM/1:1/100) State ROUTING going to sleep
2015-01-08 03:38:48.968392 [DEBUG] switch_core_state_machine.c:467 (FreeTDM/1:1/100) Running State Change CS_EXECUTE
2015-01-08 03:38:48.968392 [DEBUG] switch_core_state_machine.c:530 (FreeTDM/1:1/100) State EXECUTE
2015-01-08 03:38:48.968392 [DEBUG] mod_freetdm.c:473 FreeTDM/1:1/100 CHANNEL EXECUTE
2015-01-08 03:38:48.968392 [DEBUG] switch_core_state_machine.c:256 FreeTDM/1:1/100 Standard EXECUTE
2015-01-08 03:38:48.968392 [DEBUG] switch_core_session.c:2712 Application tone_detect Requires media! pre_answering channel FreeTDM/1:1/100
2015-01-08 03:38:48.968392 [DEBUG] mod_freetdm.c:1085 [s1c1][1:1] Indicating ANSWER in state RING
2015-01-08 03:38:48.968392 [DEBUG] mod_freetdm.c:1085 [s1c1][1:1] Changed state from RING to PROGRESS
2015-01-08 03:38:48.988462 [DEBUG] ftmod_analog.c:638 [s1c1][1:1] Completed state change from RING to PROGRESS in 20 ms
2015-01-08 03:38:48.988462 [DEBUG] ftmod_analog.c:644 [s1c1][1:1] Executing state handler on 1:1 for PROGRESS
2015-01-08 03:38:48.988462 [DEBUG] mod_freetdm.c:1085 [s1c1][1:1] Changed state from PROGRESS to PROGRESS_MEDIA
2015-01-08 03:38:49.008391 [DEBUG] ftmod_analog.c:638 [s1c1][1:1] Completed state change from PROGRESS to PROGRESS_MEDIA in 19 ms
2015-01-08 03:38:49.008391 [DEBUG] ftmod_analog.c:644 [s1c1][1:1] Executing state handler on 1:1 for PROGRESS_MEDIA
2015-01-08 03:38:49.008391 [DEBUG] mod_freetdm.c:1085 [s1c1][1:1] Changed state from PROGRESS_MEDIA to UP
2015-01-08 03:38:49.028394 [DEBUG] ftmod_analog.c:638 [s1c1][1:1] Completed state change from PROGRESS_MEDIA to UP in 20 ms
2015-01-08 03:38:49.028394 [DEBUG] ftmod_analog.c:644 [s1c1][1:1] Executing state handler on 1:1 for UP
2015-01-08 03:38:49.028394 [DEBUG] mod_freetdm.c:2372 got FXS sig [UP]
2015-01-08 03:38:49.028394 [NOTICE] mod_freetdm.c:2379 Channel [FreeTDM/1:1/100] has been answered
2015-01-08 03:38:49.028394 [DEBUG] switch_channel.c:3683 (FreeTDM/1:1/100) Callstate Change RINGING -> ACTIVE
2015-01-08 03:38:49.028394 [DEBUG] ftmod_wanpipe.c:749 [s1c1][1:1] Enabled DTMF events
2015-01-08 03:38:49.028394 [DEBUG] switch_core_session.c:907 Send signal FreeTDM/1:1/100 [BREAK]
EXECUTE FreeTDM/1:1/100 tone_detect(busy 450 r 0 hangup 'normal_clearing' 3)
2015-01-08 03:38:49.028394 [NOTICE] mod_dptools.c:2070 Enabling tone detection 'busy' '450'
2015-01-08 03:38:49.028394 [DEBUG] switch_ivr_async.c:3226 Adding tone spec 450 index 0 hits 3
2015-01-08 03:38:49.048392 [DEBUG] switch_core_media_bug.c:532 Attaching BUG to FreeTDM/1:1/100
EXECUTE FreeTDM/1:1/100 bridge(freetdm/2/2/018665301040)
2015-01-08 03:38:49.048392 [DEBUG] switch_channel.c:1767 (FreeTDM/1:1/100) Callstate Change ACTIVE -> RING_WAIT
2015-01-08 03:38:49.048392 [DEBUG] switch_ivr_originate.c:2078 Parsing global variables
2015-01-08 03:38:49.048392 [DEBUG] mod_freetdm.c:403 Set codec PCMA 20ms
2015-01-08 03:38:49.048392 [DEBUG] mod_freetdm.c:1251 Connect outbound channel FreeTDM/2:2/018665301040
2015-01-08 03:38:49.048392 [NOTICE] switch_channel.c:1054 New Channel FreeTDM/2:2/018665301040 [cd44a34c-96a4-11e4-9f9b-1571e7432ade]
2015-01-08 03:38:49.048392 [DEBUG] mod_freetdm.c:1260 (FreeTDM/2:2/018665301040) State Change CS_NEW -> CS_INIT
2015-01-08 03:38:49.048392 [DEBUG] switch_core_session.c:1387 Send signal FreeTDM/2:2/018665301040 [BREAK]
2015-01-08 03:38:49.048392 [DEBUG] mod_freetdm.c:1279 Attached session cd44a34c-96a4-11e4-9f9b-1571e7432ade to channel 2:2
2015-01-08 03:38:49.048392 [DEBUG] ftmod_analog.c:62 [s2c2][1:4] Changed state from DOWN to DIALING
2015-01-08 03:38:49.048392 [DEBUG] ftmod_analog.c:437 [s2c2][1:4] ANALOG CHANNEL thread starting.
2015-01-08 03:38:49.048392 [DEBUG] ftmod_wanpipe.c:749 [s2c2][1:4] Enabled DTMF events
2015-01-08 03:38:49.048392 [DEBUG] ftmod_analog.c:457 [s2c2][1:4] Initialized DTMF detection
2015-01-08 03:38:49.048392 [DEBUG] ftmod_analog.c:638 [s2c2][1:4] Completed state change from DOWN to DIALING in 0 ms
2015-01-08 03:38:49.048392 [DEBUG] ftmod_analog.c:644 [s2c2][1:4] Executing state handler on 2:2 for DIALING
2015-01-08 03:38:49.068389 [DEBUG] ftmod_wanpipe.c:1002 [s2c2][1:4] First packet read stats: Rx queue len: 0, Rx queue size: 10
2015-01-08 03:38:49.548394 [DEBUG] switch_core_state_machine.c:467 (FreeTDM/2:2/018665301040) Running State Change CS_INIT
2015-01-08 03:38:49.548394 [DEBUG] switch_core_state_machine.c:507 (FreeTDM/2:2/018665301040) State INIT
2015-01-08 03:38:49.548394 [DEBUG] mod_freetdm.c:430 (FreeTDM/2:2/018665301040) State Change CS_INIT -> CS_ROUTING
2015-01-08 03:38:49.548394 [DEBUG] switch_core_session.c:1387 Send signal FreeTDM/2:2/018665301040 [BREAK]
2015-01-08 03:38:49.548394 [DEBUG] switch_core_state_machine.c:507 (FreeTDM/2:2/018665301040) State INIT going to sleep
2015-01-08 03:38:49.548394 [DEBUG] switch_core_state_machine.c:467 (FreeTDM/2:2/018665301040) Running State Change CS_ROUTING
2015-01-08 03:38:49.548394 [DEBUG] switch_core_state_machine.c:523 (FreeTDM/2:2/018665301040) State ROUTING
2015-01-08 03:38:49.548394 [DEBUG] mod_freetdm.c:453 FreeTDM/2:2/018665301040 CHANNEL ROUTING
2015-01-08 03:38:49.548394 [DEBUG] switch_ivr_originate.c:67 (FreeTDM/2:2/018665301040) State Change CS_ROUTING -> CS_CONSUME_MEDIA
2015-01-08 03:38:49.548394 [DEBUG] switch_core_session.c:1387 Send signal FreeTDM/2:2/018665301040 [BREAK]
2015-01-08 03:38:49.548394 [DEBUG] switch_core_state_machine.c:523 (FreeTDM/2:2/018665301040) State ROUTING going to sleep
2015-01-08 03:38:49.548394 [DEBUG] switch_core_state_machine.c:467 (FreeTDM/2:2/018665301040) Running State Change CS_CONSUME_MEDIA
2015-01-08 03:38:49.548394 [DEBUG] switch_core_state_machine.c:542 (FreeTDM/2:2/018665301040) State CONSUME_MEDIA
2015-01-08 03:38:49.548394 [DEBUG] switch_core_state_machine.c:542 (FreeTDM/2:2/018665301040) State CONSUME_MEDIA going to sleep
2015-01-08 03:38:49.568392 [DEBUG] ftmod_wanpipe.c:982 [s1c1][1:1] Rx Queue length exceeded 80% threshold (9/10)
2015-01-08 03:38:49.568392 [DEBUG] switch_core_io.c:526 Setting BUG Codec PCMA:8
2015-01-08 03:38:49.568392 [DEBUG] ftmod_wanpipe.c:982 [s1c1][1:1] Rx Queue length exceeded 80% threshold (8/10)
2015-01-08 03:38:49.568392 [DEBUG] ftmod_wanpipe.c:986 [s1c1][1:1] Rx Queue length reduced 80% threshold (7/10)
2015-01-08 03:38:49.768393 [DEBUG] ftmod_analog.c:873 [s2c2][1:4] Detected tone DIAL on 2:2
2015-01-08 03:38:49.768393 [DEBUG] ftdm_io.c:3033 [s2c2][1:4] Created DTMF buffer
2015-01-08 03:38:49.788393 [DEBUG] ftdm_io.c:3974 [s2c2][1:4] Generating DTMF [018665301040]
2015-01-08 03:38:49.788393 [DEBUG] ftmod_wanpipe.c:938 [s2c2][1:4] First packet write stats: Tx queue len: 1, Tx queue size: 5, Tx idle: 740
2015-01-08 03:38:55.368396 [DEBUG] ftmod_analog.c:509 [s2c2][1:4] Changed state from DIALING to UP
2015-01-08 03:38:55.388395 [DEBUG] ftmod_analog.c:638 [s2c2][1:4] Completed state change from DIALING to UP in 21 ms
2015-01-08 03:38:55.388395 [DEBUG] ftmod_analog.c:644 [s2c2][1:4] Executing state handler on 2:2 for UP
2015-01-08 03:38:55.388395 [DEBUG] mod_freetdm.c:2262 got FXO sig 2:2 [UP]
2015-01-08 03:38:55.388395 [DEBUG] switch_channel.c:3629 Send signal FreeTDM/1:1/100 [BREAK]
2015-01-08 03:38:55.388395 [NOTICE] mod_freetdm.c:2292 Channel [FreeTDM/2:2/018665301040] has been answered
2015-01-08 03:38:55.388395 [DEBUG] switch_channel.c:3683 (FreeTDM/2:2/018665301040) Callstate Change DOWN -> ACTIVE
2015-01-08 03:38:55.388395 [DEBUG] ftmod_wanpipe.c:749 [s2c2][1:4] Enabled DTMF events
2015-01-08 03:38:55.388395 [DEBUG] switch_ivr_originate.c:3551 Originate Resulted in Success: [FreeTDM/2:2/018665301040]
2015-01-08 03:38:55.388395 [DEBUG] switch_channel.c:1977 (FreeTDM/1:1/100) Callstate Change RING_WAIT -> ACTIVE
2015-01-08 03:38:55.388395 [DEBUG] switch_core_session.c:907 Send signal FreeTDM/2:2/018665301040 [BREAK]
2015-01-08 03:38:55.388395 [DEBUG] switch_core_session.c:907 Send signal FreeTDM/1:1/100 [BREAK]
2015-01-08 03:38:55.388395 [DEBUG] switch_ivr_bridge.c:1460 (FreeTDM/2:2/018665301040) State Change CS_CONSUME_MEDIA -> CS_EXCHANGE_MEDIA
2015-01-08 03:38:55.388395 [DEBUG] switch_core_session.c:1387 Send signal FreeTDM/2:2/018665301040 [BREAK]
2015-01-08 03:38:55.388395 [DEBUG] switch_core_state_machine.c:467 (FreeTDM/2:2/018665301040) Running State Change CS_EXCHANGE_MEDIA
2015-01-08 03:38:55.388395 [DEBUG] switch_core_state_machine.c:533 (FreeTDM/2:2/018665301040) State EXCHANGE_MEDIA
2015-01-08 03:38:55.388395 [DEBUG] mod_freetdm.c:675 CHANNEL EXCHANGE_MEDIA
2015-01-08 03:38:55.388395 [DEBUG] switch_core_session.c:969 Send signal FreeTDM/2:2/018665301040 [BREAK]
2015-01-08 03:38:55.388395 [DEBUG] switch_core_session.c:969 Send signal FreeTDM/1:1/100 [BREAK]
2015-01-08 03:39:04.368392 [DEBUG] ftmod_wanpipe.c:1677 [s2c2][1:4] read wanpipe event 19
2015-01-08 03:39:04.368392 [DEBUG] ftmod_wanpipe.c:1566 [s2c2][1:4] Got polarity reverse
2015-01-08 03:39:04.368392 [DEBUG] ftmod_analog.c:999 [s2c2][1:4] Received event [POLARITY_REVERSE] in state [UP]
2015-01-08 03:39:04.368392 [DEBUG] ftmod_analog.c:1139 [s2c2][1:4] Ignoring polarity reversal because this channel is not configured for it
2015-01-08 03:39:08.708395 [DEBUG] ftmod_wanpipe.c:1677 [s2c2][1:4] read wanpipe event 19
2015-01-08 03:39:08.708395 [DEBUG] ftmod_wanpipe.c:1566 [s2c2][1:4] Got polarity reverse
2015-01-08 03:39:08.708395 [DEBUG] ftmod_analog.c:999 [s2c2][1:4] Received event [POLARITY_REVERSE] in state [UP]
2015-01-08 03:39:08.708395 [DEBUG] ftmod_analog.c:1139 [s2c2][1:4] Ignoring polarity reversal because this channel is not configured for it
2015-01-08 03:39:09.688391 [DEBUG] ftmod_wanpipe.c:1677 [s1c1][1:1] read wanpipe event 5
2015-01-08 03:39:09.688391 [DEBUG] ftmod_wanpipe.c:1461 [s1c1][1:1] Got wanpipe ONHOOK
2015-01-08 03:39:09.688391 [DEBUG] ftmod_wanpipe.c:1684 [s1c1][1:1] Ignoring event for now
2015-01-08 03:39:10.448394 [DEBUG] ftmod_wanpipe.c:1660 [s1c1][1:1] Diff since last event = 752 ms, delivering ONHOOK now
2015-01-08 03:39:10.448394 [DEBUG] ftmod_analog.c:999 [s1c1][1:1] Received event [ONHOOK] in state [UP]
2015-01-08 03:39:10.448394 [DEBUG] ftmod_analog.c:1052 [s1c1][1:1] Changed state from UP to DOWN
2015-01-08 03:39:10.448394 [DEBUG] ftmod_analog.c:638 [s1c1][1:1] Completed state change from UP to DOWN in 4 ms
2015-01-08 03:39:10.448394 [DEBUG] ftmod_analog.c:644 [s1c1][1:1] Executing state handler on 1:1 for DOWN
2015-01-08 03:39:10.448394 [DEBUG] mod_freetdm.c:2372 got FXS sig [STOP]
2015-01-08 03:39:10.448394 [NOTICE] mod_freetdm.c:2464 Hangup FreeTDM/1:1/100 [CS_EXECUTE] [NORMAL_CLEARING]
2015-01-08 03:39:10.448394 [DEBUG] switch_channel.c:3216 Send signal FreeTDM/1:1/100 [KILL]
2015-01-08 03:39:10.448394 [DEBUG] switch_core_session.c:1387 Send signal FreeTDM/1:1/100 [BREAK]
2015-01-08 03:39:10.448394 [DEBUG] ftdm_io.c:3180 [s1c1][1:1] DTMF debug is already disabled
2015-01-08 03:39:10.448394 [DEBUG] ftdm_io.c:3212 [s1c1][1:1] No need to disable input dump
2015-01-08 03:39:10.448394 [DEBUG] ftdm_io.c:3243 [s1c1][1:1] No need to disable output dump
2015-01-08 03:39:10.448394 [DEBUG] ftdm_io.c:6800 Cleared call with id 3
2015-01-08 03:39:10.448394 [DEBUG] ftdm_io.c:2985 [s1c1][1:1] channel done
2015-01-08 03:39:10.448394 [DEBUG] ftmod_analog.c:972 [s1c1][1:1] ANALOG CHANNEL 1:1 thread ended.
2015-01-08 03:39:10.448394 [DEBUG] switch_ivr_bridge.c:578 FreeTDM/1:1/100 ending bridge by request from write function
2015-01-08 03:39:10.448394 [DEBUG] switch_ivr_bridge.c:659 BRIDGE THREAD DONE [FreeTDM/2:2/018665301040]
2015-01-08 03:39:10.448394 [DEBUG] switch_ivr_bridge.c:689 Send signal FreeTDM/1:1/100 [BREAK]
2015-01-08 03:39:10.448394 [NOTICE] switch_ivr_bridge.c:753 Hangup FreeTDM/2:2/018665301040 [CS_EXCHANGE_MEDIA] [NORMAL_CLEARING]
2015-01-08 03:39:10.448394 [DEBUG] switch_channel.c:3216 Send signal FreeTDM/2:2/018665301040 [KILL]
2015-01-08 03:39:10.448394 [DEBUG] switch_core_session.c:1387 Send signal FreeTDM/2:2/018665301040 [BREAK]
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:533 (FreeTDM/2:2/018665301040) State EXCHANGE_MEDIA going to sleep
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:467 (FreeTDM/2:2/018665301040) Running State Change CS_HANGUP
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:730 (FreeTDM/2:2/018665301040) Callstate Change ACTIVE -> HANGUP
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:732 (FreeTDM/2:2/018665301040) State HANGUP
2015-01-08 03:39:10.448394 [DEBUG] mod_freetdm.c:544 [2:2] FreeTDM/2:2/018665301040 CHANNEL HANGUP ENTER
2015-01-08 03:39:10.448394 [DEBUG] mod_freetdm.c:590 [s2c2][1:4] Changed state from UP to HANGUP
2015-01-08 03:39:10.448394 [WARNING] ftdm_io.c:4286 [s1c1][1:1] cannot read from channel that is not open
2015-01-08 03:39:10.448394 [DEBUG] mod_freetdm.c:796 Failed to read from dead channel FreeTDM/1:1/100 device 1:1
2015-01-08 03:39:10.448394 [DEBUG] switch_ivr_bridge.c:584 FreeTDM/1:1/100 ending bridge by request from read function
2015-01-08 03:39:10.448394 [DEBUG] switch_ivr_bridge.c:659 BRIDGE THREAD DONE [FreeTDM/1:1/100]
2015-01-08 03:39:10.448394 [DEBUG] switch_ivr_bridge.c:689 Send signal FreeTDM/2:2/018665301040 [BREAK]
2015-01-08 03:39:10.448394 [DEBUG] switch_ivr_bridge.c:1558 FreeTDM/2:2/018665301040 skip receive message [UNBRIDGE] (channel is hungup already)
2015-01-08 03:39:10.448394 [DEBUG] switch_ivr_bridge.c:1561 FreeTDM/1:1/100 skip receive message [UNBRIDGE] (channel is hungup already)
2015-01-08 03:39:10.448394 [DEBUG] switch_core_session.c:2875 FreeTDM/1:1/100 skip receive message [APPLICATION_EXEC_COMPLETE] (channel is hungup already)
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:530 (FreeTDM/1:1/100) State EXECUTE going to sleep
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:467 (FreeTDM/1:1/100) Running State Change CS_HANGUP
2015-01-08 03:39:10.448394 [DEBUG] switch_core_media_bug.c:780 Removing BUG from FreeTDM/1:1/100
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:730 (FreeTDM/1:1/100) Callstate Change ACTIVE -> HANGUP
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:732 (FreeTDM/1:1/100) State HANGUP
2015-01-08 03:39:10.448394 [DEBUG] mod_freetdm.c:544 [1:1] FreeTDM/1:1/100 CHANNEL HANGUP ENTER
2015-01-08 03:39:10.448394 [DEBUG] mod_freetdm.c:569 Device [1:1] is no longer attached to FreeTDM/1:1/100. Nothing to do.
2015-01-08 03:39:10.448394 [DEBUG] mod_freetdm.c:643 [1:1] FreeTDM/1:1/100 CHANNEL HANGUP EXIT
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:58 FreeTDM/1:1/100 Standard HANGUP, cause: NORMAL_CLEARING
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:732 (FreeTDM/1:1/100) State HANGUP going to sleep
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:499 (FreeTDM/1:1/100) State Change CS_HANGUP -> CS_REPORTING
2015-01-08 03:39:10.448394 [DEBUG] switch_core_session.c:1387 Send signal FreeTDM/1:1/100 [BREAK]
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:467 (FreeTDM/1:1/100) Running State Change CS_REPORTING
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:818 (FreeTDM/1:1/100) State REPORTING
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:102 FreeTDM/1:1/100 Standard REPORTING, cause: NORMAL_CLEARING
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:818 (FreeTDM/1:1/100) State REPORTING going to sleep
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:493 (FreeTDM/1:1/100) State Change CS_REPORTING -> CS_DESTROY
2015-01-08 03:39:10.448394 [DEBUG] switch_core_session.c:1387 Send signal FreeTDM/1:1/100 [BREAK]
2015-01-08 03:39:10.448394 [DEBUG] switch_core_session.c:1614 Session 3 (FreeTDM/1:1/100) Locked, Waiting on external entities
2015-01-08 03:39:10.448394 [NOTICE] switch_core_session.c:1632 Session 3 (FreeTDM/1:1/100) Ended
2015-01-08 03:39:10.448394 [NOTICE] switch_core_session.c:1636 Close Channel FreeTDM/1:1/100 [CS_DESTROY]
2015-01-08 03:39:10.448394 [DEBUG] ftdm_io.c:490 [s2c2][1:4] Enabling ec back on call end in channel state HANGUP
2015-01-08 03:39:10.448394 [DEBUG] ftmod_analog.c:638 [s2c2][1:4] Completed state change from UP to HANGUP in 2 ms
2015-01-08 03:39:10.448394 [DEBUG] ftmod_analog.c:644 [s2c2][1:4] Executing state handler on 2:2 for HANGUP
2015-01-08 03:39:10.448394 [DEBUG] mod_freetdm.c:643 [2:2] FreeTDM/2:2/018665301040 CHANNEL HANGUP EXIT
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:58 FreeTDM/2:2/018665301040 Standard HANGUP, cause: NORMAL_CLEARING
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:732 (FreeTDM/2:2/018665301040) State HANGUP going to sleep
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:499 (FreeTDM/2:2/018665301040) State Change CS_HANGUP -> CS_REPORTING
2015-01-08 03:39:10.448394 [DEBUG] switch_core_session.c:1387 Send signal FreeTDM/2:2/018665301040 [BREAK]
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:467 (FreeTDM/2:2/018665301040) Running State Change CS_REPORTING
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:618 (FreeTDM/1:1/100) Callstate Change HANGUP -> DOWN
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:818 (FreeTDM/2:2/018665301040) State REPORTING
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:102 FreeTDM/2:2/018665301040 Standard REPORTING, cause: NORMAL_CLEARING
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:621 (FreeTDM/1:1/100) Running State Change CS_DESTROY
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:818 (FreeTDM/2:2/018665301040) State REPORTING going to sleep
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:631 (FreeTDM/1:1/100) State DESTROY
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:109 FreeTDM/1:1/100 Standard DESTROY
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:631 (FreeTDM/1:1/100) State DESTROY going to sleep
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:493 (FreeTDM/2:2/018665301040) State Change CS_REPORTING -> CS_DESTROY
2015-01-08 03:39:10.448394 [DEBUG] switch_core_session.c:1387 Send signal FreeTDM/2:2/018665301040 [BREAK]
2015-01-08 03:39:10.448394 [DEBUG] switch_core_session.c:1614 Session 4 (FreeTDM/2:2/018665301040) Locked, Waiting on external entities
2015-01-08 03:39:10.448394 [NOTICE] switch_core_session.c:1632 Session 4 (FreeTDM/2:2/018665301040) Ended
2015-01-08 03:39:10.448394 [NOTICE] switch_core_session.c:1636 Close Channel FreeTDM/2:2/018665301040 [CS_DESTROY]
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:618 (FreeTDM/2:2/018665301040) Callstate Change HANGUP -> DOWN
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:621 (FreeTDM/2:2/018665301040) Running State Change CS_DESTROY
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:631 (FreeTDM/2:2/018665301040) State DESTROY
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:109 FreeTDM/2:2/018665301040 Standard DESTROY
2015-01-08 03:39:10.448394 [DEBUG] switch_core_state_machine.c:631 (FreeTDM/2:2/018665301040) State DESTROY going to sleep
2015-01-08 03:39:10.968392 [DEBUG] ftmod_analog.c:562 [s2c2][1:4] Changed state from HANGUP to DOWN
2015-01-08 03:39:10.988392 [DEBUG] ftmod_analog.c:638 [s2c2][1:4] Completed state change from HANGUP to DOWN in 21 ms
2015-01-08 03:39:10.988392 [DEBUG] ftmod_analog.c:644 [s2c2][1:4] Executing state handler on 2:2 for DOWN
2015-01-08 03:39:10.988392 [DEBUG] ftdm_io.c:6169 [s2c2][1:4] Ignoring SIGEVENT_STOP since user already requested hangup
2015-01-08 03:39:10.988392 [DEBUG] ftmod_analog.c:945 [s2c2][1:4] Going onhook
2015-01-08 03:39:10.988392 [DEBUG] ftdm_io.c:3180 [s2c2][1:4] DTMF debug is already disabled
2015-01-08 03:39:10.988392 [DEBUG] ftdm_io.c:3212 [s2c2][1:4] No need to disable input dump
2015-01-08 03:39:10.988392 [DEBUG] ftdm_io.c:3243 [s2c2][1:4] No need to disable output dump
2015-01-08 03:39:10.988392 [DEBUG] ftdm_io.c:6800 Cleared call with id 4
2015-01-08 03:39:10.988392 [DEBUG] ftdm_io.c:2985 [s2c2][1:4] channel done
2015-01-08 03:39:10.988392 [DEBUG] ftmod_analog.c:972 [s2c2][1:4] ANALOG CHANNEL 2:2 thread ended.

常见问题排查

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-Port-24-Port-Expandable-Analog-Voice-Card

个人工具
    ͨƼ
产品链接