BL420D + Freeswitch-1.0.6

Bluenet 发布于 2010/12/14 15:29
阅读 1K+
收藏 0

BL420D + Freeswitch-1.0.6

操作环境:
===========================
OS:CentOS 5.4
Kernel: 2.6.18-194.el5
Libpri: libpri-1.4.11.4
Zaptel: zaptel-1.4.12.1
Bluenet: bluenet-linux-0.2.0
Freeswitch: freeswitch-1.0.6
BL420D
===========================

1) 安装支持包
subversion; autoconf; automake; libtool; gcc-c++; ncurses-devel; make; expat-devel; zlib ;zlib-devel;

2)编译libpri
[root@bogon ~]# cd /usr/src
[root@bogon src]# tar –xvzf libpri-1.4.11.4.tar.gz
[root@bogon src]# cd libpri-1.4.11.4
[root@bogon libpri-1.4.11.4]# make
[root@bogon libpri-1.4.11.4]# make install

3)编译zaptel
[root@bogon libpri-1.4.11.4]# cd ..
[root@bogon src]# tar -zxvf zaptel-1.4.12.1.tar.gz
[root@bogon src]# cd zaptel-1.4.2
[root@bogon zaptel-1.4.2]# ./configure
[root@bogon zaptel-1.4.2]# make
[root@bogon zaptel-1.4.2]# make install
[root@bogon zaptel-1.4.2]# make config

4)编译bluenet-linux-0.2.0
[root@bogon zaptel-1.4.2]# cd ..
[root@bogon src]# tar -xvjf bluenet-linux-0.2.0.tar.bz2
[root@bogon src]# cd bluenet-linux-0.2.0
[root@bogon bluenet-linux-0.2.0]# ./configure --with-zaptel=/usr/src/zaptel-1.4.12.1
[root@bogon bluenet-linux-0.2.0]# make
[root@bogon bluenet-linux-0.2.0]# make install

5)编译freeswitch
[root@bogon ~]# wget http://files.freeswitch.org/freeswitch-1.0.6.tar.gz
[root@bogon ~]# tar xvfz freeswitch-1.0.6.tar.gz
[root@bogon ~]# cd freeswitch-1.0.6
[root@bogon freeswitch-1.0.6]# vi modules.conf
    58       #endpoints/mod_skypopen
    59   #endpoints/mod_h323
   60       # ../../libs/openzap/mod_openzap   ---去掉此行的的“#”
    61   #asr_tts/mod_unimrcp
[root@bogon freeswitch-1.0.6]#   ./configure
[root@bogon freeswitch-1.0.6]# cd libs/openzap
[root@bogon openzap]# cd libs/openzap
[root@bogon openzap]# ./configure –with-libpri
[root@bogon openzap]# make
[root@bogon openzap]# make mod_openzap-install
[root@bogon openzap]# cd ../..
[root@bogon freeswitch-1.0.6]#   make
[root@bogon freeswitch-1.0.6]#   make install
[root@bogon freeswitch-1.0.6]# vi /usr/local/freeswitch/conf/autoload_configs/modules.conf.xml
    36     <!-- <load module="mod_woomera"/> -->
   37     <!-- <load module="mod_openzap"/> --> ---去掉此行的的注释
    38     <!-- <load module="mod_unicall"/> -->

6)加载驱动
[root@bogon ~]# service zaptel stop
[root@bogon ~]# modprobe zaptel
[root@bogon ~]# modprobe t4xxp
[root@bogon ~]# genzaptelconf –vv
[root@bogon ~]# ztcfg -vvv
[root@bogon dialplan]# ztcfg -vvv
Zaptel Version: 1.4.12.1
Echo Canceller: MG2
Configuration
======================
SPAN 1: CCS/HDB3 Build-out: 0 db (CSU)/0-133 feet (DSX-1)
SPAN 2: CCS/HDB3 Build-out: 0 db (CSU)/0-133 feet (DSX-1)
SPAN 3: CCS/HDB3 Build-out: 0 db (CSU)/0-133 feet (DSX-1)
SPAN 4: CCS/HDB3 Build-out: 0 db (CSU)/0-133 feet (DSX-1)
Channel map:
Channel 01: Clear channel (Default) (Slaves: 01)
Channel 02: Clear channel (Default) (Slaves: 02)
… … …
Channel 123: Clear channel (Default) (Slaves: 123)
Channel 124: Clear channel (Default) (Slaves: 124)
124 channels to configure.

