XMPP not starting on system asterisk startup

Hello and thanks to everyone,

I am experiencing a really strange problem.

I set up a brand new installation of asterisk 11.11 on CentOS 6 using asterisk yum repositories.

I configured several sip connections and one xmpp connection to my own xmpp server (Openfire) and everything was looking to work perfectly during testing.

So I restarted the CentOS server, waited for asterisk to startup and, with my great surprise, I noticed that all the SIP provider registrations were correctly connected, while the XMPP one was offline.

I connected to Asterisk from console with the command ‘asterisk -r’ and checked all the modules and everything was correctly loaded on startup, but when I issued, on the Asterisk CLI, the command: ‘xmpp show connections’ I received ‘Connection to… -> Disconnected’.

At this point I sent to CLI the command ‘core stop now’ and shut down Asterisk.

Then I started it again from bash console with command ‘asterisk -g’ and THIS WAY also the XMPP connection WAS UP as expected !!!

So I tried to create a custom startup script on CentOS which simply executes the above said command ‘asterisk -g’ on startup, but no way, as before, once the OS was started the running Asterisk had XMPP connection disconnected.

I even tried to create a cron job, specifing root as user, with the command ‘asterisk -g’ and to execute it explicitly from webmin using the ‘Execute now’ Button, but no way, same result: the running Asterisk is perfectly working except for the XMPP connection which results to be disconnected !!!

In conclusion… the only way I found to have Asterisk to connect to the XMPP server when it starts up is to start it manually from a bash console (root) with the command ‘asterisk -g’ (or vcg etc…).
Any other try to let it startup automatically on OS startup leaves the XMPP connection disconnected, no matter what I tried. Obviously that’s not an option, since I cannot connect to console and startup Asterisk manually every time i reboot the serves machine OS.

I am really getting crazy since, apart from the XMPP connection, all the other asterisk functions are working perfectly when it starts up automatically with the OS. I couldn’t find any error or warning which could help inside the asterisk logs.

Really hope someone will Help.

Thanks in advance.