`
javatoyou
  • 浏览: 1068905 次
  • 性别: Icon_minigender_2
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

Asterisk Google Talk

 
阅读更多

Asterisk Google Talk

Starting with Asterisk 1.4, you can connect Asterisk and Google Talk, however as of now (Asterisk 1.4.4) you should consider this feature to be in beta phase, there are still quite a number of problems and glitches around.
You may want to create a new gmail account for use with Asterisk; note that for gmail you need an invitation, whereas for a pure gtalk account you don't. Jabber/Gtalk depends on iksemel so make sure you have that installed and that the jabber/jingle/gtalk channel drivers are selected (run 'make menuselect' to verify this) before compiling Asterisk 1.4

Iksemel installation

First you will need to download and install iksemel 1.2:

Installation from source

Note that since June 2007, iksemel is now available from code.google.com: http://code.google.com/p/iksemel/ and the svn repository below is obsolete.

Due to the recent problems, svn repository is moved away from jabberstudio.org.
To run autogen.sh you must have several packages, it will prompt you for the packages except for libgnutls-dev if you don't have this it will generate an error message in configure.

svncheckouthttp://svn.uludag.org.tr/projeler/iksemeliksemel

cdiksemel
./autogen.sh
./configure--prefix=/usr
make
makecheck
makeinstall

Iftheabovedidn'tworkforyou,trythistooifyouhavegnutlsinstalled:

cdiksemel
./configure--with-gnutls
make
makecheck
makeinstall

Debian

Debian 3.1 Sarge

The iksemel deb package will most probably not work out (you see 'JABBER: socket read error' and 'jabber show connected' always shows your gtalk user as 'disconnected'), so you will need to compile from source (see above)

  1. autogen.sh will complain about AM_PATH_LIBGNUTLS (and ./configure will subsequently fail) if you don't have libgnutls11-dev, so apt-get that first
  2. edit /etc/ld.so.conf and add /usr/local/lib to it, then run 'ldconfig'

Debian 4.0 Etch

The iksemel package appears to do the job, at least with usetls=on in jabber.conf (as required by the server talk.google.com)

Troubleshooting

Q: I see these error message in the CLI, what is wrong? "res_jabber.c:1504 aji_recv_loop: JABBER: socket read error" and "res_jabber.c:482 aji_act_hook: gnuTLS not installed."

A1: I had installed iksemel (XML parsing library for Jabber) from an rpm package, and i guess it had been compiled without GNUTLS being included. i wrote a test program calling a gnutls function call and it failed. So I downloaded iksemel source, compiled it and ran the same test program again, and this time it returned the int value from the function call that i was expecting. Now, "jabber show connected" shows the google talk account as connected.

A2: I was getting a similar problem on ubuntu. It keep saying GnuTLS not installed. After much debugging, we checked the config.log for iksemel-1.2 and observed that the following:
checkingforlibgnutls-config
checkingforlibgnutls-version>=0.1.0
were failing. The fix was to download the source for libgnuTLS and issue a recompile

A3: This works for me, during iksemel source compilation, specify the --with-gnutls option in ./configure.

./configure--with-gnutls
make
makecheck
makeinstall

A4: This is my testing. Create test.c
$vi test.c

include <stdlib.h>
include <stdio.h>
include <iksemel.h>
int main()
{
printf("testiks_has_tls/n/r");
if(iks_has_tls())
printf("iks_has_tlsis1/n/r");
else
printf("iks_has_tlsis0/n/r");
return0;
}


$gcc -liksemel -o test test.c
run ./test if out iks_has_tls is 0, then gnutls need recompile .

$wget http://www.gnu.org/software/gnutls/releases/gnutls-1.7.15.tar.bz2
recompile gnutls
$tar -jxvf gnutls-1.7.15.tar.bz2
$cd gnutls-1.7.15
$./configure --prefix=/usr
$make
$make install

get iksemel from svn
$svn checkout http://svn.uludag.org.tr/projeler/iksemel iksemel
$cd iksemel
$./autogen.sh
$./configure --prefix=/usr --with-libgnutls-prefix=/usr --with-gnutls
$make
$make install

Then run ./test ,I get the right out "iks_has_tls is 1". Good luck!!




Example setup

jabber.conf

This is where you set your gmail/gtalk account info and will register you with the google server.

[general]
debug=yes
autoprune=no
autoregister=no

[gtalk_account]
type=client
serverhost=talk.google.com
username=username@gmail.com/Talk
secret=*****
port=5222
usetls=yes ; TLS is required by talk.google.com, you'll get a 'socket read error' without
usesasl=yes
buddy=buddyusername@gmail.com
statusmessage="This is an Asterisk server"
timeout=100


gtalk.conf

This is where the settings for the actual calls are made:


[general]
context=google-in
allowguest=yes

;
[guest]
disallow=all
allow=ulaw
context=google-in

[buddy]
username=buddyusername@gmail.com
disallow=all
allow=ulaw
context=google-in ;order apparently matters, needs to be placed after username= ?
connection=gtalk_account


extensions.conf


...
[google-in]
exten => s,1,NoOp( Call from Gtalk )
exten => s,n,Set(CALLERID(name)="From Google Talk")
exten => s,n,Dial(SIP/my_sip_phones)
...

[google-out]
exten => 200,1,Dial(gtalk/gtalk_account/buddyusername@gmail.com)


Tips

Ports for signalling and RTP

Just like SIP also gtalk (jingle) uses UDP for the media path (=audio), so you'll need to make sure your firewall is configured accordingly. The settings in rtp.conf also apply to gtalk. The gtalk/jingle signalling defaults to port 5222 tcp (how about TLS?).

Receiving text messages

Once you have established a gtalk call it is also possible to receive instant messages - as long as the other channel supports SendText(). If, for example, a Google Talk client calls a SNOM 360 via SIP and then sends a text message, that message will cause the SNOM's message LED to start blinking, and the user can read the message by pressing the Retrieve key.

No audio, phone keeps ringing

Q: I call on the phone and I see an incoming call on my google talk client. Once I click answer on google talk the google talk client appears connected, though I don't hear anything on it. Meanwhile my phone keeps ringing as if the call wasn't answered. When I finally hang up the call on the phone the google talk client shows a message that the call ends. Any ideas on what's going on?
A: To fix it, you will have to add bindaddr=<the_ip_address_of_the_server_running_asterisk> to general in gtalk.conf

Want to permanently stop jabber and gtalk?

Thats simple, edit /etc/asterisk/modules.conf and add:

noload=>res_jabber.so
noload=>chan_gtalk.so

Asterisk's jabber module over OpenSSL instead of GnuTLS

A timeout handling issue in the iksemel library was fixed using OpenSSL instead of GnuTLS. For the details, see : bug 9972

This also solves the reload issue experienced with the current jabber module.

Related dialplan applications

  • JabberStatus: Return presence status of client or transport as values 1-7
  • JabberSend: Send a message to a buddy

Useful CLI commands

  • jabber show connected
  • jabber debug on
  • jabber test (needs the user 'asterisk' defined in jabber.conf)
  • jabber reload
  • gtalk show channels
  • gtalk reload
  • stun debug on

Documentation

  • see doc/jabber.txt and doc/jingle.txt in your Asterisk source directory
  • see configs/jabber.conf.sample and configs/jabber.conf.sample in your Asterisk source directory

Bugs & known issues

It appears that as of Asterisk 1.4.11 there are still a couple of issue around with gtalk support, here's an excerpt:
update: by applying some of the patches below (marked with "update") it is possible to run a stable chan_gtalk, having both incoming and outgoing calls with good audio quality!

  • NAT issues: Be sure to get the latest Google Talk client as Google has also been introducing NAT improvements here

update:1.0.0.104isreportedtowork(sometimesrequiringarestartbeforebeingabletoconnect);checkyourversionbyright-clickingtheexecutable

  • bug 9401 reports that chan_gtalk doesn't understand DTMF produced by another chan_gtalk
  • bug 9972 the 'reload jabber' command apparently does not always fulfill the expectations, moving from GnuTLS to OpenSSL solves this (code available in bug report)
  • as of Asterisk 1.4.4 your best bet is to only use the ulaw or alaw codecs; ilbc doesn't work yet with Asterisk (1.4.4) due to different payload setting, and speex appears to crash the Google Talk client 1.0.0.104


See also

分享到:
评论

相关推荐

    Asterisk 之数据库配置方案 asterisk数据库

    Asterisk 之数据库配置方案 Asterisk 是一个开源的 PBX(Private Branch Exchange)系统,可以实现电话交换和语音网关的功能。在传统的 Asterisk 配置中,配置文件都是存储在文件系统中的,但是随着系统的复杂度和...

    通过asterisk-java操作asterisk

    Asterisk是一个开源的IP电话系统,而Asterisk-java则是一个Java库,它提供了与Asterisk服务器交互的能力。这个库使得开发者可以利用Java语言来控制和编程Asterisk PBX(Private Branch eXchange),执行诸如创建、...

    Asterisk.NET 1.6.3 控制Asterisk

    Asterisk.NET 1.6.3 是一个专门为.NET开发者设计的开源库,它提供了对Asterisk PBX系统的编程接口,使得用户可以方便地在C#、VB.NET或其他.NET支持的语言中控制和扩展Asterisk功能。这个库是基于Asterisk Manager ...

    Asterisk权威指南中文

    Asterisk权威指南中文(第3版) Asterisk权威指南(第3版)第15章自动话务员 Asterisk权威指南(第3版)第02章Asterisk体系结构 Asterisk权威指南(第3版)第05章用户设备配置 Asterisk权威指南(第3版)第06章Dialplan基础 ...

    Asterisk 简介 Asterisk 架构 Asterisk程序框图

    Asterisk是一款开源的电话交换机软件,它允许用户创建高度自定义的通信系统,包括VoIP(Voice over IP)电话、会议桥、自动呼叫分配(ACD)以及许多其他电信功能。Asterisk的核心设计理念是灵活性和可扩展性,这使得...

    asterisk16版本安装包

    Asterisk是一款开源的IP电话系统,用于构建VoIP(Voice over Internet Protocol)通信平台。在本场景中,我们讨论的是Asterisk的16版本安装包,这将引导我们深入理解Asterisk的核心功能、安装流程以及如何进行编译和...

    asterisk info 录音实现方案

    标签“asterisk record”指的是与Asterisk录音相关的配置和功能,它表明文章将围绕如何在Asterisk中设置和实现录音功能。 在提供的部分内容中,提到了几个关键的配置文件和步骤,这些是实现Asterisk录音功能的核心...

    Asterisk AMI 接口代码

    Asterisk AMI(Asterisk Manager Interface)接口是Asterisk PBX系统提供的一种用于远程管理和监控的强大工具。这个接口允许开发者通过编程方式与Asterisk进行交互,执行诸如控制呼叫、获取状态、监听通话等多种操作...

    Asterisk 中文语音包

    Asterisk是一款开源的IP电话系统,它允许用户创建自己的通信平台,支持VoIP(Voice over IP)服务,包括电话会议、语音邮件和IVR(Interactive Voice Response)等。中文语音包是为Asterisk系统设计的一个关键组件,...

    Asterisk系统的安装与配置

    在安装DAHDI时,可能会遇到CONFLICTING TYPES FOR ‘BOOL’错误,这可以通过Google搜索解决。 二、安装Asterisk 下载Asterisk的安装包asterisk-1.8.7.1.tar.gz,然后按照以下步骤安装: 1. tar zxvf asterisk-1.8...

    Asterisk一些常用的命令

    Asterisk命令详解 Asterisk是一款开源的电话交换机软件,提供了丰富的命令来管理和控制电话系统。下面是Asterisk的一些常用的命令: 1. amportal 命令 amportal 命令是FreePBX搞的,负责管控Asterisk。amportal ...

    asterisk 视频通讯实现方法

    Asterisk是一款开源的PBX(Private Branch Exchange)软件,专用于实现VoIP(Voice over IP)通信。在本文中,我们将深入探讨如何利用Asterisk实现视频通讯功能。实现Asterisk视频通讯的关键在于配置sip.conf文件...

    Asterisk 中文文档说明

    Asterisk是一款强大的开源通信平台,它被广泛用于构建VoIP(Voice over Internet Protocol)电话系统,SIP(Session Initiation Protocol)服务器以及各种通信应用。这个“Asterisk中文文档说明”涵盖了从基础概念到...

    asterisk AGI应用说明

    ### Asterisk AGI应用详解 #### 一、概述 Asterisk是世界上最流行的开源PBX系统之一,它支持多种通信协议并提供了丰富的功能。在Asterisk中,AGI(Asterisk Gateway Interface)是一种非常重要的接口技术,它允许...

    Asterisk

    Asterisk,作为开源通信平台中的佼佼者,它的出现彻底改变了传统电话系统的工作方式,为全球通信领域带来了革命性的变化。Asterisk不仅仅是一款软件,它更是一种理念,象征着自由、开放与创新的精神。从上述内容来看...

    Asterisk 客户端.rar

    Asterisk是一款开源的IP电话系统,用于构建VoIP网络通信基础设施。它的功能强大,能够支持PBX(Private Branch Exchange)、VoIP网关、呼叫中心和许多其他电信应用。在这个"Asterisk客户端.rar"压缩包中,我们主要...

    asterisk拨号方案的配置

    asterisk拨号方案的配置 Asterisk拨号方案的配置是Voice over Internet Protocol(VoIP)技术中的一个关键组件,它控制着呼入和呼出电话的处理和路由。配置文件“extensions.conf”是Asterisk拨号方案的核心,它...

    asterisk-java-1.0.0-m2-sources.zip_asterisk

    Asterisk-Java是一个Java库,它为Asterisk系统提供了AGI(Asterisk Gateway Interface)的实现,方便开发者用Java语言进行Asterisk系统的接口开发。AGI是Asterisk的一个强大特性,允许外部应用程序在呼叫处理过程中...

    最全Asterisk代码学习笔记

    Asterisk是一款开源的PBX(Private Branch Exchange)软件,它允许用户在IP网络上建立电话通信系统。作为Linux环境下的通信平台,Asterisk提供了丰富的功能,包括语音通话、会议、语音邮件、传真等。以下是一些核心...

    Ubuntu16.0.4环境下的Asterisk安装经验

    ### Ubuntu16.0.4环境下Asterisk安装经验 #### 概述 本文将详细介绍如何在Ubuntu 16.0.4系统上安装Asterisk。Asterisk是一款非常强大的开源PBX(Private Branch Exchange)系统,它可以将普通的计算机变成一个功能...

Global site tag (gtag.js) - Google Analytics