On how many ports Asterisk works

Below are the port numbers per protocol. On your router NAT/firewall, just make sure you forward the ports to your * server IP. I hope this helps.

SIP ports (UDP & TCP) 5060 - 5082
RTP ports (UDP & TCP) 8000 - 20000 or 5000 - 31000 (Asterisk Default). Make sure rtpstart= and rtpend= in sip_nat.conf carries the same port ranges, and make sure your phones are within this range. X-Lite softphone, for example, is RTP TCP/UDP 8000.
IAX - IAX2 port is TCP & UDP 4569. IAX port is TCP & UDP 5036
H.323 - TCP & UDP 1720
SCCP (Skinny) - TCP & UDP 2000