openr2-1.3.0.tar.gz
4 - libopenr2 # ./configure --libdir=/usr/lib ; make ; make install
在使用dahdi通道呼出的时候,可以在Dial中对呼出所使用的通道进行指定选择。以下面的例子来说明:
场景说明:数字板卡单E1,使用pri信令,1-31通道分配的group为1,拨号规划使用前缀9呼出。exten => _9.,2,Hangup
一个是/etc/dahdi/system.conf。修改为如下(我一个E1卡。用一个口):
span=1,1,0,cas,hdb3
# termtype: te
cas=1-15:1101
cas=17-31:1101
dchan=16
#echocanceller=mg2,1-15,17-31
# Global data
loadzone = cn
defaultzone = cn
Note that Indonesia has two protocols, which they call R2. One is a real digital R2 variant. The
other is more like the old analogue R2 systems. Only the real digital R2 variant is currently
supported.
然后将 /etc/asterisk/dahdi-channels.conf 追加到 /etc/asterisk/chan_dahdi.conf里面
即
# echo “#include dahdi-channels.conf” >> /etc/asterisk/chan_dahdi.conf
或者
用 vim 将 “#include dahdi-channels.conf” 添加到文件 /etc/asterisk/chan_dahdi.conf 的末尾
=========================
即
\*CLI> dahdi show channels
Chan Extension Context Language MOH Interpret Blocked State
*CLI>
================================
-asterisk –rx ‘mfcr2 show channels’
====================================
mfcr2 set loglevel debug
==============================
dahdi system.conf
loadzone=us
defaultzone=us
#Sangoma A101 port 1 [slot:8 bus:1 span:1]
span=1,1,0,cas,hdb3
cas=1-10:1101
chan_dahdi.conf
echocancel=yes
group=0
context=e1-incoming
signalling =mfcr2
mfcr2_variant=mx
mfcr2_get_ani_first=no
mfcr2_max_ani=10
mfcr2_max_dnis=7
mfcr2_category=national_subscriber
mfcr2_logdir=span1
mfcr2_call_files=yes
mfcr2_logging=all
mfcr2_mfback_timeout=-1
mfcr2_metering_pulse_timeout=-1
mfcr2_allow_collect_calls=no
mfcr2_double_answer=no
mfcr2_forced_release=no
mfcr2_charge_calls=yes
channel => 1-10
=============================
A complete protocol variant code is as follows:
"<country code>,<maximum ANI digits>,<DNIS digits>;"
for example:
"cn,20,7"
means use China MFC/R2. Expect up to 20 ANI (caller number) digits. Expect
7 DNIS (dialed number) digits. Most variants can handle less than the
specified number of DNIS digits, but some only handle this through fairly
long timeouts. Getting the DNIS length right can be important for good
performance.
http://www.moythreads.com/unicall/mfcr2-asterisk-unicall-0.2-english.pdf
http://www.voip-info.org/wiki/view/Asterisk+MFC+R2
http://bbs.voip88.com/thread-6003-1-24.html
=================
# cat system.conf
loadzone = br
defaultzone =br
span=1,1,0,cas,hdb3
cas=1-15:1101
cas=17-31:1101
dchan=16
/etc/asterisk# cat chan_dahdi.conf
[trunkgroups]
[channels]
usecallerid=yes
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
canpark=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=yes
signalling=mfcr2
mfcr2_variant=br
mfcr2_get_ani_first=no
mfcr2_max_ani=20
mfcr2_max_dnis=20
mfcr2_category=national_subscriber
mfcr2_logdir=span1
mfcr2_logging=all
context=in-e1
group=0
callgroup=0
pickupgroup=0
channel => 1-15
channel => 17-31
====================
more details, please refer these:
http://www.libopenr2.org/
source: http://blog.alexandrealencar.net/2008/05/asterisk-com-mfcr2-openr2.html
email list: http://lists.digium.com/pipermail/asterisk-r2/
http://code.google.com/p/openr2/downloads/list
================
Variant Code Country:
AR Argentina
BR Brazil
CN China // 支持中国还没有做完整的测试,这是官方的说法。
CZ Czech Republic
CO Colombia
EC Ecuador
ITU International Telecommunication Union
MX Mexico
PH Philippines
VE Venezuela