Deplying on vps fails. No audio problem

I deployed the asterisk on a local pc at first. Everything works well. So I try to deploy the server on a vps. The phone still rings after a call is made. However, there is no audio when the phone is picked up. Both of my phones are in the same lan(different from the lan which the vps is in). some suggestions? Thanks in advance.

I have some other concert. When I make a call, does the audio data(rtp packet) go through the asterisk server?(Is there any config file to tweak this?)

check your NAT settings like :

externaddr = your-public-ip
localnet=192.168.0.0/255.255.0.0 ;your local address network
nat = force_rport,comedia

[quote]I have some other concert. When I make a call, does the audio data(rtp packet) go through the asterisk server?(Is there any config file to tweak this?)
[/quote]

check the directmedia option

Thanks for your reply. According to “sip.conf”, it seems that if my caller or callee is behind NAT, direct media can’t work properly. My device is unfortunately behind NAT. Is there any suggestion?

[quote=“ambiorixg12”]check your NAT settings like :

externaddr = your-public-ip
localnet=192.168.0.0/255.255.0.0 ;your local address network
nat = force_rport,comedia

check the directmedia option[/quote]