TryLearn More

Use SIP trunks, WebRTC & Apps

Slash your Phone Bill by 80%

Outbound Calls

On this topic:

Outbound Calls

Structuring the INVITE message

Configurable SIP Fields

3CX Variables

AuthID

CalledName

CalledNum

CallerName

CallerDispName

CallerNum

ContactUri

DevHostPort

GWHostPort

LineId

LineNumber

OutboundCallerId

OriginatorCallerID

EnforcedOriginatorCallerID

EnforcedOutboundCallerId

OutboundLineId

OutHostPort

Leave default value

Custom Field

Custom IP Range

Other Settings

“Via” header

This section explains 3CX handling of Outbound Calls through SIP Trunks. Specifically, the INVITE message structure and how the SIP field values are populated.

Structuring the INVITE message

The values 3CX sends in outgoing INVITE messages can be configured in the SIP Trunk settings in the “Outbound Parameters” tab. From here, you can set what values will be placed in each SIP field, but this will be explained later in more detail.

The base INVITE message 3CX sends when making an outgoing call through a SIP Trunk looks like this:

INVITE sip:123456789@sip.contoso.com:5060 SIP/2.0

Via: SIP/2.0/UDP 192.168.1.1:5060;branch=z9hG4bK-524287-1---41103210c7296225;rport

Max-Forwards: 70

Contact: <sip:auth_ID@2.2.2.2:5060>

To: <sip:123456789@sip.contoso.com:5060>

From: "Extension Name"<sip:auth_ID@sip.contoso.com:5060>;tag=f625b10b

Call-ID: 84MhAlm_yj3UmVbT7BK6nA..

CSeq: 1 INVITE

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REGISTER, SUBSCRIBE, NOTIFY, REFER, INFO, MESSAGE, UPDATE

Content-Type: application/sdp

Supported: replaces, timer

User-Agent: 3CXPhoneSystem 15.5.10244.4 (9880)

Content-Length: 256

Configurable SIP Fields

3CX does not allow full customization of the INVITE, so its base structure always needs to contain the SIP fields shown above. 3CX enables the following fields to be configured:

  • Request Line URI : User Part
  • Request Line URI : Host Part
  • Contact : User Part
  • Contact : Host Part
  • To : Display Name
  • To : User Part
  • To : Host Part
  • From : Display Name
  • From : User Part
  • From : Host Part
  • User Agent : Text String
  • Remote Party ID - Called Party : Display Name
  • Remote Party ID - Called Party : User Part
  • Remote Party ID - Called Party : Host Part
  • Remote Party ID - Calling Party : Display Name
  • Remote Party ID - Calling Party : User Part
  • Remote Party ID - Calling Party : Host Part
  • P-Asserted Identity : Display Name
  • P-Asserted Identity : User Part
  • P-Asserted Identity : Host Part
  • P-Preferred Identity : Display Name
  • P-Preferred Identity : User Part
  • P-Preferred Identity : Host Part
  • P-Called-Party-ID : Display Name
  • P-Called-Party-ID : User Part
  • P-Called-Party-ID : Host Part

3CX Variables

The variables briefly described below can be assigned to each of the SIP Fields mentioned in section “Configurable SIP Fields”.

AuthID

<b><b><b>“Authentication ID”</b></b></b> field in SIP Trunk settings > <b><b><b>“General”</b></b></b> tab

The value of the AuthID variable is derived from the “Authentication ID” field in “SIP Trunks” function > Edit SIP Trunk > “General” tab > “Authentication” section > Authentication ID (aka SIP user ID).

CalledName

As of v15 this variable is deprecated and should not be used.

CalledNum

The “CalledNum” variable contains the dialled/destination number the INVITE message is supposed to initiate the call to.

CallerName

<b><b><b>“First Name”</b></b></b> & <b><b><b>“Last Name”</b></b></b> fields in Extension > "General" tab

The Callers Name is composed by merging the values of the First Name and Last Name of the extension in the “Display name” field.

CallerDispName

In contrast to the “CallerName”, for this variable 3CX attempts to use the original Caller Name of the call initiator. This means that if the endpoint registered to 3CX makes a call to an external number and sends a value in the “From : Display Name”, 3CX tries to maintain this value when constructing the INVITE to be sent to the SIP Trunk provider SIP Server.

CallerNum

This variable has the same value as the “LineNumber” variable as explained in section LineNumber. Avoid using it as it is used internally by the system and use the “LineNumber” variable instead.

ContactUri

The “ContactUri” variable value containing the IP and port on which a SIP Trunk should contact 3CX, is typically used to populate the “Contact : Host Part”. The port is always the default 3CX SIP port configured during the installation. For the IP, 3CX first checks if in the SIP Trunk settings in the Options” tab, there is a valid IP address in the “Select which IP to use in 'Contact' (SIP) and 'Connection' (SDP) fields” field to use. If this option however is set to “Use Default Settings”, 3CX uses the system-wide default Public IP it has been configured to use under Settings > Network > Public IP tab.

