9. Examples

This section is under construction...

I found a bug during testing sample configs - one TM module change caused impossibility of sending request to predefined destination. As far as I know affected modules are presence_b2b and msilo.

9.1. Full presence server

This config file has grown from previous versions of presence server configurations. It has to be re-tested with Ottendorf and de-uglyfied. (TBD soon)

cfg/full_ps.cfg

9.2. Presence server with no authorization and without RLS

Following config file is based on demo config file installed with SER (Ottendorf). It is not finished yet. I recommend to use a variant of the config file above right now.

cfg/ps.cfg

9.3. Forwarding to presence server

It is good idea to have separated presence stuff from the proxy. You can use following piece of code for that. Instead of t_forward_nonack you can use t_forward_nonack_tcp.

Example 24. forwarding to presence server

...
# forward presence messages to presence server
if ((method=="SUBSCRIBE") || (method=="PUBLISH") || (method=="MESSAGE")) {
	log(1, "Forwarding request\n");
	
	if (!t_newtran()) {
		log(1, "newtran error\n");
		sl_reply_error();
		break;
	};
	
	if (!t_forward_nonack("presence-server.test-domain.com", "5060")) {
		log(1, "Forward to presence server failed\n");
		t_reply("500", "forward to presence server failed");
	}
	break;
};