7) 编辑 /usr/local/freeswitch/conf/openzap.conf
[root@bogon~]# vi /usr/local/freeswitch/conf/openzap.conf
[span zt PRI_1]
name => OpenZAP
number => 1
trunk_type => e1
b-channel => 1-15
d-channel => 16
b-channel => 17-31

[span zt PRI_2]
name => OpenZAP
number => 2
trunk_type => e1
b-channel => 32-46
d-channel => 47
b-channel => 48-62

[span zt PRI_3]
name => OpenZAP
number => 3
trunk_type => e1
b-channel => 63-77
d-channel => 78
b-channel => 79-93

[span zt PRI_4]
name => OpenZAP
number => 4
trunk_type => e1
b-channel => 94-108
d-channel => 109
b-channel => 110-124


8)编辑 /usr/local/freeswitch/conf/autoload_configs/
openzap.conf.xml
[root@bogon ~]# vi /usr/local/freeswitch/conf/autoload_configs/openzap.conf.xml
<configuration name="openzap.conf" description="OpenZAP Configuration">
   <settings>
<param name="debug" value="0"/>
<!--<param name="hold-music" value="$${moh_uri}"/>-->
<!--<param name="enable-analog-option" value="call-swap"/>-->
<!--<param name="enable-analog-option" value="3-way"/>-->
   </settings>
<pri_spans>
    <span name="PRI_1">
   <!-- Log Levels: none, alert, crit, err, warning, notice, info, debug -->
   <param name="node" value="net"/>
   <param name="switch" value="euroisdn"/>
   <param name="opts" value="none"/>
   <param name="dp" value="unknown"/>
   <param name="debug" value="all"/>
   <param name="dialplan" value="XML"/>
   <param name="context" value="default"/>
    </span>

    <span name="PRI_2">
   <param name="node" value="net"/>
   <param name="switch" value="euroisdn"/>
   <param name="opts" value="none"/>
   <param name="dp" value="unknown"/>
   <param name="debug" value="all"/>
   <param name="dialplan" value="XML"/>
   <param name="context" value="from-internal"/>
    </span>

    <span name="PRI_3">
   <param name="node" value="cpe"/>
   <param name="switch" value="euroisdn"/>
   <param name="opts" value="none"/>
   <param name="dp" value="unknown"/>
   <param name="debug" value="all"/>
   <param name="dialplan" value="XML"/>
   <param name="context" value="from-pstn"/>
</span>

    <span name="PRI_4">
   <param name="node" value="cpe"/>
   <param name="switch" value="euroisdn"/>
   <param name="opts" value="none"/>
   <param name="dp" value="unknown"/>
   <param name="debug" value="all"/>
   <param name="dialplan" value="XML"/>
   <param name="context" value="from-pstn"/>
</span>

</pri_spans>
</configuration>


9) 检查zap 通道,执行 oz list
[root@bogon ~]# /usr/local/freeswitch/bin/freeswitch
2010-10-29 00:14:59.797934 [CONSOLE] switch_core.c:1017 Created ip list domains default (deny)
2010-10-29 00:14:59.798201 [NOTICE] switch_utils.c:195 Adding 192.0.2.0/24 (allow) [brian@192.168.1.106] to list domains
2010-10-29 00:14:59.798459 [CONSOLE] switch_core.c:1575
_____              ______        _____ _____ ____ _ _
   |   ___| __ ___   ___/ ___\ \    / /_ _|_ _/ ___| | | |
   | |_ | '__/ _ \/ _ \___ \\ \ /\ / / | |   | || | | |_| |
   |   _|| | |   __/   __/___) |\ V   V /   | |   | || |___|   _   |
   |_|   |_|   \___|\___|____/   \_/\_/   |___| |_| \____|_| |_|

************************************************************
* Anthony Minessale II, Michael Jerris, Brian West, Others *
* FreeSWITCH (
http://www.freeswitch.org)                *
* Paypal Donations Appreciated:
paypal@freeswitch.org    *
* Brought to you by ClueCon
http://www.cluecon.com/        *
************************************************************

2010-10-29 00:14:59.798598 [CONSOLE] switch_core.c:1578
FreeSWITCH Version 1.0.6 (svn-exported) Started.
Max Sessions[1000]
Session Rate[30]
SQL [Enabled]
freeswitch@bogon>
freeswitch@bogon> oz list

+OK
span: 1 (PRI_1)
type: isdn
chan_count: 31
dialplan: XML
context: default
dial_regex:
fail_dial_regex:
hold_music:
analog_options none
+OK
span: 2 (PRI_2)
type: isdn
chan_count: 31
dialplan: XML
context: from-internal
dial_regex:
fail_dial_regex:
hold_music:
analog_options none
+OK
span: 3 (PRI_3)
type: isdn
chan_count: 31
dialplan: XML
context: from-pstn
dial_regex:
fail_dial_regex:
hold_music:
analog_options none
+OK
span: 4 (PRI_4)
type: isdn
chan_count: 31
dialplan: XML
context: from-pstn
dial_regex:
fail_dial_regex:
hold_music:
analog_options none

10) 配置拨号规则
[root@bogon ~]# cd /usr/local/freeswitch/conf/dialplan/
[root@bogon dialplan]# vi from-internal.xml
<context name="from-internal">
   <extension   name="from-internal">
   <condition   field="destination_number" expression="^123$">
   <action application="bridge"   data="openzap/1/1/8"/>
   </condition>
   </extension>
