Globally Routable User Agent URIs (GRUUs) in SIP



The SIP URI in the “Contact” header field of the SIP message, refers to a specific device. This URI should be global (can be used by anyone on the internet) otherwise the call will not be established to that device. This address will be mapped to what is called Address of Record (AOR) after the registration of the user. This mapping will be stored in a database accessed by the registrar/proxy.

Address of Record (AOR): This address represents the user. This address does not have a dependency on any device. So this address can move between devices and can be associated with multiple devices at the same time. Example: This is seen in the From, To, and (generally) Request-URI header field.

Contact Address: This address is associated with a particular device (<=> user agent). Examples:, sip:binan@IP-Address, or just sip:IP-Address. This address is seen in the Contact header field of the SIP message.  If the client is behind a NAT,  then a client-based or server-based procedure must be taken to fix the IP address.

Association between AOR and Contact Addresses

The SIP client sends REGISTER SIP Request to the registrar/proxy to temporarily associate its contact address with the user AOR. In this way the proxy can route the SIP requests (that are sent to the AOR) to the associated device. The mapping between AOR and the device is stored in the database of the registrar/proxy. The user needs to periodically send REGISTER Request to maintain this association or update it. In SIP a single user (<=> one AOR) can have a number of user agents (<=> number of contact addresses).

Why GRUU ?

GRUU is a SIP URI points to specific user agent. In this way we can route a call (sent to an AOR) to a specific user agent. For example a call with Request-URI = ;gr=urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6 will be routed to the contact address associated with gr parameter . The gr parameter is an index points to the contact address of the user agent who is registered for this GRUU.

Creation of a GRUU URI -Example

The GRUU is a SIP URI created by the Registrar/Proxy of the domain.The UAC includes “Supported:gruu” header field in a REGISTER request and provides an instance ID in the “+sip.instance” Contact header field parameter. For example the REGISTER SIP request can look like:

Via: SIP/2.0/UDP;branch=z9hG4bKnashds7
Max-Forwards: 70
From: binan <>;tag=a73kszlfl
Supported: gruu
To: binan <>
Call-ID: 1j9FpLxk3uxtm8tn@
Contact: <>
Content-Length: 0

The proxy/registrar uses the Instance-ID , generates the gruu, and send it in the response. This is the response:

SIP/2.0 200 OK
Via: SIP/2.0/UDP;branch=z9hG4bKnashds7
From: binan <>;tag=a73kszlfl
To: binan <> ;tag=b88sn
Call-ID: 1j9FpLxk3uxtm8tn@
Contact: <>
Content-Length: 0

The  “temp-gruu” and “pub-gruu” are “Contact” header field parameters.

  • The “pub-gruu” It exposes the underlying AOR. Constructed by setting the Instance-ID as a value of the “gr” parameter. It is valid as long as the registration is refreshed.
  • The “temp-gruu” changes each time the registration is refreshed. It hides the underlying AOR.

OpenSIPS GRUU Support

OpenSIPS Registrar module includes GRUU support. I would like to mention two important issues:

  • When OpenSIPS receives a SIP REGISTER Request like the one in the example above, the function save() will be called. Upon calling this function, the Instance-ID (f81d4fae-7dec-11d0-a765-00a0c91e6bf6) and the contact address ( in the user Location table. Then it generates the gruu, and send it in the response.
  •  When OpenSIPS receives a call (INVITE Request) in its domain, it checks the Request-URI. If the Request-URI is a GRUU (pub-gruu or temp-gruu), the proxy will route the request just to the contact address indexed by the Instance-ID. Using gr parameter as an index for user location table.

More Information

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s