Article - Talk ejabberd router
Return the list of ejabberd core modules
Router (ejabberd_router)
This module is the main router for XMPP packets on each node. It routes packets based on their destination domains. It has two tables: local and global routes. First, the destination domain of each packet is searched in local table. If found, the packet is routed to the appropriate process. Else, it searches in global table, and routes to the appropriate ejabberd node or process. If it does not exists in either tables, then the packet is sends to the S2S manager.
API
route/3
route(From, To, Packet)
* Packet = {xmlelement, Name, Attrs, SubEl}
* Attrs = [{Name, Value}]
* Name = Value = string()
* SubEl = [Packet]
Route an XML packet.
register_route/1 and unregister_route/1
register_route(Host)
unregister_route(Host),
* Host = string()
Host is the XMPP name of the route name. See the routage mechanism of services for more details.
dirty_get_all_routes/0
dirty_get_all_routes() -> [RouteName]
* RouteName = string()
Return a list of all registered route names.
dirty_get_all_domains/0
dirty_get_all_domains() -> [Domains]
* Domains = string()
Return a list of all known domains.
