[OpenSIPS-Users] USRLOC and dbmode

Andrew Yager andrew at rwts.com.au
Sun Jul 26 07:24:35 CEST 2009


Hi,

We are running opensips 1.5.2-notls, and have usrloc working well in  
theory.

We are trying to set up replication to a second opensips server, with  
one of two methods:

* DB Replication only (usrloc db_mode 3) OR
* t_replicate (with usrloc db_mode 2)

We are running into issues with this. When we set usrloc db_mode to 3,  
nothing is written to the database. In addition, opensipsctl ul show  
lists no registrations.

When we set usrloc db_mode to 2, things appear to be randomly written.  
For instance, this host has six peers which registered against it at  
present. There are currently only 4 of the six peers in the location  
table in MySQL.

Also, I am starting to think that you can't get t_replicate to work  
when REGISTER methods require auth, as the necessary exchange of  
digest tokens can not take place. Perhaps I need to move the order of  
the operations, and only radius authorize if it not a replicated  
request?

Relevant snippets from config are below, any help will be appreciated.

Thanks,
Andrew

---

modparam("usrloc", "db_mode",   2)
modparam("usrloc", "db_url",
         "mysql://opensips:<password>@localhost/opensips_1_5")

modparam("alias_db|auth_db|usrloc|uri_db", "use_domain", 1)

if (is_method("REGISTER")) {
     # authenticate the REGISTER requests (uncomment to enable auth)
	if (!radius_www_authorize("")) {
	    www_challenge("", "0");
	    exit;
	}

	if (!check_to())
	{
	    sl_send_reply("403","Forbidden auth ID");
	    exit;
	}

	if ( !(src_ip=="PEER_IP" && src_port==5060) ) {
	    # Register is for me
	    if (!save("location")) {
	            sl_reply_error();
	            exit;
	    }
	    t_replicate("sip: PEER_IP:5060"); # send to the other sip server
	} else {
		# it's a replicated REGISTER
		# set the flag for retrieving sock_info from header
		# save contact, but only in cache
		save("location","0x01");
	};
	exit;
};

--
Andrew Yager, Managing Director   (MACS BCompSc MCP)
Real World Technology Solutions Pty Ltd, your IT department
ph: 1300 798 718 or (02) 9037 0500
fax: (02) 9037 0591 mob: 0405 152 568
http://www.rwts.com.au/ or http://www.stonebridgecomputing.com.au/




More information about the Users mailing list