How to configure TLS and SRTP in asterisk server and client softphone to make secure calling on the Asterisk

Is there any one who can help me how to configure the transport layer security (TLS) and secure real time protocol(SRTP) in FreePBX asterisk system using the PJSIP channel driver. Especially the Asterisk community technical persons please I need your kind support.
because made some configuration and at the end it said transport failure and certificate mismatch or not verified.
the configuration used to to generate server and client certificates are as follows:

  1. ./ast_tls_cert -C -O “” -d /etc/asterisk/keys
  2. ./ast_tls_cert -m client -c /etc/asterisk/keys/ca.crt -k /etc/asterisk/keys/ca.key -C -O “My Super Company” -d /etc/asterisk/keys -o 100


the endpoint configuration is set to “media_encryption=sdes” and

TLS account settings to the client certificate (100.pem) that we copied to our computer.
Then, we’ll point the TLS server settings to the ca.crt file that we copied to our computer.
but at end SIP 503:transport failure no transport left to try and some times certificate validation failure is generated.

I don’t know if you were looking on this, it’s very helpful :

Thank you very much dear ekrem. I have been visited that asteriskwiki supportive site, but i can’t achieve my goal, I think it is lack of experience. Now I have done the security through SIP. and I am trying using PJSIP.