hudamalmsteen / csipsimple

Automatically exported from code.google.com/p/csipsimple
0 stars 0 forks source link

Doesn't always NAT unless I use compact headers. #1319

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. behind firewall
2. ice on, ice off, stun on, stun off, ice+stun on
3. register and look at packets

What is the expected output?
would expect contact address and registration to show private ip.
 What do you see instead?

strange: if I select network option:  use compact headers. then I get correct 
registration, with private ip.
without, register/contact only uses public ip.  and with public ip/ behind nat, 
I don't always get audio.

What version of the product are you using? 
market version

On what operating system?

Droid biotic, gingerbread

Please provide any additional information below.

rooted, so I can let you ssh to it, run test programs, etc.

Original issue reported on code.google.com by michael....@gmail.com on 10 Oct 2011 at 10:29

GoogleCodeExporter commented 9 years ago
i guess I should add, once again, this is intermittent.  maybe it doesn't have 
anything to do with compact headers though.

(all my itsp's support compact headers), and sometimes, I get the correct 
private ip's in contact, sometimes not.

Original comment by michael....@gmail.com on 10 Oct 2011 at 10:32

GoogleCodeExporter commented 9 years ago
In addition to stun and ice, pjsip (the stack behind csipsimple), has another 
way to detect your public IP. By default this feature is enabled.
In fact, after the first registration, it compares the IP as seen by the sip 
server and if different from the one it has just registered, it will 
re-register a second time with the final IP.

Sometimes sip providers do stuff on their side to workaround the fact the sip 
client will register with a private IP (the client should not do that 
normally...). In this case, as they do something on their side, the client 
should not try to rewrite your IP and deduce its public IP. 
In this, case you should change the configuration of your account to avoid this 
feature of pjsip.

Read this : 
http://code.google.com/p/csipsimple/wiki/FAQ?wl=en#I_receive_calls_twice_/_Regis
tration_is_done_on_the_sip_server_t

About the fact you don't get audio and that things seems linked to the "use 
compact" option... Well, this should not really impact the way registeration is 
done. Actually most of the times, "use compact" option should helps to reduce 
UDP packet size and resolve when the fact that routers does not transmit invite 
when too big.
However, it can break two situations :
1 - the other side or the sip proxy if any, does not support compact _headers_. 
As you said that's pretty rare.
2 - the other side or the media gateway if any, does not support reduced _sdp_. 
This is unfortunately not always the case, all the more so as usually SDP reach 
the remote side.
I've planned to separate the two options (compact sdp and compact headers), but 
for now that's a single option.

There is also other root cause for this kind of no audio issue (remote side 
that does not support re-invite/update). This can be detected with full logs 
from the app (see the wiki page about how to collect logs). If you send me logs 
I can try to tell you what happens.

Original comment by r3gis...@gmail.com on 14 Oct 2011 at 2:13