GPlat
GPlat

Reputation: 31

Assign random user to anonymous user(ejabberd, strophe)

I am building a web based chat application using strophe and ejabberd. What I am trying to do now, is :

A user can anonymously log in into the chat application and after he log in there is automatically an admin assigned to him. So far, I had managed to enable anonymous log in ejabberd, but I have to manually add the JID of the admin. So my question is how do I assign a random admin to the user?

Upvotes: 0

Views: 751

Answers (1)

dhruvbird
dhruvbird

Reputation: 6189

What you would need to do is always start a chat with some user (the same user for everyone) and demultiplex the messages on that user's side. You can do this using a BOT. What this will allow you to do is that at times of higher activity, an admin can serve more than 1 user.

Alternatively, you can also set up a web-service which returns the JID of the next available admin in the queue. Whenever an admin is done interacting with a user, [s]he will have to signal her/his availability on some web-interface (or you can use chatstate notifications for this - for example, window-closed).

Upvotes: 0

Related Questions