Digium D6x phones, beginning with phone firmware 2_2_0_4_5a54ff2, support SDES SRTP encrypted media and TLS-encrypted signaling. This page provides a brief overview of the capabilities and the setup procedure.
As of firmware 2_2_0_4_5a54ff2, Digium phones do not validate Asterisk's server certificate, nor can they be loaded with a client certificate to present to Asterisk. Future releases of phone firmware may eliminate these limitations. As of firmware 2_3_9, Digium phones no longer support anonymous or null ciphers.
Getting Started - Certificates
In order to setup a TLS transport, Asterisk requires the use of certificates. A good description of the process of generating a self-signed certificate authority, along with the requisite server certificate is available on the Secure Calling Tutorial wiki page.
Asterisk TLS Transport
Once certificates have been generated and installed for Asterisk's use, a TLS signaling transport must be set up for use by PJSIP. The transport should look similar to:
Here, we've declared a new transport type, that will be using the tls protocol, bound to all local IPv4 addresses (0.0.0.0) on the default port for TLS (5061). We've also provided Asterisk with the asterisk.crt cert_file and the asterisk.key private key file. And, importantly, we've declared that the TLS method we want to use is sslv23. This method actually enables SSL 3.0, TLS 1.0, TLS 1.1 and TLS 1.2 communication methods.
Restart Asterisk, and, from the Asterisk CLI, perform:
If you see:
The TLS transport has been created successfully.
If it is not seen, then your system may not be compiled with SSL support or you may have introduced a typographic error into the configuration.
TLS Endpoint Considerations
Endpoints setup in Asterisk to use connection-based protocols such as TCP or TLS should be configured with the contact_rewrite enabled. It is disabled by default. Additionally, endpoints using TCP or TLS cannot have an explicit transport attached to the endpoint. Therefore, and endpoint configured for TLS should include:
Asterisk SDES SRTP Encryption
Media encryption for a PJSIP endpoint in Asterisk is set using the media_encryption option, e.g.:
By default, the media_encryption option is null, disabled. Once it is enabled for an endpoint, it can be made effective by performing a reload from the Asterisk CLI. To check if an endpoint is configured for SDES SRTP media encryption, you can perform pjsip show endpoint <endpoint identifier> from the Asterisk CLI. Look for the media_encryption display line:
Digium Phone Settings
Use of TCP or TLS signaling with DPMA and Digium phones requires Asterisk 13.11.0 or greater.
When using the DPMA to configure phones, TLS signaling is setup in two areas:
- mDNS broadcast
- Phone Network or Line
To setup DPMA's mDNS broadcast to use advertise TLS, a new configuration option has been added for the [general] section, mdns_transport, and can be used such as:
With this set, DPMA will broadcast that a phone should connect to it using TLS signaling on port 5061.
In order for the phone to retrieve its configuration from DPMA properly, and for the phone to be configured to register to Asterisk using TLS, the phone's DPMA network must be configured for TLS. This is accomplished with the new transport network option. It is set such as:
When using the DPMA to configure phones, SDES SRTP media encryption is setup in one area:
- phone line
Media encryption is setup on the phone's line settings using the media_encryption option, such as:
When the phone's line has media_encryption set to sdes, the phone will be configured to perform SDES SRTP encryption.
When using XML to configure a Digium phone, TLS signaling and SDES SRTP are setup in the phone's <host_primary> account child, such as:
Here, the transport has been set to tls, and media_encryption has been set to sdes.
Setting PJSIP's TLS method to sslv23 should provide compatibility. If a specific cipher is desired, the following may be used with Digium phones:
Versions of firmware prior to 2.3.9 also supported the following, additional ciphers:
On the Phone
A Digium phone indicates to the user when TLS signaling and/or SDES SRTP are enabled for a call with a shield indicator on the line, denoting TLS, and a shield indicator for the call disposition, denoting SRTP, as such: