TryLearn More

Use SIP trunks, WebRTC & Apps

Slash your Phone Bill by 80%

Configuring 3CX for Direct SIP (Session Initiation Protocol)

Configuring 3CX for Direct SIP (Session Initiation Protocol)

Introduction to Direct SIP

SMTP and SIP Delivery Mechanism Comparison

Setting up 3CX for Direct SIP Calls

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

Set up 3CX and DNS A Records to send and receive Direct SIP Calls - without SRV records

Enable “email-address-style” Addressing for Direct SIP Calls

Introduction to Direct SIP

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 (Voice-over-IP) provider, or from a SIP phone registered to an IP PBX (Private Branch Exchange), which supports direct SIP. If for example, 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 (Domain Name System) queries to identify the SIP Server responsible for the domain voipproducts.org, and then initiates a SIP session with this SIP server.

SMTP and SIP Delivery Mechanism Comparison

SIP addresses have exactly the same structure as Email addresses. It is possible and probably desirable for a user’s Email address and SIP address to be the same. The same address however 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 or services. To simplify the understanding of the mechanisms behind Direct SIP Calls, a quick overview of email delivery is useful in drawing parallels with the mechanisms for Direct SIP Calls.

Assumptions:

  • Client address 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.

Step

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 does a DNS search for an MX record for “contoso.com”. The MX record is a service specific record for “Mail eXchanger” used for mail communication via SMTP (Simple Mail Transfer Protocol).

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 (MX) 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 for Direct SIP Calls

  1. In the management console, go to Settings > Network > FQDN > Settings for Direct SIP Calls.

  1. Enable the Allow calls from/to external SIP URIs checkbox – this is sufficient to allow a registered extension to make a call to some external SIP Address through the PBX.

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

To enable 3CX to receive Direct SIP calls we need to first configure SRV and A records for the domain’s DNS service and then configure the relevant 3CX system settings. The following procedure is based on a Windows Server DNS service setup:

  1. Identify your local domain name for handling Incoming Direct SIP Calls – say “testdomain.com”.
  2. You need access to the administrative tools for your domain name to add the DNS entries.
  1. If you are using the Windows DNS Server, launch the DNS Management Console by going to “Start” > “Programs” > “Administrative Tools” > “DNS” (for Windows Server 2012) or “Start” > “Windows Administrative Tools” > DNS (for Windows Server 2016) .

  1. Expand the Forward Lookup Zones node, and right-click on the testdomain.com entry. In the shortcut menu, select the Other New Records option.

  1. Create a new SRV record for domain testdomain.com as _sip._udp.testdomain.com with priority 20, weight 1, port 5060 (this value must match your setting in General Settings > Ports Configuration > SIP Port in the 3CX Management Console), host sip.testdomain.com (see screenshots above).

  1. Create a new A record for host sip.testdomain.com to point to the IP Address 212.50.1.2 (see screenshots above).

  1. In the Management Console, go to Settings > Network > FQDN > Settings for Direct SIP Calls and enter the Local SIP domain value as testdomain.com – this enables the PBX to determine whether incoming Direct SIP calls are intended for this domain and drop  incorrectly addressed calls. In this way, when an incoming Direct SIP call is received and the destination domain is not testdomain.com, the PBX rejects 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.

Note: See relevant section below to enable “email-address-style” addressing for incoming Direct SIP Calls.

Set up 3CX and DNS A Records to send and receive Direct SIP Calls - without SRV records

To send and receive Direct SIP calls without SRV records 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 address with the port number appended to the SIP URI – for example tomas@sip.testdomain.com:5070

  1. Specify your local FQDN for handling incoming Direct SIP Calls – for example sip.testdomain.com.

  1. Create a new A record for host sip.testdomain.com to point to IP Address 212.50.1.2. To do this you need access to the administrative tools for your domain name to add the DNS entry (see screenshots above).

  1. In the management console, go to Settings > Network > FQDN > Settings for Direct SIP Calls and enter the Local SIP domain value as sip.testdomain.com (see screenshot above) – this enables the PBX to determine whether incoming Direct SIP calls are intended for this domain and drop  incorrectly addressed calls. In this way, when an incoming Direct SIP call is received and the destination domain is not sip.testdomain.com, the PBX rejects 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.

Enable “email-address-style” Addressing for Direct SIP Calls

To enable email-address-style addressing and accept incoming Direct SIP Calls for tomas@testdomain.com for example, where Tomas’ extension number is 103, go to Extensions, double-click extension 103 to edit, go to Options and set the SIP ID field value to tomas  (see screenshot above).

Note: If the PBX is set to listen on a port other than the default SIP port 5060, it is necessary for the remote caller to specify the destination address, appended with the port number that the PBX Server is listening on. So if the PBX is listening on port 5070, the remote caller must use tomas@testdomain.com:5070 or 103@testdomain.com:5070 as destination for the call to succeed.

Get 3CX Free today

Download On-Premise or Try in the Cloud