DevHostPort

The “DevHostPort” variable is only available for use by PSTN Gateways which share some of the same functionality in 3CX.

GWHostPort

<b><b><b>“Registrar/Server/Gateway Hostname or IP”</b></b></b> and <b><b><b>“Port”</b></b></b> fields in <b><b><b>“SIP Trunks”</b></b></b> > <b><b><b>“General”</b></b></b> > <b><b><b>“Trunk Details”</b></b></b>

This variable is the combined value of the “Registrar/Server/Gateway Hostname or IP” and “Port” fields in SIP Trunks function > Edit SIP Trunk > General tab > Trunk Details section .

LineId

The LineId is the virtual extension number of the SIP Trunk or Gateway. This is by default in the 10000 range. This is not visible in the 3CX Management console, but is visible in the Active Calls page.

LineNumber

The Line number is taken from the “Main Trunk No” field of the SIP Trunk

Location: SIP Trunks → SIP Trunk → General (tab) → Route calls to (section) → Main Trunk Number

OutboundCallerId

The Outbound Caller ID is taken from the Extension settings

Location → Extensions → Extension → General (tab) → User Information (section) → Outbound Caller ID.

If this field is empty, then 3CX will check the SIP Trunk settings → “Caller ID” tab → “Outbound Caller ID” field.

If this field is also empty, the 3CX will use the Main Trunk Number that is configured in the “General” tab of the SIP Trunk settings.

If an endpoint registered to 3CX uses the anonymous dial code to make an outbound call, this variable will be populated with value “anonymous”.

OriginatorCallerID

The “OriginatorCallerID” variable attempts to use the original number of the Caller, even if that number has not originated from the 3CX system.

First 3CX will check if for the specific call session that it is trying to create the INVITE for, if the “CallerNum” Inbound Parameter is populated. An example where this can happen is when there is an incoming call from a SIP Trunk provider  that is then redirected to another outside/external number through a SIP Trunk provider. The “CallerNum” Inbound Parameter will have been populated during the incoming call information collection, as explained in section 5.

If the “CallerNum” Inbound Parameter is empty, 3CX performs the same checks as for the “OutboundCallerId” variable explained in section 6.1.2.12.

If an endpoint registered to 3CX uses the anonymous dial code to make an outbound call, this variable will be populated with value “anonymous”.

EnforcedOriginatorCallerID

The “EnforcedOriginatorCallerID” variable is exactly the same as the “OriginatorCallerID” variable (section 6.1.2.13) with one important difference. When the anonymous dial code is used to make a call, instead of using value “anonymous”, it still performs the same checks described as if the dial code was not used.

EnforcedOutboundCallerId

The “EnforcedOutboundCallerId” variable is exactly the same as the “OutboundCallerId” variable (section 6.1.2.12) with the difference that when the anonymous dial code is used to make a call, instead of using value “anonymous”, it still performs the same checks described as if the dial code was not used.

OutboundLineId

The Outbound Caller ID is taken from the SIP Trunk Settings.

Location: SIP Trunks → SIP Trunk → Caller ID (tab) → Default caller ID (section) → Configure Caller ID

If this field is empty, the 3CX will use the Main Trunk Number that is configured in the “General” tab of the SIP Trunk settings.

OutHostPort

The IP/Hostname of this variable is taken from the Outbound Proxy fields.

Location: SIP Trunks → SIP Trunk → General (tab) → Trunk Details (section) → Outbound Proxy

Leave default value

When selecting this option as a variable, 3CX will use the default value it has for the corresponding SIP field. The SIP fields that had default values assigned to them in 3CX can be seen by examining the default/base INVITE message as shown at the beginning of section 6.1.

Any SIP fields for which 3CX does not have a default value, when “Leave default value” is set, will remain blank.

Custom Field

Choosing this as a variable will allow you to enter a value manually.

Custom IP Range

Choosing this as a variable will allow you to enter a value manually. When selected, it is expected to enter a value that is an IP address.

Other Settings

Apart from the variables that are located in the “Outbound Parameters” tab of the SIP Trunk settings, there are some additional options you can use to further customize the INVITE messages 3CX generates.

“Via” header

The “Via” header in the INVITE message follows the same logic as for the REGISTER messages explained in section 3.3.2 and is configured the same way.

In short, the “Via” header by default is populated with the IP Address of the NIC of the server. This can either be a Local LAN IP or a Public IP, depending on whether the 3CX server is behind NAT or Full Public.

The default behavior however can be overridden so that any IP address can be entered in this header. To set the override, in the “Options” tab of the SIP Trunk settings you must check option ”Put Public IP in SIP VIA Header” and fill in the IP address to be presented.

Free for up to 1 year! Select preferred deployment:

On-Premise

for Linux on a $200 appliance or as a VM

Get the ISO

On-Premise

for Windows as a VM

Download the setup file

On the cloud

In your Google, Amazon, Azure account

Take the PBX Express