Trunks
XCALLY section | Tools → Trunks |
On this page |
Overview
A Trunk is a SIP connection between your phone system and a VOIP provider for inbound and outbound calls.
The SIP trunk configuration depends on your VoIP provider. There are:
registration-based SIP Trunks
i.e. via username and password
IP-based trunks
i.e. PBX public IP is linked to the provider.
Please check with your provider the necessary configuration parameters.
For Sample trunk configurations go to: Examples of Trunks
Trunks section
This page describes the Trunks configuration on the New Client Experience, available from version 3.45.0. We recommend using the New Experience web interface to take full advantage of the latest features.
You can find the Trunks section under the Tools menu. When you click on it, you can see all the already existing Trunks.
You can edit, clone or delete a trunk clicking the three dots button (⋮) next to the trunk of interest. You can access the realtime panel to monitor trunk activity.
Furthermore, under Tools → Trunks, you can:
search for a specific trunk
clear all filters
manage columns, by selecting or not them
activate the advanced search for each field
create a new trunk
Create a Trunk
To create a new Trunk:
Click the Add button, under Tools → Trunks
Enter the Trunk’s details:
Name
Domain/Host name (please refer to your provider)
Authentication Password
Default User Name
Trunk Registry string (which is usually defaultuser:password@host)
Click the Active flag to enable it
Click Add
Don't forget to configure the Inbound and Outbound routes to properly route the incoming and outgoing calls.
Edit a Trunk
In the Trunks section, clicking the three dots button (⋮) next to the trunk, you can:
Edit the trunk
Clone the trunk
Go to the Realtime panel to monitor trunk status
Delete the trunk
Settings
In the Settings Section, you can change general settings inserted at trunk generation (like name, default user, password, context and so on) plus a set of other parameters (in this section and the Advanced and Other Fields).
Active: enable or disable the trunk
Host: domain or host name
Secret: Authentication password
Default User: Authentication user
Context: the applicable context
Caller ID: The Caller ID in the format "name"
Type:
"user"is matched on username (in the From: header)"peer"is matched on IP address"friend"allows both, but can introduce matching ambiguity
DTMF Mode: how DTMF (Dual-Tone Multi-Frequency) tones are transmitted:
RFC2833 (default): DTMF tones are sent via RTP, outside the audio stream
INBAND: DTMF is sent within the audio stream and is audible. This method requires high CPU usage
INFO: DTMF is sent using SIP INFO messages. Reliable but not widely supported by all PBX systems and SIP trunks
NAT: adjusts Asterisk behavior for clients behind firewalls.
If any of the comma-separated options is set to no, Asterisk will override other settings and set nat=no.Qualify: determines when the SIP is achievable
Allowed Codecs: specifies the list of supported codecs, ordered by priority
Insecure: defines how Asterisk handles connections from peers with insecure settings. Useful for compatibility with certain SIP trunks.
Calls Limit: maximum number of concurrent inbound and outbound calls allowed
Optional Description
Advanced
Registry: required for receiving inbound calls when authentication is needed
Direct Media: Asterisk by default tries to redirect the RTP media stream to go directly from the caller to the callee. Some devices do not support this (especially if one of them is behind a NAT).
The default setting is YES.
If you have all clients behind a NAT, or for some other reason want Asterisk to stay in the audio path, you may want to turn this off.
Call Counter: enables call counters on devices
From Domain: sets the default From:domain in SIP messages when Asterisk acts as a SIP user agent. Some providers require this to be a valid domain instead of just an IP address
From User: defines the username to be sent in the From header when placing calls to the peer (another SIP proxy). Used for authentication. Valid only for
type=peer.
Outbound Proxy: IP address, hostname, or SRV record of the outbound SIP proxy. SIP signaling is routed to this proxy instead of directly to the device. Valid only for
type=peer.Add Phone to URL: If enabled (yes), appends
;user=phoneto SIP URIs. Required by some providers for proper number recognition.Trust Remote Party ID: defines whether Asterisk should trust the Remote-Party-ID header sent by the peer.
Send Remote Party ID Header: specifies whether Asterisk should send the Remote-Party-ID header.
yes: header is sent
no: header is not sent
Encryption: determines if SRTP encryption is required for media.
yes: only encrypted media is allowed. If the peer doesn't support SRTP, the call fails (HANGUPCAUSE=58).
no: unencrypted media is allowed.
Port: the SIP port used to communicate with the peer (typically 5060 or 5061).
Transport: preferred transport protocols for SIP signaling. Examples:
udp,tcp,tls.T38pt Udptl: settings related to T.38 UDPTL.
Example:
yes,redundancy,maxdatagram=400
Video Support: Enables or disables support for video calls. If yes: Asterisk negotiates video streams if supported by the peer.
As indicated in the sip.conf file, the format of Asterisk's register directive is as follows:
register => [peer?][transport://]user[@domain][:secret[:authuser]]@host[:port][/extension][~expiry]To send the REGISTER using the TCP protocol, it is necessary to explicitly specify the transport in the dedicated field.
E.g.:
register => tcp://username:password@hostOther Fields
In the Other Fields section you can specify other fields to add in the trunks conf files. Follow default asterisk format (key=value), each field on a single row.
Monitor Trunk Status
To monitor the trunk registration status:
Go to Realtime section under Voice menu
Click Trunks tab
Check the information in realtime:
Trunk Status, which shows status of a SIP trunk registration to motion server
Registry, which shows SIP registration status when Motion registers as a client to the provider.
Examples of Trunks
Scenario 1: Motion and VoIP provider
Scenario 2: SIP Gateway Digium
Scenario 3: TWILIO SIP trunk
Scenario 4: Motion and FreePBX