Jason
Jason

Reputation: 878

Android SIP in double NAT enviorment

I running my asterisk server sitting on amazon ec2 and my voip app written with android sip sdk. Everything was working fine except one, when my voip app trying to connect to sip server with double NAT network. I can't receive call.

From the asterisk console, I can clearly see the sip register with wrong ip address.

My 3G service provider using double nat, the so called public ip assigned to me was actually a NAT private IP.

When I did google what is my ip, i got different IP. It clearly show I'm in double NAT network.

If I try the same scenario with csipsimple, it registered with correct IP. without helps from STUN.

ip-10-236-xxx-xxx*CLI> sip show peers
Name/username              Host                                    Dyn Forcerport ACL Port     Status     
5000/5000                  10.120.1.242                             D              A  42964    UNREACHABLE 

Looking at the "10.120.1.242", this is not real public i suppose to have, but private IP from my 3G service provider.

I know many of pro here must suggest me forget about the android sdk sip, go for pjsip. But due to close source licensing, it cost me quite a lot.

Anyone know how can I solve this issue without switching to pjsip? I saw there is a option "outbound proxy address" for android sdk sip, not sure whether this helps?

Upvotes: 0

Views: 1699

Answers (2)

Ivan Carrasco Quiroz
Ivan Carrasco Quiroz

Reputation: 605

Using double nat to problems: SIP (Registration, tones through a call, ...) and RTP Conflict (voice).

To solve SIP problem, you can use (sip.conf):

nat=yes 

also you have to config DMZ in each router.

To solve RTP you can use (sip.conf):

externaddr=public_ip
localnet=privates_ip

that's all.

Upvotes: 0

Jason
Jason

Reputation: 878

Managed to solved this problem.

In Asterisk create extension, just change NAT > yes.

Csipsimple doesn't required this extra step.

Upvotes: 1

Related Questions