Article - Talk ejabberd sm
Return the list of ejabberd core modules
Session manager (ejabberd_sm)
Handle the currently opened sessions.
This module routes packets to local users. It determines which user resource the packet must be sent via the presence table. If this resource is connected to this node, it is routed to the C2S manager. If it’s connected via another node, then the packet is sent to the session manager on that node.
API
get_user_resources/2
get_user_resources(User, Server)
* User = Server = string()
Returns all the resources of a connected user.
dirty_get_sessions_list/0
dirty_get_sessions_list() -> [JID]
* JID = {Username, Host, Resource}
* Username = Host = Resource = string()
Returns the JID of all opened sessions.
get_vh_session_list/0
get_vh_session_list(Host) -> [JID]
* JID = {Username, Host, Resource}
* Username = Host = Resource = string()
Returns the JID of all opened sessions on a virtual host.
dirty_get_my_sessions_list/0
dirty_get_my_sessions_list() -> [{SID, JID, User, Priority}]
* SID = {Time, pid()}
* Time = {MegaSecs, Secs, MicroSecs} (see erlang:now/0)
* JID = {Username, Host, Resource}
* User = {Username, Host}
* Username = Host = Resource = string()
* Priority = integer()
Returns all the opened sessions.
The second element of SID is the PID of the opened connection.
