Forwarding events to your xmpp domain ( jid lookup service )

mpermar edited this page Sep 15, 2011 · 3 revisions

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.

Examples

Imagine that you call a SIP endpoint like sip:usera@server1.com but you want to redirect this events to your own XMPP Server server2.com:

.*@server1.com=anuser@server2.com 

The truth is that the example above will redirect any inbound traffic targeted to server1.com to anuser@server2.com. But imagine that you want to redirect usera to server2.com and userb to server3.com:

.*usera@server1.com=anuser@server2.com 
.*userb@server1.com=anuser@server3.com 

Right. Imagine now that you want to setup another rule so every other user at server1.com is redirected to server4.com:

.*usera@server1.com=anuser@server2.com 
.*userb@server1.com=anuser@server3.com 
.*@server1.com=anuser@server4.com 

Finally, we could add a default rule to redirect all traffic that is not targeted to server1.com to server5.com

.*usera@server1.com=anuser@server2.com 
.*userb@server1.com=anuser@server3.com 
.*@server1.com=anuser@server4.com 
.*=anuser@server5.com