150 likes | 575 Views
SER Module . Speaker: Chin-Chang Chang Date:2007.5.7. Outline . Registrar module Msilo module Demo Reference. Registrar module(1/7). This module contains REGISTER processing logic. The usrloc and sl module must be loaded before this module. Registrar module(2/7). Parameters
E N D
SER Module Speaker: Chin-Chang Chang Date:2007.5.7
Outline • Registrar module • Msilo module • Demo • Reference
Registrar module(1/7) • This module contains REGISTER processing logic. • The usrloc and sl module must be loaded before this module.
Registrar module(2/7) • Parameters • default_expires(integer) This value will be used if the message don’t contain Expires HFs and expires contact parameters. • Ex. modparam(“registrar”, “default_expires”, 1800) • min_expires(integer) • max_expires(integer)
Registrar module(3/7) • default_q(integer) • This parameter represents default q value for new contacts.The value in parameter is divided by 100 and stored as float. • Default value is 0. • Ex. Modparam(“registrar”, ”default_q”, 100) • append_branches(integer) • This parameter controls lookup function processes multiple contacts. If this parameter is set to 1, Request-URI will be overwritten with the highest-q rated contact and the rest will be appended to sip_msg structure. • Ex. modparam (“registrar”, “append_branches”, 0)
Registrar module(4/7) • case_sensitive(integer) • If set to 1 then AOR comparison will be case sensitive. • Default value is 0. • Ex. modparam (“registrar”, “case_sensitive”, 1) • max_contacts(integer) • This parameter can be used to limit the number of contacts per AOR in the user location database. Value 0 disables the check. • Default value is 0. • Ex. modparam(“registrar”, ”max_contacts”, 10)
Registrar module(5/7) • use_domain(integer) • If this parameter is set to 1, this registrar will use username@domain as address of record. If it is set to 0, then only the username is used as the address of record. • Default value is 0. • Functions • save(domain) • “domain” is the name of the table. • The function processes a register message. It can add, remove or modify usrloc records depending on Contact and Expires HFs in the REGISTER message. • Ex. save("location");
Registrar module(6/7) • lookup(domain) • This function extracts username from R_URI and tries to find all contacts for the username in usrloc. • The functions extracts username from Request-URI and tries to find all contacts for the username in usrloc. If there are such contacts, Request-URI will be overwritten with the contact that has the highest q value and optionally the rest will be appended to the message (depending on append_branches parameter value). • If there are no such contacts, -1 will be returned. • Ex. Lookup(“location”);
Registrar module(7/7) • registered(domain)This function checks if the AOR in the R-URI is registered or not. • Ex. If (registered(“location”)){ sl_send_reply(“100”, “Trying”); 。。。 };
Msilo module(1/4) • The module provides offline storage for SER.It stores received messages for an offline user and sends them when the user becomes online. • Two modules must be loaded before this module. • Database module • Transaction module(TM)
Msilo module(2/4) • db_url(string) • Database URL. • Default value is "mysql://root@localhost/msilo". • Ex. modparam("msilo", "db_url", "mysql://user:passwd@host.com/dbname") • registrar(string) • The SIP address used to inform users that destination of their message is not online and the message will be delivered next time when that user goes online. • modparam("msilo", "registrar", "sip:registrar@iptel.org")
Msilo module(3/4) • db_table (string) • The name of table where to store the messages. • Default value is “silo”. • Ex. modparam(“msilo”, “db_table”, “silo”) • expire_time(integer) • Expire time of stored messages – seconds. When this time passed, the message is silently discarded from database. • Default value is “2597200(3 days)”. • Ex. modparam(“msilo”, ”expire_time”, 36000)
Msilo module(4/4) • m_store(mode) • The method stores certain parts of the current SIP request • mode - specifies what to save as R-URI. • "0" - first check if new_uri is an address of record. If yes, then use it and store it as R-URI, otherwise look at R-URI and, if necessary, at URI from "To" header. • "1" - look first at R-URI and then at URI from "To" header. • "2" - look only at URI form "To" header • m_dump(mode) • The method sends stored messages for the SIP user that is going to register to his actual contact address.
Demo • demo
Reference • Registrar module http://www.iptel.org/ser/doc/modules/registrar • Msilo module http://www.iptel.org/ser/doc/modules/msilo