Direct SIP Explained

How does direct SIP work?

The way direct SIP calls are initiated is very similar to the way sending an email works. A caller can call a callee from either a stand alone SIP phone which is not registered to any SIP server, to a VoIP provider, or from a SIP phone registered to an IP PBX, 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”. Once the SIP server’s IP Address is resolved, the caller’s soft phone initiates a SIP session with the SIP server responsible for the domain “voipproducts.org”. Alternatively, 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 SIP “INVITE” 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 identify the SIP Server responsible for the domain “voipproducts.org”, and then initiates a SIP session with this SIP server.

How do SMTP and SIP delivery mechanisms compare?

Notice that SIP Addresses have exactly the same structure as Email Addresses. It is possible (probably desirable) for a user’s Email Address and SIP Address to be the same. This does not mean that the Mail Server will be required to also handle SIP Calls, but that the same user@host format can be used to address different services, processed by different hosts. To ease understanding the mechanisms behind Direct SIP Calls, a quick overview of email delivery, drawing parallels with the mechanisms for Direct SIP Calls, will be useful.

Assumptions:

  • Client is: “101@testdomain.com”.
  • SMTP Server Addresses are: “smtp.testdomain.com”, “192.168.1.4”, “212.50.1.1”.
  • SMTP Server local domain: “testdomain.com”.
  • SIP Server Addresses are: “sip.testdomain.com”, “192.168.1.3”, “212.50.1.2”.
  • SIP Server local domain: “testdomain.com”.
Action Email SIP
1 Client delivers a message to Server for forwarding – destination “robert@contoso.com” Client connects to SMTP Server (directly) and delivers a message to an unknown (non-local) user “robert@contoso.com” Client connects to a SIP Server (directly) and delivers a message to an unknown (non-local) user “robert@contoso.com”
2 Server Identifies destination domain as non-local Server identifies destination domain “contoso.com”, as being non-local Server identifies destination domain “contoso.com”, as being non-local
3 Server Identifies whether the destination domain provides the requested service Server makes a DNS search for an MX record for “contoso.com”. The MX record is a specific record for “Mail eXchanger”. Server makes a DNS search for an SRV record for “_sip._udp.contoso.com” or “_sip._tcp.contoso.com”. SRV records are non-service-specific, so the “_sip._udp” and “_sip._tcp” prefixes are what identify the service
4 Server Identifies which host provides the requested service Server retrieves the FQDN for the Mail Exchanger for “contoso.com” with the highest priority from step 3. The FQDN returned could be “smtp.contoso.com” Server retrieves the FQDN for the SIP Server for “contoso.com” and listening port number (unlike SMTP, this is variable for SIP) with the highest priority and weight from step 3. The FQDN returned could be “sip.contoso.com”
5 Server identifies the IP Address for the host which provides the required service Server makes a DNS search for an A record for “smtp.contoso.com” to retrieve the IP Address assigned to this FQDN. The IP Address returned could be “213.165.99.201” Server makes a DNS search for an A record for “sip.contoso.com” to retrieve the IP Address assigned to this FQDN. The IP Address returned could be “213.165.99.202”
6 Server contacts the host providing the service for the destination domain to deliver the message Server initiates an SMTP session with “smtp.contoso.com” by contacting IP Address “213.165.99.201” Server initiates a SIP session with “sip.contoso.com” by contacting IP Address “213.165.99.202”

Setting up 3CX Phone System to send Direct SIP Calls

  1. In the management console, go to “Settings” > “Network” > “FQDN” > “Settings for Direct SIP Calls”.Settings for Direct SIP Calls
  2. Enable the “Allow calls from/to external SIP ULRs” checkbox – this is sufficient to allow a registered extension to make a call to some external SIP Address through the PBX.

Setting up 3CX Phone System and DNS SRV Records to receive Direct SIP Calls

  1. Identify your local domain name for handling Incoming Direct SIP Calls – say “testdomain.com”.
  2. You will need access to the administrative tools for your domain name to add some DNS entries.
    a) If you are using the Windows DNS Server, launch the DNS Management Console by going to “Start” > “Programs” > “Administrative Tools” > “DNS”.DNS Manager
    b) Expand the “Forward Lookup Zones” node, and right-click on the “testdomain.com” entry. In the shortcut menu, select the “Other New Records” option.

    Resource Record Type
    New Resource Record

    c) Create a new “SRV” record for domain “testdomain.com” as follows: “_sip._udp.testdomain.com” with priority “20”, weight “1”, port “5060” (this value must match your setting in “General Settings” > “Ports Configuration” > “SIP Port”), host “sip.testdomain.com”.

    DNS Manager
    New Host

    d) Create a new “A” record for host “sip.testdomain.com” to point to IP Address “212.50.1.2”.

    Test domain for SIP Calls

  3. In the management console, go to “Settings” > “Network” > “FQDN” > “Settings for Direct SIP Calls”. Enter your “Local SIP domain” as “testdomain.com” – this will allow the PBX to determine whether incoming Direct SIP calls are actually intended for it or not, and will drop calls which are incorrectly addressed. So if an incoming Direct SIP call is received, and the destination domain is not “testdomain.com”, the PBX will reject the call as unauthorised. This is sufficient to allow incoming calls to reach extensions using their numeric address. So for example, an incoming Direct SIP Call to “103@testdomain.com”.SIP ID Field
  4. To enable “email-address-style” addressing, to accept incoming Direct SIP Calls for “@testdomain.com” for example, where Tomas’ extension number is 103, go to “Extensions”, click on extension “103”, go to “Options”, and set the SIP ID field to “tomas”.

Setting up 3CX Phone System and DNS A Records to send and receive Direct SIP Calls (without SRV records)

Note that this implies that you can only receive incoming Direct SIP Calls for standard SIP URIs on the standard port for SIP – port 5060. The only way to receive Direct SIP Calls on some other port is for the remote party to specify the destination with the port number appended to the SIP URI – for example “tomas@sip.testdomain.com:5070”

  1. Identify your local domain name for handling incoming Direct SIP Calls – say “sip.testdomain.com”.
    DNS Manager
    New Host
  2. You will need access to the administrative tools for your domain name to add some DNS entries – Create a new “A” record for host “sip.testdomain.com” to point to IP Address “212.50.1.2”.
    SIP Test Domain
  3. In the management console, go to “Settings” > “Network” > “FQDN” > “Settings for Direct SIP Calls”. Enter your “Local SIP domain” as “sip.testdomain.com” – this will allow the PBX to determine whether incoming Direct SIP Calls are actually intended for it or not and will drop calls which are incorrectly addressed. So in an incoming Direct SIP Call is received and the destination domain is not “sip.testdomain.com”, the PBX will reject the call as unauthorised. This is sufficient to allow incoming calls to reach extensions using their numeric address. For example, an incoming Direct SIP Call to “103@sip.testdomain.com”
    SIP ID Field
  4. To enable “email-address-style” addressing, to accept incoming Direct SIP Calls for “tomas@sip.testdomain.com” for example, where Tomas’ extension number is 103, go to “Extensions”, click on extension “103”, go to “Options”, and set the SIP ID field to “tomas”.
  5. If the PBX is set to listen on any port other than the default SIP Port 5060, it will be necessary in this scenario for the remote caller to specify the destination user with, additionally, the port number that the PBX Server is listening on. So in the case that the PBX is listening on port 5070, the remote caller must call “tomas@sip.testdomain.com:5070” or “103@sip.testdomain.com:5070”.

Liked this article?


Get notified of new articles
or share
You might also be interested in: