Was this page helpful?

Elastix 整合 GTalk

    前言

    要使 Elastix 支援 GTalk 實在是不簡單,雖然 Asterisk 語音交換平台自  1.4.x 起已內建可支援 GTalk,不過 Elastix 釋出的版本並未包含所需要的模組,所以需要作手動安裝,並且還得重新編譯過 Asterisk 才會產生需要的模組,過程有些複雜,看過 Trixbox Forum 相關文章,似乎 Trixbox 新版已包含了那些模組。

    下載安裝 iksemel

    安裝相依性套件

    yum install libtool gnutls-devel texinfo

    下載 iksemel

    yum install subversion mod_dav_svn
    cd /usr/src
    svn checkout http://svn.uludag.org.tr/projeler/iksemel iksemel-1.4
    cd iksemel-1.4
    ./autogen.sh

    或者,不想安裝 SVN,可以直接從另一網站下載

    cd /usr/src
    wget http://iksemel.googlecode.com/files/iksemel-1.4.tar.gz
    tar xzf iksemel-1.4.tar.gz
    cd iksemel-1.4
    ./configure --prefix=/usr
    make
    make check
    make install
    ldconfig -v

    重新編譯 asterisk

    Updated: SRPM 位址變更為 http://repo.elastix.org/elastix/index.php?dir=

    yum install rpm-build 
    wget http://www.alcancelibre.org/al/el/5/SRPMS.al/speex-1.2-0.1.beta1.9.el5.al.src.rpm 
    yum install libogg-devel 
    rpmbuild --rebuild speex-1.2-0.1.beta1.9.el5.al.src.rpm 
    rpm -ivh /usr/src/redhat/RPMS/i386/speex-devel-1.2-0.1.beta1.9.i386.rpm  
    
    yum install postgresql-devel libpri-devel libtiff-devel libvorbis-devel unixODBC-devel sqlite-devel sqlite-devel opal-devel alsa-lib-devel net-snmp-devel curl-devel libxml2-devel  
    wget ftp://ftp.pbone.net/mirror/dag.wieers.com/packages/gsm/gsm-1.0.10-6.rf.src.rpm 
    rpmbuild --rebuild gsm-1.0.10-6.rf.src.rpm 
    rpm -ivh /usr/src/redhat/RPMS/i386/gsm-devel-1.0.10-6.rf.i386.rpm 
     
    yum install libdv-devel libraw1394-devel libavc1394-devel openldap-devel expat-devel SDL-devel 
    wget ftp://ftp.pbone.net/mirror/download.fedora.redhat.com/pub/fedora/linux/releases/7/Fedora/source/SRPMS/pwlib-1.10.7-1.fc7.src.rpm 
    rpmbuild --rebuild pwlib-1.10.7-1.fc7.src.rpm 
    rpm -Uvh --nodeps /usr/src/redhat/RPMS/i386/pwlib-*.rpm

    重新編譯 source rpm, 然後強制安裝編譯檔。

    amportal stop
    cd /usr/src/redhat/SRPMS
    wget http://repo.elastix.org/centos/5/updates/SRPMS/asterisk-1.4.22.0-6.src.rpm
    rpm -ivh asterisk-1.4.22.0-6.src.rpm
    cd ../SOURCES
    tar xzf asterisk-1.4.22.0-6.tar.gz
    cd asterisk-1.4.22.0-6
    ./configure
    make menuselect   (確定 chan_gtalk 及 res_jabber 有勾選)
    make
    make install
    for Elastix 2.0)

    新增 /etc/yu.conf.d/epel.repo

    [epel]
    name=Extra Packages for Enterprise Linux 5 - $basearch
    #baseurl=http://download.fedoraproject.org/pub/epel/5/$basearch
    mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch
    failovermethod=priority
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
    
    [epel-debuginfo]
    name=Extra Packages for Enterprise Linux 5 - $basearch - Debug
    #baseurl=http://download.fedoraproject.org/pub/epel/5/$basearch/debug
    mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-debug-5&arch=$basearch
    failovermethod=priority
    enabled=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
    gpgcheck=1
    
    [epel-source]
    name=Extra Packages for Enterprise Linux 5 - $basearch - Source
    #baseurl=http://download.fedoraproject.org/pub/epel/5/SRPMS
    mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-source-5&arch=$basearch
    failovermethod=priority
    enabled=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
    gpgcheck=1
    

    關於 EPEL-Extra Packages for Enterprise Linux
    http://fedoraproject.org/wiki/EPEL?s...0000000TAyxAAG

    所需套件:

    編輯 gtalk.conf

    #vi /etc/asterisk/gtalk.conf

    [general]
    context=default         ;;Context to dump call into
    ;allowguest=yes                  ;;Allow calls from people not in
    ;externip=
    ;bindaddr=
    
    ;
    ;[guest]                 ;;special account for options on guest account
    ;disallow=all
    ;allow=ulaw
    ;context=gtalk-in 
    ;connection=asterisk
    
    [gtalk-yourfriend]
    [email protected]
    disallow=all
    allow=ulaw
    context=gtalk-in
    connection=mygtalk-yourself

    Tips:

    * 如果 Asterisk 主機是在防火牆內,必須在 general加上以下參數:
    externip=外部IP
    bindaddr=內部IP

    * buddy 的 username 是指對方的 gtalk 帳號,context 是當對方的 gtalk 撥入後會導入的 extension。

    編輯 jabber.conf

    #vi /etc/asterisk/jabber.conf

    [general]
    debug=yes                               ;;Turn on debugging by default.
    autoprune=no                            ;;Auto remove users from buddy list.
    autoregister=yes                        ;;Auto register users from buddy list.
    
    [mygtalk-yourself]
    type=client
    serverhost=talk.google.com
    [email protected]/Talk
    secret=yourpass
    port=5222
    priority=1
    usetls=yes
    usesasl=yes
    statusmessage="I am an Asterisk server"
    timeout=100
    ;[email protected]
    

    Tips:

    * statusmessage 你的帳號在對方 gtalk 上顯示的訊息。

    撥入設定

    編輯 extensions_custom.conf

    [gtalk-in]
    exten => s,1,Answer
    exten => s,n,Wait(1)
    exten => s,n,Playback(demo-instruct)
    exten => s,n,Hangup
    

     撥入後會聽到一段語音。

    撥出設定

     

    重啟 asterisk 服務

    asterisk -rx "stop now"
    amportal stop
    amportal start

    驗證 GTalk 模組載入

    asterisk -rx "module show" | grep -E "res_jabber.so|chan_gtalk.so"

    成功時會出現這兩行訊息
    res_jabber.so                  AJI - Asterisk Jabber Interface          0
    chan_gtalk.so                  Gtalk Channel Driver                     0 

    F.A.Q

    1. 重啟 Asterisk 服務後,出現錯誤訊息:undefined symbol: ast_aji_get_client. Module 'res_jabber.so' was not compiled with the same compile-time options as this version of Asterisk.
    Ans: 重編Asterisk後,不要只複製 chan_gtalk.so 及 res_jabber.so,而是要執行完整安裝。

    2. 執行 yum 安裝時,出現錯誤:Error: ptlib conflicts with pwlib.  You could try using --skip-broken to work around the problem.  You could try running: package-cleanup --problems
    Ans: 先移除 ptlib 套件,再安裝一次。

    3. 用其他 gtalk 帳號撥入 Asterisk 時,有進入到 extension 但 gtalk 帳號這邊沒有任何聲音?
    Ans: 如果 Asterisk 至於防火牆內,檢查 gtalk.conf 的 bindaddr=內部ip 及 externip=外部IP
     

    Was this page helpful?
    標籤 (Edit tags)
    查看第3個(總3個)評論: 查看所有
    哈囉 小弟 照著您的方法作 但到這步驟會有問題
    rpm -Uvh --nodep /usr/src/redhat/RPMS/i386/pwlib-*.rpm

    --nodep:unknow option

    想請問怎麼解決問題
    發佈時間 01:57, 16 Jan 2009 ()
    不好意思! 手誤,已更正原文,應該是 --nodeps 。
    發佈時間 12:38, 16 Jan 2009 ()
    小弟已經成功按照您的 教學安裝 謝謝 請問一下 成功後

    要怎麼測試呢......
    發佈時間 03:24, 22 Jan 2009 ()
    查看第3個(總3個)評論: 查看所有
    您必須 登入 才能發佈評論。
    Powered by MindTouch Core