Unable to hear audio from Asterisk server

I am running an Asterisk server in Public IP. SIP registration is working fine. When I connect SIP softphones to the server, I am able to make call and conversation is possible between the softphones. However, anything that is played on the asterisk server is not heard in the softphone. In asterisk server log, I could see the message like " Playing ‘hello-world.gsm’ " but I could not hear any message.

Ports open for sending and receiving UDP packets in the server are 5060, 10000 to 20000, 4569, 5036 and 2727

When I setup the server inside the LAN, everything was working perfectly. So I suspect it could be related to some firewall configuration. Please help me.

Note : SIP softphones were running in a machine connected to internet using wifi dongle with Cone NAT

Check the SIP & the RTP debug and take a look to the IPs used to send the RTP.

Make Sure you have

qualify=yes
nat=force_rport,comedia

as well make sure you have

externip=1.2.3.4 <- your Public IP ADDRESS or
extenhost=yours.fqdn.com

I know when I didn’t have my externip or externhost set I would not hear audio from outside my local network

[quote=“rootmedia”]Make Sure you have

qualify=yes
nat=force_rport,comedia

[/quote]

I would say try, rather than definitely use. There is a tendency for these particular settings, particularly nat, to become cook book settings, rather than rational choices. nat= is mainly intended for the unusual case where Asterisk is outside NAT and the terminal is inside.

I am still unable to here audio. Now I am trying to connect using sipml5 for sip account 6003. Registration is happening, call is getting established, but unable to here audio from server. Please help

My sip.conf file

[code][general]
udpbindaddr=my_external_ip_goes_here:5060
bindaddr=my_external_ip_goes_here
realm=my_external_ip_goes_here
transport=udp,ws
externaddr=my_external_ip_goes_here
localnet=my_external_ip_goes_here
qualify=yes
nat=force_rport,comedia
externip=my_external_ip_goes_here

[6001]
type=friend
context=from-internal
host=dynamic
secret=my_password_goes_here
disallow=all
allow=ulaw

[6002]
type=friend
context=from-internal
host=dynamic
secret=my_password_goes_here
disallow=all
allow=ulaw

[6003]
host=dynamic
nat=yes
secret=my_password_goes here
context=from-internal
type=friend
encryption=yes
avpf=yes
force_avp=yes
icesupport=yes
transport=ws,udp
directmedia=no
disallow=all
allow=ulaw
dtlsenable=yes
dtlsverify=fingerprint
dtlscertfile=/etc/asterisk/keys/asterisk.pem
dtlscafile=/etc/asterisk/keys/ca.crt
dtlssetup=actpass[/code]

My extensions.conf

[code][others]
[from-internal]
exten => 9999,1,Answer()
same => n,Wait(1)
same => n,Playback(hello-world)
same => n,Hangup()

exten => 8888,1,Answer()
exten => 8888,n,Wait(5)
exten => 8888,n,ConfBridge(8888)

exten => 6001,1,Dial(SIP/6001,10)
exten => 6001,n,Voicemail(6001,u)

exten => 6002,1,Dial(SIP/6002)
exten => 6002,2,Voicemail(6002,u)

exten => 6003,1,Dial(SIP/6003)
exten => 6003,2,Voicemail(6003,u)

exten => 5000,1,VoicemailMain({CALLERID(num)},s)[/code]

First off are you or are you not NAT?

if your Asterisk system is behind a firewall and on a local network with a address base of 192.168..

in my General Section of SIP.CONF I have the follow
bindport=5060 <- JUST THE PORT
bindaddr=0.0.0.0 <- Binds to all interfaces and addresses on system my eth0=192.168.78.3 <- Static
externip=69.50.163.136 <- Real world IP ADDRESS Public IP of Router!
externrefresh=15
localnet=192.168.78.0/255.255.255.0 <- Privet Network 192.168.78.0/24

I have devices that connect from my local network as well from outside my network

Now if the extensions are inside your network you should be able to have them register to the IP address of the asterisk system

If your extensions are accessing your asterisk system from outside your local privet network then you may need to add Qualify=YES for the extensions as well nat=force_rport,comedia

Trying to troubleshoot simple sip by using a webrtc setup will be a chaos. WebRTC use ICE and if your server is not prepared to use ICE or your client can’t use the correct IP address because it chooses the wrong interface will mess all.

Get back to the normal sip devices and enable sip debug and rtp debug to see what is exaclty happenning in your server.

Need to add the line in pjsip.conf

qualify=yes
nat=force_rport,comedia
externalip
internalip