Tls configuration in asterisk.20 on EC2 instance

hello asterisk team,

i’m implementing TLS support in call system. for that i use this server . first i make this server on ec2 instance for public handle.and i successfully done with UDP. Now i want TLS feature. for that i do following changes in pjsip.conf file. also i’m able to register the account in server but when i dial the call it is not connect.
below i put the my pjsip.conf file and extension.conf file.
please chack once and tell me that is there any changes required.

1)pjsip.conf

; =========================
; GLOBAL SETTINGS
; =========================
[global]
type=global
user_agent=Asterisk
;endpoint_identifier_order=username,ip,anonymous
; =========================
; TRANSPORT (UDP)
; =========================
;[transport-udp]
;type=transport
;protocol=udp
;bind=0.0.0.0
;external_media_address=51.21.198.44
;external_signaling_address=51.21.198.44

; =========================
; TRANSPORT (TLS)
; =========================
[transport-tls]
type=transport
protocol=tls
bind=0.0.0.0:5061
external_media_address=51.21.198.44
external_signaling_address=51.21.198.44
local_net=172.31.0.0/16
cert_file=/etc/asterisk/keys/asterisk.pem
priv_key_file=/etc/asterisk/keys/asterisk.key
ca_list_file=/etc/asterisk/keys/ca.crt
method=tlsv1_2
verify_client=no
verify_server=no
allow_reload=yes
require_client_cert=no
;cipher=ADH-AES256-SHA,ADH-AES128-SHA

; =========================
; ENDPOINT 7001
; =========================
[7001]
type=endpoint
context=default
disallow=all
allow=ulaw,alaw
auth=7001-auth
aors=7001
transport=transport-tls
;nat=force_rport,comedia
direct_media=no
rtp_symmetric=yes
rewrite_contact=yes
force_rport=yes
media_encryption=sdes
media_encryption_optimistic=yes

[7001-auth]
type=auth
auth_type=userpass
username=7001
password=7001

[7001]
type=aor
max_contacts=1
remove_existing=yes
qualify_frequency=30

2)extensions.conf
[default]
; dial 7001
exten => 7001,1,NoOp(Call to 7001)
same => n,Dial(PJSIP/7001,30)
same => n,Hangup()

; dial 7002
exten => 7002,1,NoOp(Call to 7002)
same => n,Dial(PJSIP/7002,30)
same => n,Hangup()

; dial 7003
exten => 7003,1,NoOp(Call to 7003)
same => n,Dial(PJSIP/7003,30)
same => n,Hangup()

; dial 7004
exten => 7004,1,NoOp(Call to 7004)
same => n,Dial(PJSIP/7004,30)
same => n,Hangup()

There is no team. This is a community forum.

You need to show console output and describe what actually happens.

Don’t enable reload on transports. There is pretty much no need to these days.

i have register two accounts from tsip to asterisk server and it registered properly. but when i dial from 7002 to 7003 or visa varsa at that time this type of error shown and call was not established.

below i put the output.

ip-172-31-46-244*CLI> pjsip show endpoints

Endpoint: <Endpoint/CID…> <State…> <Channels.>

I/OAuth: <AuthId/UserName…>
Aor: <Aor…>
Contact: <Aor/ContactUri…> <Hash…> <RTT(ms)..>
Transport: <TransportId…> <BindAddress…>
Identify: <Identify/Endpoint…>
Match: <criteria…>
Channel: <ChannelId…> <State…> <Time…>
Exten: <DialedExten…> CLCID: <ConnectedLineCID…>

Endpoint: 7001 Unavailable 0 of inf
InAuth: 7001-auth/7001
Aor: 7001 1
Transport: transport-tls tls 0 0 0.0.0.0:5061

Endpoint: 7002 Not in use 0 of inf
InAuth: 7002-auth/7002
Aor: 7002 1
Contact: 7002/sip:7002@49.36.81.176:62235;transport 380799ab7d Avail 160.821
Transport: transport-tls tls 0 0 0.0.0.0:5061

Endpoint: 7003 Not in use 0 of inf
InAuth: 7003-auth/7003
Aor: 7003 1
Contact: 7003/sip:7003@171.61.166.114:30228;transpo 02e0e90621 Avail 216.883
Transport: transport-tls tls 0 0 0.0.0.0:5061

Endpoint: 7004 Unavailable 0 of inf
InAuth: 7004-auth/7004
Aor: 7004 1
Transport: transport-tls tls 0 0 0.0.0.0:5061

Objects found: 4

== Everyone is busy/congested at this time (1:0/0/1)
== Spawn extension (default, 7002, 3) exited non-zero on ‘PJSIP/7003-00000000’
== Everyone is busy/congested at this time (1:0/0/1)
== Spawn extension (default, 7002, 3) exited non-zero on ‘PJSIP/7003-00000002’