Forwarding events to your xmpp domain ( jid lookup service )
Clone this wiki locally
Rayo Server's JID Lookup Service lets you redirect Rayo events to your own XMPP domain which is specially useful for Server To Server (S2S) communication.
The main implementation of the Rayo JID Lookup Service is based on Regexp. It lets you create redirection rules using Regexp expressions. Once an event comes into the system, the Rayo Server will go through the different redirection rules that are defined and when a matching rule is found it will take care of redirecting that event to the appropriate XMPP domain.
Adding your custom rules
To add your custom rules you need to edit the rayo-routing.properties properties file. On a Rayo Server installation you can find this file in the $PRISM_HOME/apps/rayo/WEB-INF/classes directory.
The file is based Java's Regexp syntax. It should be straightforward enough but should you have any issues do not hesitate to check the official documentation here. Also remember that rayo-routing.properties is a Java properties file and any line starting with '#' is considered a comment.
Imagine that you call a SIP endpoint like sip:firstname.lastname@example.org but you want to redirect this events to your own XMPP Server server2.com:
The truth is that the example above will redirect any inbound traffic targeted to server1.com to email@example.com. But imagine that you want to redirect usera to server2.com and userb to server3.com:
Right. Imagine now that you want to setup another rule so every other user at server1.com is redirected to server4.com:
.*firstname.lastname@example.orgemail@example.com .*firstname.lastname@example.orgemail@example.com .*@firstname.lastname@example.org
Finally, we could add a default rule to redirect all traffic that is not targeted to server1.com to server5.com
.*email@example.comfirstname.lastname@example.org .*email@example.comfirstname.lastname@example.org .*@email@example.com .*=firstname.lastname@example.org