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

VoIP88

toasterisk 发表于 2012-5-14 14:30 | 显示全部楼层 |阅读模式
如何安装在freeswitch 平台上安装sangoma B601DE 数字模拟混合卡
freeswitch 是市场上非常受欢迎的开源软交换平台,freeswitch 支持强大的IPPBX 功能,对并发呼叫的处理更是相当有优势。asterisk 很多用户也考虑在freewitch 上做开发。sangoma 语音产品本身官方支持 freeswitch 驱动接口 freetdm,freeswitch 也逐渐抛弃了oenzap 接口。freetdm 接口同样支持丰富的接入功能,例如 PRI,ss7, FXO, FXS. 今天主要介绍sangoma B601DE 在freeswitch 上的安装步骤,希望freeswitch 用户更加了解sangoma 产品的优越性。



下面是sangoma wanpiple 和 freeswitch 的安装步骤:
1) 安装 sangoma 硬件驱动:
wget ftp://ftp.sangoma.com/linux/current_wanpipe/wanpipe-current.tgz// 下载源代码tar xfz wanpipe-current.tgz  // 减压压缩包
cd wanpipe-.tgz    // 到指定路径make freetdm   // 编译 freetdm, 不是 makemake install  // 安装 wanrouter hwprobe  // 检测硬件下载pri 协议包,不是 dahdi libpri
减压压缩包:
#>tar xfz libsng_isdn-current..tgz
Install the library
#>cd libsng_isdn-.
#>make install    // 直接安装
2)安装 freeswitch Download FreeSWITCH by using one of the following methods: 两种办法下载 freeswitch
  •      -> Download the latest Git trunk:
             # git clone git://git.freeswitch.org/freeswitch.git
         -> Download the latest nightly snapshot:   //
    # wget http://files.freeswitch.org/freeswitch-snapshot.tar.gz
    Prepare the build system using "bootstrap.sh"  // 减压压缩包
  • # ./bootstrap.sh  // 执行脚本命令
  • 添加 mod_freetdm 软件包在 modules.conf, 以便freeswitch 支持 sangoma freetdm
    注释掉lib/freetm/mod_freetdm" in modules.conf
  • Configure the build system using "configure"
    # ./configure // 执行 配置命令
    默认安装路径是 /usr/local/freeswitch
  • 执行make 命令编译 "make"
    # make
  • 执行makeinstall 命令
    # make install

3)配置freeswitch 和 sangoma wanpiple 语音板卡
/usr/sbin/wancfg_fs 路径下:

[root@pbx sbin]# wancfg_fs  // 配置语音板卡和生成freetdm 的配置文件

########################################################################
#                          Sangoma Wanpipe                             #
#        Dahdi/Zaptel/SMG/TDMAPI/BOOT Configuration Script             #
#                             v2.39                                  #
#                     Sangoma Technologies Inc.                        #
#                        Copyright(c) 2009.                            #
########################################################################
Would you like to change FreeSWITCH Configuration Directory?
Default: /usr/local/freeswitch/conf
1. NO
2. YES
[1-2, ENTER='NO']:   // 默认安装。摁 ENTER 键
---------------------------------------------
Configuring T1/E1 cards [A101/A102/A104/A108]
---------------------------------------------
-----------------------------------------------------------
Configuring port 2 on A601 slot:4 bus:9.
-----------------------------------------------------------
Select media type for AFT-A601 on port 2 [slot:4 bus:9 span:1]
1. T1
2. E1  // 选择 E1
3. Unused
4. Exit
[1-4]:2

Configuring port 2 on 601 as E1, line coding:HDB3, framing:CRC4
1. YES - Keep these settings
2. NO  - Configure line coding and framing  // 是否修改 帧格式 和CRC, 如果需要NCRC,  选择 NO
[1-2, ENTER='YES']:2

Select line coding for port 2 on 601
1. HDB3  // 选择 HDB3
2. AMI
[1-2, ENTER='HDB3']:1

Select framing for port 2 on 601
1. CRC4
2. NCRC4  // 无校验,如果运营商支持的话,要 选择 1
3. UNFRAMED
[1-3, ENTER='CRC4']:2

Select clock for AFT-B601 on port 2 [slot:4 bus:9 span:1]
1. NORMAL  // 正常
2. MASTER
[1-2]:
Select Switchtype for AFT-B601 on port 2 [slot:4 bus:9 span:1]
1. EuroISDN/ETSI  // 中国选择
2. QSIG
[1-2]:1

Select signalling type for AFT-B601 on port 2 [slot:4 bus:9 span:1]
1. PRI CPE  // 运营商都是 NET, 所以 选择 CPE, 如果对端是CPE,  选择 2
2. PRI NET
[1-2]:1

Select dialplan context for AFT-B601 on port 2
1. default // 默认的,进入 default.xml
2. public
3. Custom
[1-3]:1

Input the dialing group for this port
: 1

Would you like to enable hardware DTMF detection? // 是否启用 dtmf 检测,如果dtmf 发生错误,需要打开。
1. YES
2. NO
[1-2, ENTER='YES']:1

Would you like to enable hardware fax detection?  // 启用传真检测
1. YES
2. NO
[1-2, ENTER='NO']:1
Port 2 on AFT-A601 configuration complete...
Press any key to continue:
-----------------------------------------------------------
A601 detected on slot:4 bus:9
-----------------------------------------------------------

Would you like to configure AFT-B601 on slot:4 bus:9
1. YES
2. NO
[1-2]:1

Will this AFT-A601 synchronize with an existing Sangoma T1/E1 card?

WARNING: for hardware and firmware requirements, check:
          http://wiki.sangoma.com/t1e1analogfaxing
1. NO
2. YES
[1-2]:2

