I am trying to enable TLS between 2 asterisk servers. Using Asterisk 16.19 with pjsip.
I have followed the guide Home - Asterisk Documentation
Since my client is also asterisk not Blink, I am going out of the guide’s coverance and things are not working for me.
I have created the necessary keys on Asterisk 1
and transferred the necessary keys to the Asterisk 2
.
High level setup:
Asterisk 1
transport-udp: 5060
transport-tls: 5061
transport config:
[transport-tls]
type=transport
protocol=tls
bind=0.0.0.0:5061
cert_file=/etc/asterisk/keys/asterisk.crt
priv_key_file=/etc/asterisk/keys/asterisk.key
ca_list_file=/etc/asterisk/keys/ca.crt
ca_list_path=/etc/asterisk/keys
verify_client=true
verify_server=true
method=sslv23
I have checked with netstat -tunlap
, I can see port 5061 is binded correctly to asterisk and listening.
Asterisk 2
registration config
server_uri=sip:<username>@<Asterisk_1_IP>:5061
client_uri=sip:<username>@<Asterisk_1_IP>:5061
transport config:
[transport-tls]
type=transport
protocol=tls
bind=0.0.0.0:5061
cert_file=/etc/asterisk/keys/ivr.crt
priv_key_file=/etc/asterisk/keys/ivr.key
method=sslv23
ca_list_file=/etc/asterisk/keys/ca.crt
ca_list_path=/etc/asterisk/keys
2nd asterisk (client to register to Asterisk 1), keeps pushing out logs saying it hasnt received any response to registration request.
However when I try to actually see whats going on on the network level using tcpdump, I am only seeing UDP packets sent out to 5061. How can I make sure pjsip uses TLS?
Asterisk 2 Console output:
WARNING[3294]: res_pjsip_outbound_registration.c:841 schedule_retry: No response received from ‘sip:@<Asterisk_1_IP>:5061’ on registration attempt to ‘sip:@<Asterisk_1_IP>:5061’, retrying in ‘5’
WARNING[3294]: res_pjsip_outbound_registration.c:841 schedule_retry: No response received from ‘sip:@<Asterisk_1_IP>:5061’ on registration attempt to ‘sip:@<Asterisk_1_IP>:5061’, retrying in ‘5’
If I remove the 5061 from Asterisk 2
endpoint config, I can see succesful registration to Asterisk 1
using UDP protocol.
Any guidance appreciated.