TIPS Modify /etc/asterisk/pjsip.transports.conf file

cantVOIP

Member
Joined
Jun 19, 2023
Messages
60
Reaction score
8
Hello everyone,

I've setup let's encrypt to IncrediblePBX server. It renews the certificates automatically through DNS challenge.
The process gets .pem files for the private key, fullchain and, chain creates a shortcut at /etc/letsencrypt/live/mydomain.com/*.pem and the actual files are located under /etc/letsencrypt/archive/mydomain.com/*.pem
How can I edit the pjsip.transports.conf to include pjsip.transports_custom.conf and overwrite the section of the certs to the /etc/letsencrypt/live/mydomain.com path?

[0.0.0.0-tls]
type=transport
protocol=tls
bind=0.0.0.0:5061
cert_file=/etc/letsencrypt/live/yourdomain.com/fullchain.pem
priv_key_file=/etc/letsencrypt/live/yourdomain.com/privkey.pem
ca_list_file=/etc/letsencrypt/live/yourdomain.com/chain.pem
method=tlsv1_2

I'm currently having to manually copy the actual files from /etc/letsencrypt/archive/mydomain.com/ to /etc/asterisk/keys and then rename the files from .pem to .crt and .key. If I try to include pjsip.transport_custom.conf to pjsip.transport.conf it gets overwriten whenever the server reloads. I've tried to create a shortcut from /etc/asterisk/keys pointing to the right certs but it does not work. Any suggestions?
 
I've tried to create a shortcut from /etc/asterisk/keys pointing to the right certs but it does not work. Any suggestions?
You can change the permissions of /etc/letsencrypt/{live,archive} to 0755 so that asterisk can read the files. Then a symbolic link should work.

Use the `fwconsole cert --import` command to import the cert into Certificate Manager and then set that in Asterisk SIP Settings. No need to hack the custom pjsip transports file.
 
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top