Would you like to enable hardware DTMF detection?
1. YES
2. NO
[1-2, ENTER='YES']:1

Would you like to enable hardware fax detection?
1. YES
2. NO
[1-2, ENTER='YES']:1

Which codec will be used?  // 注意,因为是混合卡,检测 编码
1. MULAW - North America
2. ALAW - Europe
[1-2]:1

Which Operation Mode will be used? // 选择FCC, 中国格式,需要 重新修改wanpiple 配置文件到 CHINA 模式
1. FCC
2. TBR21
3. AUSTRALIA
[1-3, ENTER='FCC']:1

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

  2 T1/E1 port(s) detected, 1 configured  // 检测到了E1
  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  // 生成wanpiple 配置文件
        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-2012-05-13.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 configuration complete: choose action
1. Save cfg: Stop Wanpipe now
2. Do not save cfg: Exit
[1-2]:1  // 选择1
Stopping Wanpipe...
Removing old configuration files...
opying 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 5
Wanrouter boot scripts configuration...
Removing existing wanrouter boot scripts...OK
Would you like wanrouter to start on system boot? // 支持系统服务,系统启动时,sangoma 驱动自动启动
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@pbx sbin]#

=====freetdm.conf===========  
[span wanpipe wp1]
trunk_type => e1
group=1
b-channel => 1:1-15  // 配置通道 1-15,语音通道
b-channel => 1:17-31 // 语音通道
d-channel => 1:16  // 数据通道,信令控制
[span wanpipe FXS]
name => freetdm
trunk_type => fxs
group => grp1
fxs-channel => 2:5  // 第二个span 的第 4 个模块
[span wanpipe FXO]
name => freetdm
trunk_type => fxo
group => grp2
fxo-channel => 2:1
trunk_type => fxo
group => grp2
fxo-channel => 2:2
trunk_type => fxo
group => grp2
fxo-channel => 2:3
trunk_type => fxo
group => grp2
fxo-channel => 2:4

4) 启动 freeswitch, 进入后台,确认可以看到
启动 FW: freeswitch -nc
freetdm 模块命令:
检测sangoma 硬件pri 和通道状态命令:
ftdm list
ftdm start|stop
ftdm restart []
ftdm dump []
ftdm sigstatus get|set [] [] []
ftdm trace []
ftdm notrace []
ftdm q931_pcap on|off [pcapfilename without suffix]
ftdm gains []
ftdm dtmf on|off []
ftdm queuesize []
--------------------------------------------------------------------------------
,FreeTDM commands,mod_freetdm

freeswitch@internal> ftdm sangoma_isdn show_spans // 检测端口状态
span:wp1 physical:OK signalling:UP  // 确认up
freeswitch@internal> ftmtdm list   // 模块,每个通道的状态:包括 pri, 模拟口
+OK
span: 1 (wp1)
type: Sangoma (ISDN)
physical_status: ok
signaling_status: UP
chan_count: 31
dialplan: XML
context: default
dial_regex:
fail_dial_regex:
hold_music:
analog_options: none
+OK
span: 2 (FXS)
type: analog
physical_status: ok
signaling_status: UP
chan_count: 1
dialplan: XML
context: default
dial_regex:
fail_dial_regex:
hold_music:
analog_options: none
+OK
span: 3 (FXO)
type: analog
physical_status: ok
signaling_status: UP
chan_count: 4
dialplan: XML
context: public
dial_regex:
fail_dial_regex:
hold_music:
analog_options: none
2012-05-13 21:24:06.910268 [DEBUG] ftmod_wanpipe.c:1269 [s1c1][1:1] Link status is 1
freeswitch@internal> ftdm sangoma_isdn trace q921 wp1 // 检测 q921 状态, 如果921 状态没有起来,必须检查物理状态
Command executed OK
2012-05-13 21:26:54.430316 [INFO] ftmod_sangoma_isdn_stack_cntrl.c:251 s1 Enabling q921 trace
freeswitch@internal> 2012-05-13 21:27:02.330327 [INFO] ftmod_sangoma_isdn_trace.c:117 [SNGISDN Q921] wp1 FRAME OUTGOING:  format: Supervisory
  sapi: 000  c/r: 0  ea: 0
   tei: 000          ea: 1
  n(r): 000  p/f: 1
   cmd: RR - receive ready
5)确认通道正常以后,你可以配置呼出呼入路由来测试通话。
测试呼出的拨号规则:
  • 通过指定的端口呼出:
    "freetdm//a/"
  • 通过指定的组呼出:
    "freetdm//a/"
      通过分机拨333 到一个测试号码1866530XXXX.

<extension name="outgoing">
        <condition field="destination_number" expression="^(333)$">
            <action application="bridge" data="freetdm/wp1/a/ 1866530XXXX "/>  
        condition>
extension>

  <extension name="sipuas">
      <condition field="destination_number" expression="^1*">
          <action application="bridge" data="sofia/external/1111@localhost:5062"/>
      condition>
    extension>

<extension name="playback">
      <condition field="destination_number" expression="^2*">
        <action application="answer"/>
        <action application="playback" data="tone_stream://path=${base_dir}/conf/tetris.ttml;loops=10"/>
      condition>
    extension>





cnasterisk 发表于 2012-5-15 10:32 | 显示全部楼层
硬货啊。
james.zhu 发表于 2012-5-16 10:53 | 显示全部楼层
经典的freeswitch, freetdm pri sangoma B601 数字模拟混合卡例子。
owen 发表于 2012-5-17 08:53 | 显示全部楼层
{:soso_e179:}顶一个
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

关闭

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

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

GMT+8, 2017-10-21 05:45 , Processed in 0.261974 second(s), 26 queries .

Powered by VoIP88

© 2001-2017 VoIP88

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