Direct SIP explained (Direct SIP URI dialing).
If your telecom solution is running an IP PBX, it is possible to have your telephone "number" identical to your email address. People using SIP based VOIP phones can call you by using your email address as dialing property. Such solution is called direct SIP or direct SIP URI (Uniform Resource Indicator) dialing.
How does direct SIP work?
The way direct SIP calls are initiated is very similar to the way sending of email works. A caller can call a callee from a stand alone SIP phone which is not registered to any SIP server or VOIP provider and also from a SIP phone registered to an IP PBX or VOIP provider which supports direct SIP.
If a user calls robert@voipproducts.org from a stand alone SIP phone, the caller's soft phone makes appropriate DNS queries to resolve the address of the SIP server responsible for SIP based VOIP calls to voipproducts.org. On the SIP server's address resolution, the caller's soft phone initiates a SIP session with the SIP server responsible for the domain voipproducts.org.
Else, if a user calls robert@voipproducts.org from a SIP phone registered to an IP PBX or VOIP provider that supports direct SIP, when the SIP server receives the INVITE SIP message to initiate the call, it recognizes that the domain voipproducts.org is not local for the SIP server itself and makes the appropriate DNS queries to initiate a SIP session with the SIP server responsible for the domain voipproducts.org.
DNS Resolution of a Direct SIP call
To support direct SIP calls, a SIP entity must have at least 1 SRV record that resolves to the host name of the SIP server responsible for incoming SIP based VOIP calls. Such SRV record typically also includes other details such as the type of service, SIP port, priority of record and weight (when multiple records are specified) and other standard DNS SRV records information.
An example of a direct SIP SRV record
_sip._udp.voipproducts.org
From the above SRV record we can retrieve information such as:
- _sip: The type of service such record is for.
- _upd: The internet protocol used as transport for the above specified protocol.
- voipproducts.org: The domain such record is advertising.
An example of a DNS server response to a SIP SRV record query
_sip._udp.voipproducts.org. 86400 IN SRV 10 5 5060 sip.voipproducts.org
From the reply specified above we retrieve information such as:
- _sip._udp.voipproducts.org: The SRV record being queried.
- 86400: Time To Live (TTL) of the record.
- 10: Priority of record. When multiple SIP SRV records are specified, the lowest priority number record is contacted first.
- 5: Weight of record. Load equality for records with the same priority number.
- 5060: Port number to be used when trying to initiate a SIP session.
- sip.voipproducts.org: Host(A) record of host providing the service, i.e. the SIP server responsible for incoming SIP VOIP calls for the domain voipproducts.org.
Manually querying a DNS server for SIP SRV records
A user can query a DNS server manually for a domain's SIP SRV records by using a DNS querying tool, such as nslookup. Once nslookup is run, we instruct the server to query for SRV records and specify which SRV record we are looking for as shown in the example below:
> set q=srv
> _sip._udp.voipproducts.org
- set q=srv: Instructing the DNS server to query for SRV records.
- _sip._udp.voipproducts.org: The SRV record we are querying.
DNS server's response:
Server: server1.voipproducts.org
Address: 65.111.185.13
_sip._udp.3cx.com SRV service location:
priority = 10
weight = 1
port = 5060
svr hostname = sip.voipproducts.org
As we can see, the above record includes the queried record, the record priority and weight, the SIP port number used for the SIP service and the hostname of the server offering such service.
Note:
- Most commercial SIP clients, by default query for both TCP (_sip._tcp) and UDP (_sip._udp_) records.
- When a SRV record is not found for the domain in question, the client will automatically query for the host(A) record of the domain in question and tries to connect to the resolved IP directly on port 5060.
- If port number is not specified in the SIP SRV record, the default port value is used, in SIP protocol's case, port 5060.
Making a call from a standalone SIP phone
The process described below, is a step by step description of what happens when a user calls robert@voipproducts.org from a stand alone SIP phone (not registered to any IP PBX or VOIP provider).
- SIP client sends a DNS query for the SRV records of voipproducts.org, in this case _sip._udp.voipproducts.org.
- From the DNS server response, the SIP client knows which port to use (5060) and the hostname (sip.voipproducts.org) of the server offering such service.
- The SIP client sends another DNS query to resolve to IP the server's hostname, in this case sip.voipproducts.org.
- Once the hostname is resolved to an IP, the SIP client initiates a SIP based VOIP call to the server's IP on port 5060.
Making a call from a registered SIP phone
The process described below, is a step by step description of what happens when a user calls robert@voipproducts.org from a SIP phone which is registered to an IP PBX or VOIP provider which supports direct SIP.
- SIP client sends an INVITE request to the IP PBX it is registered to, to initiate a call to robert@voipproducts.org.
- IP PBX determines that voipproducts.org is not a local domain and sends a DNS query for the SRV records of voipproducts.org, in this case _sip._udp.voipproducts.org.
- From the DNS server response, the IP PBX knows which port to use (5060) and the hostname (sip.voipproducts.org) of the server offering such service.
- The IP PBX sends another DNS query to resolve to IP the server's hostname sip.voipproducts.org.
- Once the hostname is resolved to an IP, the IP PBX initiates a SIP based VOIP call to the server's IP on port 5060.
- Once the SIP call is established (including negotiation of RTP codec to use), RTP audio streams are sent between the caller's SIP client and the callee's SIP client registered on the remote IP PBX sip.voipproducts.org.
Control of direct SIP calls on IP PBX
In most IP PBX's the administrator specifies a list of SIP domains the PBX should treat as local domains and accept calls for. Therefore if a call from a registered SIP entity is initiated, the IP PBX determines to where to route such call, if to forward it to another internal registered extension or to an external SIP entity if the domain is not local.
Similar control checks are done on incoming direct SIP calls. If an incoming direct SIP call is sent to an IP PBX and the domain is local, it routes the call to the desired internal registered extension. If the domain is not local for the IP PBX, it drops the call. This also serves as a check not to relay unauthorized direct SIP VOIP calls through an IP PBX.