X100Pというアナログモデムカードを利用するとAsteriskをPSTNと接続できます。
これのセットアップを行います。
genzaptelconf
を実行します。これで
ztcfg -vv
の実行結果が
1 channels configured.
なら成功です。
X100Pからプッシュ契約していないアナログ回線で外線発信する場合は
"/etc/asterisk/zapata-auto.conf" の
channel => 1
の行の直前に
pulsedial=true
を入れておけば発信できるようになります。
红色的部分非常重要!!!是添加在/etc/asterisk/zapata-auto.conf文件中的,全部的文件内容如下:
; Autogenerated by /usr/sbin/genzaptelconf -- do not hand edit
; Zaptel Channels Configurations (zapata.conf)
;
; This is not intended to be a complete zapata.conf. Rather, it is intended
; to be #include-d by /etc/zapata.conf that will include the global settings
;
; Span 1: WCFXO/0 "Wildcard X100P Board 1"
;;; line="1 WCFXO/0/0"
signalling=fxs_ks
callerid=asreceived
group=1
;context=from-pstn
pulsedial=true
context=default
channel => 1
不认识日文,但估计应该就是那个所谓的判断反极信号的配置了,否则无法在x100p上实现外呼。另外,绿色部分是默认的context,跟zap show chennels里面的pseudocontext不一致,换成红色的才能呼出去,这个我还没有明白为什么。于是外呼问题解决。然后同时另一个问题又出来了,手机是ring了,但是接听没有声音。网上搜索出来无声音的情况,都是SIP在NAT后的问题,也就是 RTP穿越NAT的问题。而我的问题是终端与服务器在同一内网,Asterisk通过电话线外呼,所以与NAT并没有关系。问题集中在zap相关的配置上了。
/etc/zaptel.conf是自动更新的,主要是配置硬件信息,我只有一个FXO口,所以其中包含以下内容:
# Autogenerated by /usr/sbin/genzaptelconf -- do not hand edit
# Zaptel Configuration File
#
# This file is parsed by the Zaptel Configurator, ztcfg
#
# It must be in the module loading order
# Span 1: WCFXO/0 "Wildcard X100P Board 1"
fxsks=1
# Global data
loadzone = cn
defaultzone = cn
其中的 两个 = cn 是我手动改的,默认是us 。
/etc/asterisk/zapata.conf 是配置硬件口和通道映射,以及相关通道属性的。
;
; Zapata telephony interface
;
; Configuration file
[trunkgroups]
[channels]
language=cn
context=from-zaptel
signalling=fxs_ks
rxwink=300 ; Atlas seems to use long (250ms) winks
;
; Whether or not to do distinctive ring detection on FXO lines
;
;usedistinctiveringdetection=yes
usecallerid=yes
hidecallerid=no
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
cancallforward=yes
callreturn=yes
callprogress=yes
echocancel=yes
echocancelwhenbridged=no
;echotraining=800
hanguponpolarityswitch=yes
rxgain=0.0
txgain=0.0
group=1
callgroup=1
pickupgroup=1
immediate=no
busydetect=yes
busycount=5
toneduration=100
;faxdetect=both
faxdetect=incoming
;faxdetect=outgoing
;faxdetect=no
;Include genzaptelconf configs
#include zapata-auto.conf
;channel => 1
group=1
;Include AMP configs
#include zapata_additional.conf
这个问题也是查了很多,都没能解决,结果在不是该问题的帖子里面找到了解决方法。以上红色的是参考http://www.voipuser.org/forum_topic_10148.html进行添加的,默认的是没有的
再进入到CLI控制台,
至此,外呼通话实现。初次呼出的接通时间比较长,在10秒以上。。。。这个还待解决。今天先写到这里,后面再来完善。trixbox1*CLI> zap restart
Destroying channels and reloading zaptel configuration.
== Parsing '/etc/asterisk/zapata.conf': Found
== Parsing '/etc/asterisk/zapata-auto.conf': Found
== Parsing '/etc/asterisk/zapata_additional.conf': Found
-- Registered channel 1, FXS Kewlstart signalling
-- Automatically generated pseudo channel