Problem with res_xmpp authenticating with Google

Hi guys,

I’ve recently installed Asterisk 11.1.0 and I’m trying to configure it to work with Google Voice. I’ve been following the instructions in the Wiki, specifically the instructions here:

wiki.asterisk.org/wiki/display/ … ing+Google

However, I’m getting an error every 20 seconds from the res_xmpp module, with the lines:

[Dec 22 22:19:42] WARNING[8879]: res_xmpp.c:3561 xmpp_client_thread: JABBER: socket read error [Dec 22 22:19:42] ERROR[8879]: res_xmpp.c:2529 xmpp_client_requested_tls: TLS connection for client 'google' cannot be established. OpenSSL initialization failed. [Dec 22 22:19:42] WARNING[8879]: res_xmpp.c:3502 xmpp_client_receive: Parsing failure: Hook returned an error.

I’ve checked the Asterisk startup log and can’t see any errors loading any of the modules. I enabled xmpp debug logging (‘xmpp set debug on’ in the Asterisk console) and I can now see some of the message flow:

[code][Dec 22 22:21:22] WARNING[8879]: res_xmpp.c:3561 xmpp_client_thread: JABBER: socket read error

<— XMPP sent to ‘google’ —>

<?xml version='1.0'?>

<------------->

<— XMPP received from ‘google’ —>
<stream:stream from=“gmail.com” id=“9B54ABF57C070D2D” version=“1.0” xmlns:stream=“http://etherx.jabber.org/streams” xmlns=“jabber:client”>stream:featuresX-GOOGLE-TOKENX-OAUTH2</stream:features>
<------------->

<— XMPP sent to ‘google’ —>

<------------->

<— XMPP received from ‘google’ —>

<------------->
[Dec 22 22:21:22] ERROR[8879]: res_xmpp.c:2529 xmpp_client_requested_tls: TLS connection for client ‘google’ cannot be established. OpenSSL initialization failed.
[Dec 22 22:21:22] WARNING[8879]: res_xmpp.c:3502 xmpp_client_receive: Parsing failure: Hook returned an error.[/code]
However, to my untrained eye this all looks exactly correct – a starttls message is sent to Google, and a proceed message is returned. So this doesn’t seem to shed any light on the issue.

Does anyone have any suggestions as to what I might be doing wrong, or how to gather further information?

My xmpp.conf and motif.conf files are:

xmpp.conf:

[general]

[google]
type=client
serverhost=talk.google.com
username=my_google_account@gmail.com
secret=my_google_password
priority=1
port=5222
usetls=yes
usesasl=yes
status=available
statusmessage="I am available"
timeout=5

motif.conf:

[google]
context=incoming-motif
disallow=all
allow=ulaw
connection=google

Many thanks!

I have the same problem with Asterisk 11.3 LTS running on Ubuntu 10.04.4 LTS. That is, I get:

As far as I can tell, even though I have OpenSSL installed and detected by the Asterisk configure script, and autoconfig.h has the line:
#define HAVE_OPENSSL 1
the execution of res/res_xmpp.c indicates that HAVE_OPENSSL is not defined!! I can only imagine that this is some kind of problem with the include file hierarchy.

Well, I hacked res_xmpp.c to explicitly include autoconfig.h up at the top and now the problem is gone and I am connecting to Google correctly. E.g:

[code]*CLI> xmpp show connections
Jabber Users and their status:
[google] notMyActualAddress@gmail.com - Connected

Number of clients: 1[/code]

I am having the exact same problem. Could you please explain how you got res_xmpp.c to “run” correctly? I tried to rebuild everything using include “autoconfig.h” but it failed. I then removed the check for OPENSSL so it would just build it in there, but it still isn’t working.

Any help?