</context>

[root@bogon dialplan]# vi from-pstn.xml
<context name="from-pstn">
   <extension name="8">
       <condition   field="destination_number" expression="^8$">
         <action application="playback" data="/usr/src/dd.wav"/>
       </condition>
</extension>
</context>

11) 修改sip的配置文件
[root@bogon ~]# /usr/local/freeswitch/conf/directory/default
[root@bogon default]# vi 1000.xml
<include>
   <user id="1000">
<params>
   <param name="password" value="$${default_password}"/>
   <param name="vm-password" value="1000"/>
</params>
<variables>
   <variable name="toll_allow" value="domestic,international,local"/>
   <variable name="accountcode" value="1000"/>
   <variable name="user_context" value="default"/>  
<!--将”default”改为”from-internal”   -->
   <!--<variable name="user_context" value="default"/> -->
   <variable name="effective_caller_id_name" value="Extension 1000"/>
   <variable name="effective_caller_id_number" value="1000"/>
   <variable name="outbound_caller_id_name" value="$${outbound_caller_name}"/>
   <variable name="outbound_caller_id_number" value="$${outbound_caller_id}"/>
   <variable name="callgroup" value="techsupport"/>
</variables>
   </user>
</include>

12)通话测试
用x-lite 注册分机1000,用分机1000 拨打号码123

freeswitch@bogon> 2010-10-29 00:43:58.184853 [NOTICE] switch_channel.c:669 New Channel sofia/internal/1000@192.168.1.106  
[8035fd79-05aa-4e05-b237-2958c8daa3d7]
2010-10-29 00:43:58.192881 [INFO] mod_dialplan_xml.c:418 Processing 1000->123 incontext from-internal
2010-10-29 00:43:58.194858 [NOTICE] switch_channel.c:669 New Channel OpenZAP/1:1/8 [9d46073d-75e8-49be-85e8-4b6fb2b1f7a3]
2010-10-29 00:43:58.380811 [NOTICE] switch_channel.c:669 New Channel OpenZAP/4:1/8 [5ad5ab8a-a029-4456-87d8-93efa76f7563]
2010-10-29 00:43:58.382851 [INFO] mod_dialplan_xml.c:418 Processing 1000->8 in context from-pstn
2010-10-29 00:43:58.502806 [CRIT] ozmod_isdn.c:963 Received CALL PROCEEDING message for channel 1
2010-10-29 00:43:58.516807 [NOTICE] switch_core_session.c:1753 Pre-Answer OpenZAP/4:1/8!
2010-10-29 00:43:58.518821 [NOTICE] mod_openzap.c:1976 Ring-Ready OpenZAP/1:1/8!
2010-10-29 00:43:58.518821 [NOTICE] mod_sofia.c:1835 Ring-Ready sofia/internal/1000@192.168.1.106!
2010-10-29 00:43:58.518821 [NOTICE] switch_ivr_originate.c:437 Ring Ready sofia/internal/1000@192.168.1.106!
2010-10-29 00:43:58.624802 [NOTICE] mod_openzap.c:1962 Pre-Answer OpenZAP/1:1/8!
2010-10-29 00:43:58.628905 [INFO] switch_ivr_originate.c:3105 Sending early media
2010-10-29 00:43:58.630820 [NOTICE] mod_sofia.c:1907 Pre-Answer sofia/internal/1000@192.168.1.106!
2010-10-29 00:44:03.613652 [NOTICE] sofia.c:4789 Hangup sofia/internal/1000@192.168.1.106 [CS_EXECUTE] [ORIGINATOR_CANCEL]

加载中
0
y
yangfang63

我想买一套电话4进4出转接系统

64853040转1234      语音  

1234其实是程序绑定的 固定外线电话号码   如:4863737     程序可设置 

联系电话:13901048897

返回顶部
顶部