1.asterisk与google talk通话的原理是在google talk在AST服务器上注册一个帐号,启动AST时,该帐号会自动连接到google talk的服务器,从而提取该帐号中的信息。
2.我们登录另一个google talk的帐号,会显示我们在AST中注册的那个gtalk帐号,而且可以向该帐号发送文本信息,在AST端会有显示收到的文字信息,但无法回送信息。
3.我们能够使用一个gtalk的帐号来拨通一个sip的分机号,并且能够进行通话。这里我们使用一个外部的gtalk帐号来拨打在AST中注册的帐号,我们一旦触发该呼叫,就让该帐号去拨打sip的分机号。这里我使用的分机是X-lite,来电会显示正确的gmail帐号。说白 了,这就是通过ast来转接电话。
4.我们在测试时发现,我们也可以注册多个帐号到AST中去,原理都是一样的,将AST作为gtalk帐号的载体来进行转接。因此AST还不能作为XMPP的服务器,而我在看freeswitch时,发现freeswitch是支持XMPP协议的,它也能够与google talk通话,在这方面要远比AST做得好。当然FreeSwitch是否能作为XMPP的服务器,还没有去验证它。由于FreeSwitch现在应用的还比较少,文档也不完善,但前景应该不错,我们可以关注它。
5.在这里我使用一个简单的架构图来对google talk通过Asterisk连接该AST的sip用户的通话的原理来进行说明
下面是该通话的配置:
6.s下面是配置通过的Asterisk 设置:
sip.conf
[general]
context=google-in
bindport=5060
bindaddr=192.168.84.25
srvlookup=yes
dtmfmode=rfc2833
relaxdtmf=no
disallow=all
allow=ulaw
allow=alaw
allow=gsm
maxexpirey=30
defaultexpirey=180
canreinvite=yes
nat=0
UserAgent=Asterisk
[836]
type=friend
context=gtalk_out
regexten=836
username=836
secret=123456
fromuser=836
callerid=Test user
host=dynamic
nat=route
canreinvite=no
dtmfmode=RFC2833
incominglimit=3
mailbox=533
jabber.conf
[general]
debug=yes
autoprune=no
autoregister=no
[gtalk_account]
type=client
serverhost=talk.google.com
username=pylonion@gmail.com/Talk
secret= "password"
port=5222
usetls=yes
usesasl=yes
buddy=pylonion@gmail.com
statusmessage=”This is an Asterisk server”
timeout=100
[gtalk_account2]
type=client
serverhost=talk.google.com
username=tydlove@gmail.com/Talk
secret= "password"
port=5222
usetls=yes
usesasl=yes
buddy=tydlove@gmail.com
statusmessage=”This is an Asterisk server”
timeout=100
gtalk.conf
[general]
context=google-in
allowguest=yes
[guest]
disallow=all
allow=ulaw
context=google-in
[buddy]
username=pylonion@gmail.com
disallow=all
allow=ulaw
context=google-in
connection=gtalk_account
[buddy]
username=gtydlove@gmail.com
disallow=all
allow=ulaw
context=google-in
connection=gtalk_account2
extensions.conf
[general]
static=yes
writeprotect=yes
autofallthrough=yes
clearglobalvars=no
priorityjumping=no
[google-in]
exten => s,1,Dial(SIP/836)