Asterisk SIP Not Giving Sound from AWS

I have installed Asterisk 14.7.6 in ubuntu 16.04 in ec2 Amazon Web Service.
Open the ports inbound on the AWS and for outbound I have kept all open.

UDP: 5060
UDP: 10000-20000
UDP: 4569
TCP:22


Now my Sip is below:

[general]
context=test
videosupport=yes
allowoverlap=no
bindport=5060
bindaddr=0.0.0.0
srvlookup=yes
disallow=all
allow=ulaw
allow=alaw
allow=speex
allow=gsm
allow=h264
nat=force_rport,comedia

[101]
type=friend
videosupport=yes
secret=101
host=dynamic
context=test
username=101


In the rtp it is 10000 to 20000


What are the possible reasons why the sound is not coming?
All probable reasons, please cite for me.
I will try.

Also, I install the same version asterisk in same ubuntu version, in my local machine. There the sound comes.
I am just mimicking the same system in cloud.

Please let me know.

Thanks in advance.

General recomendations to fix NAT issues

On the Asterisk SIDE
Let Asterisk to know what it is your local network addres, for example

[general]
localnet=192.168.0.0/255.255.0.0  (replace it with your local network address)

Set NAT setting on sip peers to

nat=force_rport,comedia

Specify media address

[general]
externaddr = 172.16.42.1 ( your public IP)
media_address = 172.16.42.1 ( your public IP)

disable directmedia support

[general]
directmedia=no

On peer configuration add the following


turn on qualify=yes to keep the nat session open
 Send keepalives in the RTP stream to keep NAT open  add it  on general section no sure if also works  on peer section
rtpkeepalive=2

turn on qualify=yes to keep the nat session open

Some recomendations for the client side

specify the use of stun server on the client side

Disable the SIP ALG on your router

Thank you for the help!

Now I am able to get call but have the error mentioned below

-where the sip call do not cut the call after replying.

-Sometimes no sound comes, need to turn on and turn off the sip to get the sound.

Please help me solve the error. My sip, ports both (inbound and outbound) in aws are listed below.