<%@ Page Language="VB" %> Feptias Advice Centre: SIP Registration
Registration - what it is and why it is necessary
IP Phones (and SIP clients in general) need to register with a central server mainly because this allows the phone's location to be known when it needs to receive incoming calls. The "location" is identified by an IP address and port number where SIP messages may be sent by peers that need to communicate with the device. In some cases the IP address might be permanent and fixed, in which case registration would not be essential, but for most IP phones the address can change from day to day. This might be because the device is on a LAN and receives it's IP address from a local DHCP server; it might be because the device is installed at the user's home connecting to the Internet through a broadband ADSL or cable connection which uses dynamic IP addresses; it could also be because the device is mobile and sometimes it connects through the home Internet connection, other times through the office LAN or a wireless connection, maybe even using a public Wi-Fi hot spot or Internet service provided in a hotel.

No matter where your IP phone is physically located, you probably want it to be able to receive calls. The registration process, which is normally initiated as soon as the phone is switched on, allows the phone to register its location in a central database called a Location Server. The server it uses for the registration process is called a Registrar Server and the exchange of messages that enables registration to happen is defined as part of the SIP protocol. To summarise, the IP phone will send a REGISTER request to the Registrar Server. The Registrar Server will ensure that the user credentials sent are correct, then update the Location Server database and send a "200 Ok" response back to the phone. Most IP phones will automatically repeat the registration process every 30 minutes for reasons explained in the next paragraph.

Registration expiry
Ideally, when you disconnect or switch off an IP phone (or other SIP client) you would want it to unregister itself. However, in practice for many devices this is difficult to achieve because the device stops functioning as soon as power is removed. One exception would be if you are using a softphone - most softphones are able to unregister  as part of the shutdown sequence of the softphone application. For the benefit of those devices that do not unregister, Location Servers set an expiry time against every record. This is usually set at about 1 hour. If the Client device does not re-register within the expiry time, then the record is automatically deleted. This allows the location server to maintain a reasonably accurate picture of all the Client registrations by ensuring stale data is not left in the database for too long.

SIP Servers may want to register too
It is not uncommon for SIP servers to use registration as a way of confirming their location thereby allowing them to receive incoming calls from other servers. This is an option within Asterisk - it can be configured to register itself as if it were a SIP Client, by adding a line to the SIP.CONF file.