Use ejabberd with virtual accounts

Hello.

I make the website, where users can create accounts. I want to create jabber account for each registered user. For example my site is example.com, user "foo" registers on site, in that moment jabber account foo@example.com registers automatically. When someone send a message (for example "HELLO") to foo@example.com, user "foo" gets a personal message on my website with text "HELLO". Jabber account must be online even user is not on the website. Actually, all jabber accounts must be online all the time - 24/7 :) and it's a main problem.

I think I need install ejabberd and modify mod_echo extension. I can transmit each jabber message in my php script. I think it's no problem here. I can get in php all messages to all users.

But! I need make all my jabber users online. How can I do this?

When a message is sent to

When a message is sent to user foo, if foo is offline, then ejabberd stores the message in the database (see mod_offline). When later foo connects, ejabberd sends the offline messages from database to the client foo.

Syndicate content