How do I configure direct SIP Calls?

A Brief introduction to Direct SIP Calls, and how to set up 3CX Phone System to handle Direct SIP Calls.

What is a SIP Call?
In any SIP context, any SIP Phone has a SIP Address – 101@192.168.1.3 for example. This means that for some entity with host IP Address “192.168.1.3”, user “101” is an identifiable user, or phone. So basically, if some other user, say “102”, also identifiable to the same entity with host IP Address “192.168.1.3”, wants to contact user “101”, he may simply ask the entity “192.168.1.3” (or some other entity related to 192.168.1.3 and sharing a common list of known users) to connect him to user “101@192.168.1.3”. This is basic addressing in a local context, with the host at IP Address “192.168.1.3” being the common reference point.

Essentially this describes the standard functionality of a SIP IP PBX. User 101 comes online and tells the PBX (192.168.1.3) that it's ready to handle calls. User 102 comes online and tells the PBX that it's ready to handle calls. User 102 makes a call, via the PBX, to “101@192.168.1.3”. The PBX, having been notified by user 101 that it's ready to receive calls, knows the identity and status of user 101, and will proceed to connect the call.

What is a Direct SIP Call?
A Direct SIP Call is essentially a call from some SIP user to another SIP user who is not locally identifiable. So this is either:

  1. A call from a stand-alone phone (not registered to any PBX) to a remote PBX that is listening for Direct SIP Calls.
  2. A call from a phone, connected to a PBX, making a call to some destination where the host address is not local for the PBX. So if the PBX knows it's local host addresses to be “192.168.1.3” or “testpbx.co.uk”, and extension 101 makes a call to “adrian@somepbx.com”, the PBX will recognise that “somepbx.com” is not a local address and will attempt to connect the call as a Direct SIP Call.

How do SMTP and SIP delivery mechanisms compare?
Notice that SIP Addresses have exactly the same structure as Email Addresses. Indeed, it is possible (indeed 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

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 “General Settings” => “Settings for Direct SIP Calls


  2. Enable the “Allow calls 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 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”

    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.

    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”



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

  3. In the management console, go to “General Settings” => “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 “101@testdomain.com”.

  4. To enable “email-address-style” addressing, to accept incoming Direct SIP Calls for “edward@testdomain.com” for example, where Edward's extension number is 101, go to “Extensions” => “Manage”, click on extension “101”, go to “Other Options” in the “Edit Extension” page, and set the SIP ID field to “edward”.

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 “edward@sip.testdomain.com:5070”

  1. Identify your local domain name for handling incoming Direct SIP Calls – say “sip.testdomain.com”




  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”


  3. In the management console, go to “General Settings” => “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. So for example, an incoming Direct SIP Call to “101@sip.testdomain.com


  4. To enable “email-address-style” addressing, to accept incoming Direct SIP Calls for “edward@sip.testdomain.com” for example, where Edward's extension number is 101, go to “Extensions” => “Manage”, click on extension “101”, go to “Other Options” in the “Edit Extension” page, and set the SIP ID field to “edward”.
  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 “edward@sip.testdomain.com:5070” or “101@sip.testdomain.com:5070”.

General 3CX Phone System FAQs