Integración de Elastix con Gtalk

Installing the GTalk support on Elastix is quite an easy task: There isn’t much to be done because the Asterisk’s version that comes from Elastix 2.2, already brings the support to talk with compiled GTalk. Instead, here I will explain how to configure it in order to receive calls on our Elastix using a GTalk account.

Note: This is an article I wrote a long time ago and found by chance in my computer. Today I decided to release it but, with all the changes made by Google, I’m not sure if this is currently operating. Let’s hope so. I would also like to use this opportunity to thank my good friend Juan Pablo Bustos, a great Asterisk master, who helped prove everything works perfectly.

Before getting started, we must have a Google account on hand. In this case, we will use the account elastixcookbook@gmail.com. Then, the content of the file /etc/asterisk/jabber.conf

[code language=”text”]
[general]
debug=yes
autoprune=yes
autoregister=yes

[gtalk]
type=client
serverhost=talk.google.com
username=elastixcookbook@gmail.com
secret=clavesecreta123456789
port=5222
usetls=yes
usesasl=yes
buddy=example@gmail.com
statusmessage=Asterisk Server
timeout=100
[/code]

Now the content of the file /etc/asterisk/jabber.conf

[code language=”text”]
[general]
context=from-gtalk
allowguest=yes

[guest]
disallow=all
allow=ulaw
context=from-gtalk

[elandivar]
username=elandivar@gmail.com
disallow=all
allow=ulaw
context=from-gtalk
connection=gtalk

[bustosjuan]
username=bustosjuan@gmail.com
disallow=all
allow=ulaw
context=from-gtalk
connection=gtalk

[/code]

At the end of our file /etc/asterisk/extensions_custom.conf, we add the following contexts.

[code language=”text”]
[from-gtalk]
exten => s,1,NoOp( Call initializated from Google Talk )
exten => s,n,Set(CALLERID(name)=”GTalk”)
exten => s,n,Dial(SIP/5212,30)
exten => s,n,GotoIf($[“${DIALSTATUS}” = “BUSY”]?busy:unavail)
exten => s,n(unavail),Voicemail(5212@default,u)
exten => s,n,Hangup()
exten => s,n(busy),VoiceMail(5212@default,b)
exten => s,n,Hangup()

[to-gtalk]
exten => 10001,1,Dial(gtalk/gtalk/elandivar@gmail.com)
exten => 10001,n,Congestion(3)
exten => 10001,n,Hangup
exten => 10002,1,Dial(gtalk/gtalk/bustosjuan@gmail.com)
exten => 10002,n,Congestion(3)
exten => 10002,n,Hangup
exten => _*1XXXXXXXXXX,1,Dial(gtalk/gtalk/+${EXTEN:1}@voice.google.com)
exten => _*1XXXXXXXXXX,n,Congestion(3)
exten => _*1XXXXXXXXXX,n,Hangup

[/code]

Within the context to-gtalk what I’m telling Asterisk is that if I dial 10001 it should start calling contact elandivar@gmail.com and if I dial 10002 it should start calling contact bustosjuan@gmail.com.

Important: Do not forget to include the contexts from-gtalk and to-gtalk, within the from-internal-custom context. In MY CASE, this context remains like this.

[code language=”text”]
[from-internal-custom]
exten => 1234,1,Playback(demo-congrats)
exten => 1234,2,Hangup()
exten => h,1,Hangup()
include => from-gtalk
include => to-gtalk

[/code]

We finally restart Asterisk and test it.

If I enter Gmail and log in with my account elandivar@gmail.com, I will see the user elastixcookbook@gmail.com is online. This means the user has been successfully registered in Elastix!. I can even send messages or start calling it. If I start a call, it will ring on the extension 5212, as I have specified in the file /etc/asterisk/extensions_custom.conf.

Well, I should go now. I have a Google call ringing on my phone 🙂

Article taken from:

http://www.neomano.com/2014/03/integracion-de-elastix-con-gtalk/