Skip to main content

2.- SIP Addressing and URI

SIP Addressing

In SIP (Session Initiation Protocol), addressing is used to identify the endpoints of a SIP session. SIP addressing is based on the use of SIP Uniform Resource Identifiers (URIs), which are used to identify the SIP endpoints.

A SIP URI is a string of characters that identifies a SIP endpoint, similar to a URL that identifies a web page. A SIP URI has the following format:


sip:user@domain.com

The sip: prefix indicates that this is a SIP URI. The user part of the URI identifies the user or device within the domain, and the domain.com part of the URI identifies the domain name of the endpoint.

In addition to the user and domain parts of the URI, SIP URIs can also contain other parameters, such as port numbers and transport protocols. For example, a SIP URI for an endpoint using the secure transport protocol over port 5061 would look like this:

sips:user@domain.com:5061;transport=TLS

SIP addressing can also include other elements such as the SIP message header fields, which provide additional information about the session, including the address of the sender and receiver, the type of session being initiated, and other session-specific information.

The SIP addressing scheme is flexible, allowing for the identification of a wide variety of SIP endpoints, including phones, softphones, SIP servers, and other SIP-capable devices.

 

URI

A SIP URI (Uniform Resource Identifier) is a string of characters that identifies a SIP (Session Initiation Protocol) endpoint or user on the Internet or another IP network. It is similar to a URL (Uniform Resource Locator) that identifies a web page or resource, but instead of identifying a web page, a SIP URI identifies a user or device that can participate in a SIP session.

A SIP URI typically has the following format:

sip:user@domain.com

The sip: prefix indicates that this is a SIP URI. The user part of the URI identifies the user or device within the domain, and the domain.com part of the URI identifies the domain name of the endpoint.

In addition to the user and domain parts of the URI, SIP URIs can also contain other parameters, such as port numbers and transport protocols. For example, a SIP URI for an endpoint using the secure transport protocol over port 5061 would look like this:

sips:user@domain.com:5061;transport=TLS

SIP URIs can be used to initiate and terminate SIP sessions, and can be included in SIP messages to identify the sender and recipient of the message. SIP URIs can also be used to implement a variety of advanced SIP features, such as call forwarding, call transfer, and presence information.

 

Here are more examples of URI

  1. sip:[email protected] - This SIP URI identifies a SIP endpoint with the username "alice" located at the domain "domain.com". This endpoint could be a softphone application running on Alice's computer or a physical SIP phone connected to the network.

  2. sip:[email protected]:5060 - This SIP URI identifies a SIP endpoint with the username "bob" located at the IP address "192.168.1.100" and using port 5060. This endpoint could be a physical SIP phone or a SIP server running on a computer.

  3. sip:[email protected];transport=tcp - This SIP URI identifies a SIP conference server located at the domain "domain.com" that uses the TCP transport protocol. Users could dial into this conference by sending SIP INVITE messages to this URI.

In all of these examples, the "sip:" prefix indicates that this is a SIP URI. The username (e.g. "alice", "bob", "conference") identifies the endpoint or resource being addressed, and the domain (e.g. "domain.com", "192.168.1.100") identifies the network location of the endpoint. In example 2, a port number is also specified. Additionally, example 3 demonstrates how SIP URIs can contain other parameters, in this case specifying the use of the TCP transport protocol.

 

The goal of SIP addressing is to identify SIP endpoints and resources on the network for routing SIP messages.

+-------------+                       +-------------+
| User A      |                       | User B      |
| SIP Address |                       | SIP Address |
| 192.0.2.1   |                       | 192.0.2.2   |
| SIP URI     |                       | SIP URI     |
| sip:[email protected]:5060;transport=UDP | sip:[email protected]:5060;transport=UDP |
+-------------+                       +-------------+
        |                                          |
        |  INVITE                                  |
        |  sip:[email protected]:5060 SIP/2.0        |
        |  Via: SIP/2.0/UDP 192.0.2.1:5060         |
        |  From: sip:[email protected]:5060;tag=1234 |
        |  To: sip:[email protected]:5060            |
        |  Call-ID: 5678                           |
        |  CSeq: 1 INVITE                          |
        |  Contact: sip:[email protected]:5060       |
        |  Content-Type: application/sdp           |
        |  Content-Length: 150                     |
        |                                          |
        |---------------------------------------->|
        |                                          |
        |  100 Trying                              |
        |  SIP/2.0 100 Trying                      |
        |  Via: SIP/2.0/UDP 192.0.2.2:5060         |
        |  From: sip:[email protected]:5060;tag=1234 |
        |  To: sip:[email protected]:5060;tag=5678   |
        |  Call-ID: 5678                           |
        |  CSeq: 1 INVITE                          |
        |  Content-Length: 0                       |
        |                                          |
        |<-----------------------------------------|
        |                                          |
        |  200 OK                                  |
        |  SIP/2.0 200 OK                          |
        |  Via: SIP/2.0/UDP 192.0.2.2:5060         |
        |  From: sip:[email protected]:5060;tag=1234 |
        |  To: sip:[email protected]:5060;tag=5678   |
        |  Call-ID: 5678                           |
        |  CSeq: 1 INVITE                          |
        |  Contact: sip:[email protected]:5060       |
        |  Content-Type: application/sdp           |
        |  Content-Length: 150                     |
        |                                          |
        |<-----------------------------------------|
        |                                          |
        |  ACK                                     |
        |  sip:[email protected]:5060 SIP/2.0        |
        |  Via: SIP/2.0/UDP 192.0.2.1:5060         |
        |  From: sip:[email protected]:5060;tag=1234 |
        |  To: sip:[email protected]:5060;tag=5678   |
        |  Call-ID: 5678                           |
        |  CSeq: 1 ACK