Asterisk jabber not connecting to XMPP server (Ejabberd)

Hello, I cannot connect to XMPP server. I tried to connect IM clients and they do fine, but Asterisk won’t connect to it. Followed same proccess for both at XMPP server.

This is what CLI shows:

[code]emea_ha1*CLI> jabber show connections
Jabber Users and their status:
[asterisk] server1@actualizegroup.com - Disconnected

Number of users: 1[/code]

/etc/asterisk/jabber.conf:

[code][general]
autoregister = yes

[asterisk]
type = client
serverhost = xxx.xxx.xxx.xxx
pubsub_node = pubsub.mycompany.com
username = server1@mycompany.com
port = 5222
secret = mysecret
distribute_events = yes
status = available
usetls = no
usesasl = no
buddy = server2@mycompany.com[/code]

I set usetls and usesasl to ‘no’ because that’s how it is configured now in XMPP srvr.

This is the debugging information when “jabber set debug on” is executed from Asterisk CLI:

[code]JABBER: asterisk OUTGOING: <?xml version='1.0'?><stream:stream xmlns:stream=‘http://etherx.jabber.org/streams’ xmlns=‘jabber:client’ to=‘actualizegroup.com’ version=‘1.0’>

JABBER: asterisk INCOMING: <?xml version='1.0'?><stream:stream xmlns=‘jabber:client’ xmlns:stream=‘http://etherx.jabber.org/streams’ id=‘706326287’ from=‘actualizegroup.com’ version=‘1.0’ xml:lang=‘en’>stream:featuresDIGEST-MD5SCRAM-SHA-1PLAIN</stream:features>

JABBER: asterisk OUTGOING: server1asterisk0142cb4f7fc4d9ca4b339f82bde9ba5f8df621fb

JABBER: asterisk INCOMING: [/code]

What can be stopping Asterisk from connecting to XMPP server. Ejabberd shows this line in console once every few seconds:

Why Ejabberd says Asterisk user is connected but Asterisk does not? It’s awkward :-/

Thanks for helping.

I have simmilar situation. My xmpp.conf:

[general]
autoregister=yes
autoprune=no
auth_policy=accept

[ejabberd]
debug=yes
type=client
serverhost=192.168.99.36
username=jabberAdmin@stormbox001.stormbox.hr
secret=<cleartextpassword>
priority=1
port=5222
usetls=no
usesasl=no
status=available
statusmessage="Asterisk is up and running"
timeout=25

when I do xmpp show connections I get:

[code]Jabber Users and their status:
[ejabberd] jabberAdmin@stormbox001.stormbox.hr - Authenticating

Number of clients: 1
[/code]

And communication goes like this:

<--- XMPP sent to 'ejabberd' --->
<?xml version='1.0'?><stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' to='stormbox001.stormbox.hr' version='1.0'>
<------------->

<--- XMPP received from 'ejabberd' --->
<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='4191260427' from='stormbox001.stormbox.hr' version='1.0' xml:lang='en'><stream:features><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>DIGEST-MD5</mechanism><mechanism>SCRAM-SHA-1</mechanism><mechanism>PLAIN</mechanism></mechanisms><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='luSjFLdmRycJRxfAe3qWRHbn8TE='/></stream:features>
<------------->

<--- XMPP sent to 'ejabberd' --->
<iq type='set' id='aaafj' to='stormbox001.stormbox.hr'><query xmlns='jabber:iq:auth'><username>jabberAdmin</username><resource>asterisk-xmpp</resource><digest>d4b4569afadda8a51c890cb3424d1d432294ce2b</digest></query></iq>
<------------->

<--- XMPP received from 'ejabberd' --->
<iq from='stormbox001.stormbox.hr' id='aaafj' type='error'><error code='503' type='cancel'><service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error></iq>
<------------->

Ejabberd is operational and tested with Pidgin. Although the messaging with Pidging is different. Instead if <if type=‘set’…:

<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='DIGEST-MD5' xmlns:ga='http://www.google.com/talk/protocol/auth' ga:client-uses-full-bind-result='true'/> .

Is it possible to change how Asterisk talks to ejabberd? Or any other suggestion what to do?

It works now. I put usesasl=yes and it works. I didnt put it before because I red somewhere that SASL doesnt work with LDAP. But it works. So now I have Asterisk talking to Ejabberd which has LDAP authorization.

I am a bit disapointed that JABBER_STATUS isnt working right… :frowning: