3G vs WiFi problem

I am able to access my Asterisk server on my Android SIP client over WiFi but not over 3G. Could someone please help?

WiFi + commerical VoIP service: works great
WiFi + my Asterisk server: works great
3G + commercial VoIP service: works OK
3G + my Asterisk server: does not work. Registers OK, and dials OK, but no audio

Thank you very much for your help.

I’ve gone through this with several client installations and settled on the following pattern for roaming clients…

In Asterisk, set nat=yes and directmedia=no for the roaming user.
On the firewall, forward the appropriate RTP ports to the asterisk server.
On Android devices, use CSipSimple as the client with ICE enabled.

This isn’t the most efficient because directmedia=no forces the audio through the Asterisk for all calls but it works in every scenario I’ve tested including the ones you described.

Thanks for the advice gtj0.

I am trying to do those settings via Freepbx. The nat=yes is already set under extensions. However there is no setting in Freepbx to set directmedia= no. Do you have any suggestions how I could do that setting?

directmedia used to be called canreinvite.

Thanks for the clarification david55.

In that case gtj0, I am already doing all the three things you suggested, and I am still having the problem?

Do you think it is because I have not installed g729 codec on my Asterisk PBX?

Without knowing exactly how the 2 endpoints are configured, it’s kind of hard to tell what’s causing the problem. Usually a missing codec will cause the call to fail with a “488 Not acceptable here” because the 2 endpoints can’t find a codec in common.

I’d start troubleshooting by getting a call from the roaming user to voicemail to work, then work to other scenarios. sip debug and rtp debug will also help. You may find that even fixed users on the same lan segment as your asterisk server need to have nat=yes and directmedia=no so they can communicate with your roaming user.

I used to use Sipdroid as the Android client, and I had pretty much the same experience as you - calls over wifi were fine, over 3g it was just not possible. I switched to Acrobits on Android because it supports g729 (as an add-on.) Now it works fine over 3g as long as it’s using g729.