http://www.geekingabout.com/using-the-opensips-registrant-module.html
he ‘Registrant’ module was recently added to the openSIPS code base and allows openSIPS to REGISTER with a Registrar using SIP accounts configured in a database table. The Contact address can either be set to openSIPS itself or to some other SIP URI which is super useful when needing to interface with devices that do not allow static routing or static locations.
Load the modules:
loadmodule "uac_auth.so" loadmodule "uac_registrant.so"
Configure the module
modparam("uac_registrant", "hash_size", 2) modparam("uac_registrant", "timer_interval", 100) modparam("uac_registrant", "db_url", "mysql://opensips:opensipsrw@localhost/opensips") modparam("uac_registrant", "table_name", "registrant")
Insert a record into the opensips.registrant table, an example:
INSERT INTO opensips.registrant ( registrar, proxy, aor, third_party_registrant, username, password, binding_URI, binding_params, expiry, forced_socket ) VALUES ( 'sip:10.10.10.10', '', 'sip:username@10.10.10.10', '', 'username', 'password', 'sip:username@10.10.10.99', 'transport=UDP', 300, '' );
Note that the default value for some fields is NULL but openSIPS does not seem to like it when you use NULL values. Use empty strings instead as I have done above.
The registrant module will maintain the registrations but does not reload the entries from DB periodically and so you will need to do this via the command line:
opensipsctl fifo reg_reload
You can view the records from the DB using the command:
opensipsctl registrant show
You can show the registration state of registrants using:
opensipsctl registrant dump