# Glossary: SIP Registration

### SIP Registrar

A SIP [registrar](https://en.wikipedia.org/wiki/Session_Initiation_Protocol#Registrar)’s role is to accept REGISTER requests with an Address Of Record (URI) and write the associated contact bindings to a location service. The location service is a logical entity and is simply a database that contains a list of AOR to contact address bindings. Very often a registrar functions as a location service. It is also very common for a registrar/location service to be co-located with the proxy server for the same domain. The example below shows a typical registration transaction.

<figure><img src="https://docs.telcobridges.com/w/images/thumb/f/f7/SIP_Registration_Process.jpg/400px-SIP_Registration_Process.jpg" alt=""><figcaption></figcaption></figure>

Tmedia supports two modes for SIP Registration:

* The Tmedia forwards per-user registration requests from users
  * [Explanation of Tmedia's registration forwarding](/configuration-details/configuration-by-use-case/sip-registration-forwarding.md)
  * [Configuration of Tmedia's registration forwarding](/configuration-details/configuration-by-use-case/sip-registration-forwarding/creating-a-sip-domain.md)
* The Tmedia registers itself to the SIP Proxy (per SIP NAP, as explained below in current page)

### Registration per SIP NAP

The Tmedia supports to register a SIP [NAP](/appendices/appendix-a-glossary/glossary-nap.md) to a SIP proxy. Registration, can be used, for example, to authenticate the Tmedia Gateway IP address to a SIP provider proxy or SBC and allow the SIP traffic from the Tmedia to that SIP provider.

* Registration is when Tmedia sends a SIP REGISTER to a Registrar, and gets a response which could be accepted (200 OK) or refused (4xx reason code). Upon refusal, the registration is not stopped and is retried after 5 seconds.
* Even if there is no call on the system, Tmedia will send SIP REGISTER
* Sending SIP REGISTER will happen when the option ["Register to Proxy?"](/configuration-details/configuration-parameters-all.md#parameter-register-to-proxy) is selected for a specific SIP [NAP](/configuration-details/configuration-by-web-portal-category/network-access-points-nap.md)
* If you apply a new configuration and the option ["Register to Proxy?"](/configuration-details/configuration-parameters-all.md#parameter-register-to-proxy) is present it will start sending SIP REGISTER

#### Register with no answer from registrar

If it is not registered already, the Tmedia will send a new SIP REGISTER every 32 + 5 seconds interval until it receive a response from the Registrar

* Over UDP (shown it the message flow bellow), the REGISTER request is retransmitted for 32 seconds before the request transaction timeout, then a new SIP REGISTER is sent after 5 seconds.
* Over TCP, if the SIP registrar does not listen on the TCP port, a new TCP connection is retried every 5 seconds. If the TCP connection is established but no SIP responses returned by the Registrar, the transaction timeout after 32s and then a new SIP REGISTER is sent after 5 seconds.

<figure><img src="https://docs.telcobridges.com/w/images/thumb/c/cf/SIP_Register_no_answers.png/500px-SIP_Register_no_answers.png" alt=""><figcaption></figcaption></figure>

#### Register expire negotiation

The REGISTER request negotiate the contact binding expiration by adding "expires=3600" parameter to the contact header. The value is hardcoded to 3600 seconds. If the REGISTER response from the Registrar does not change the "expires" parameter:

* The SIP REGISTER will be "valid" for 3600 seconds
* Tmedia will send a new REGISTER (to refresh the registration) after half of the minimum registration negotiated, general use will be at 1800 seconds (3600/2)

The Registrar can change the "expires" contact parameter or the Expires header as shown in the two example below to negotiate a value different from 3600 seconds.

**Negotiation uses case 1: contact expires header**

In the example below, the Registrar changes the "expires" contact parameter.

<figure><img src="https://docs.telcobridges.com/w/images/thumb/8/88/SIP_Register_negotiated_expire_time_example_1.png/700px-SIP_Register_negotiated_expire_time_example_1.png" alt=""><figcaption></figcaption></figure>

**Negotiation uses case 2: no contact expires parameter; Expires header**

In the example below, the Registrar removes the "expires" contact parameter and set the Expires header.

[![](https://docs.telcobridges.com/w/images/thumb/a/ad/SIP_Register_negotiated_expire_time_example_2.png/650px-SIP_Register_negotiated_expire_time_example_2.png)](https://docs.telcobridges.com/wiki/File:SIP_Register_negotiated_expire_time_example_2.png)

#### Register Authentication

* If Authentication is required, the Registrar returns a 401 Unauthorized response with a WWW-Authenticate header
* The WWW-Authenticate header contains nonce to encrypt user’s communications password, user then sends a second REGISTER containing an Authorization header with the user's encrypted password

<figure><img src="https://docs.telcobridges.com/w/images/thumb/7/70/SIP_Register_401_authentication_example.png/1100px-SIP_Register_401_authentication_example.png" alt=""><figcaption></figcaption></figure>

### References

* [Wikipedia registrar article](http://en.wikipedia.org/wiki/Session_Initiation_Protocol#Registrar)
* [Understanding SIP Registration](https://andrewjprokop.wordpress.com/2014/05/29/understanding-sip-registration/)
* [VoIP Protocols:SIP Call Flow - Toncar.cz](http://toncar.cz/Tutorials/VoIP/VoIP_Protocols_SIP_Call_Flow.html)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://prosbcdocs.telcobridges.com/appendices/appendix-a-glossary/glossary-sip/glossary-sip-registration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
