by Chris Chen, P.Eng; chris.chen2004 at gmail dot com
July 18th, 2007
This article is a HOWTO for configuring GoogleTalk with Asterisk 1.4.8 on the Linksys WRTSL54GS running OpenWRT whiterussian 0.9
My network environment is as follows:
Cable Internet -> (Public IP @A1) WAN [Dlink DI724U] LAN(Private IP @B1) ->
WAN (Private IP @B2) [ Linksys WRTSL54GS] LAN(Private IP @C1)
-> Home PC (Private IP @C2) running GoogleTalk Client 1.0.0.104
-> ATA (Private IP @C3) with one analogue phone
The Linksys WRTSL54GS is running OpenWRT whiterussian 0.9, with a 1GB USB2 Flash drive installed in the USB2 port, as Asterisk 1.4.8 core, plus the sounds files, and MOH files altogether exceed 25MB.
Prerequisites:
-
The Optware packages from nslu2 project are used, please follow the Information and installation instructions to setup the Optware on OpenWRT whiterussian before continuing.
- asterisk14-core-sounds-en-ulaw_1.4.7-1_mipsel.ipk
- asterisk14-extra-sounds-en-ulaw_1.4.6-1_mipsel.ipk
- asterisk14-moh-freeplay-ulaw_0.0.0-1_mipsel.ipk
- asterisk14_1.4.8-1_mipsel.ipk
- iksemel_1.2-2_mipsel.ipk
- Port forwarding of RTP ports on the public facing router
- On WRTSL54GS, accept the RTP ports
- GoogleTalk client version 1.0.0.93 has been confirmed not to work properly with NAT, if your buddy is using googletalk 1.0.0.93 you will hear nothing or your own echoes, please encourage your buddy to upgrade to version 1.0.0.104, it works like a charm.
- Enjoy the freedom of free (as in speech) communication between your friends (by googletalk client) and you (by any means Asterisk can offer)!
Installation:
The files required for GoogleTalk to speak with Asterisk 1.4.8 are from the ddwrt package feed:
To install these packages, use the ipkg command:
root@OpenWrt:/# /opt/bin/ipkg install \ http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/asterisk14_... root@OpenWrt:/# /opt/bin/ipkg install \ http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/asterisk14-... root@OpenWrt:/# /opt/bin/ipkg install \ http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/asterisk14-... root@OpenWrt:/# /opt/bin/ipkg install \ http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/asterisk14-... root@OpenWRT:/# /opt/bin/ipkg install \ http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/iksemel_1.2...
Verifying Installation:
After a successful installation of Asterisk 1.4.8/Optware on the OpenWRT whiterussian 0.9, start the asterisk console. When "gtalk" and "jabber" commands are available, it is ready for action:
root@OpenWrt:/opt/etc/asterisk# asterisk -r Asterisk 1.4.8, Copyright (C) 1999 - 2007 Digium, Inc. and others. Created by Mark SpencerAsterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for detail s. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= Connected to Asterisk 1.4.8 currently running on OpenWrt (pid = 28709) Verbosity is at least 11 -- Remote UNIX connection OpenWrt*CLI> ? ! abort add agi cdr clear convert core database debug dialplan dnsmgr dont dump extensions feature file group gtalk help http iax2 include indication init jabber keys load local logger manager module moh no originate reload remove restart rtcp rtp save say set show sip soft stop stun udptl unload voicemail OpenWrt*CLI>
Configuration:
This is an example setup based on my network mentioned previously.
jabber.conf: This is where you set your gmail/gtalk account information, and what google server to register with.
[general] debug=no ;;Turn on debugging by default. autoprune=no ;;Auto remove users from buddy list. autoregister=no ;;Auto register users from buddy list.
[asterisk] ;;label type=client ;;Client or Component connection serverhost=talk.google.com ;;Route to server for example, talk.google.com username=username@gmail.com ;;Username with optional roster. secret=YOUSECRET ;;Password port=5222 ;;Port to use defaults to 5222 usetls=yes ;;TLS is required by talk.google.com, you'll get a 'socket read error' without usesasl=yes ;;Use sasl or not buddy=buddyusername@gmail.com ;;Manual addition of buddy to list. 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 ;;Context to dump call into
allowguest=yes ;;Allow calls from people not in
;;list of buddy
bindaddr=Private IP @B2 ;;These two settings are very critical for getting
externip= Public IP @A1 ;; gtalk audio with Asterisk server behind NAT
[guest] ;;special account for options on guest account disallow=all allow=ulaw context=google-in
[buddy]
username=buddyusername@gmail.com ;;username of the peer your
;;calling or accepting calls from
disallow=all
allow=ulaw
context=google-in
connection=asterisk ;;client or component in jabber.conf
;;for the call to leave on.
extensions.conf: A sample dialplan
...
[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)
...
[default]
...
exten => 100,1,JabberStatus(asterisk,buddyusername@gmail.com,STATUS)
exten => 100,2,GotoIf($[${STATUS}<6]?3:5)
exten => 100,3,JABBERSend(asterisk,buddyusername@gmail.com, Hi Buddy ${CALLERID(name)} at extension ${CALLERID(num)} is calling you!)
exten => 100,4,Dial(gtalk/asterisk/buddyusername@gmail.com)
exten => 100,5,voicemail(100,u)
rtp.conf
; RTP Configuration
;
[general]
;
; RTP start and RTP end configure start and end addresses
;
; Defaults are rtpstart=5000 and rtpend=31000
;
rtpstart=1650 ;; Googletalk is using low RTP Port numbers than usual Asterisk server
rtpend=4560 ;; Please get the proper number by set 'Jabber debug' on asterisk
;;console, and start gtalk to asterisk, then looking for the jabber
;;negotiations of RTP ports
;
; Whether to enable or disable UDP checksums on RTP traffic
;
;rtpchecksums=no
;
; The amount of time a DTMF digit with no 'end' marker should be
; allowed to continue (in 'samples', 1/8000 of a second)
Crucial Tips:
