BezMan / imsdroid

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

Ip address issue #398

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Setup a local sip server(opensips/asterisk) in local network.(e.g 10.10.4.58)
2. Enable 3G connection and got the public ip address at android phone. (e.g. 
42.70.185.89)
3. Enable WIFI connection instead of 3G connection and got the internal ip 
address at android phone.(e.g. 192.168.3.202)
4. Setup identity & network(enable wifi only) options in Imsdroid.
5. Click on "Sign In" button in Imsdroid.

What is the expected output? What do you see instead?
Expect to connect & register to the local sip server but timeout.

What version of the product are you using? On what operating system?
imsdroid: 2.0.504, 2.0.509
android: 4.0.3

Please provide any additional information below.
use Wireshark to capture the packages and find a wire problem in the source 
field,
the ip address of mobile should be the internal ip address(e.g. 192.168.3.202),
but the ip address seems to be provoid by the phone carrier with 3G 
connection(e.g. 42.70.185.89).
when Imsdroid try to connect to the local sip server before timeout, 
type the command "busybox ifconfig" in the terminal and it show the internal ip 
address(192.168.3.202) at interface wlan0,
also tried to connect to the sip server at same time with other sip 
app(Csipsimple) and it's work.

### log of imsdroid
No. Time        Source      Destination Protocol Length Info        
144 43.928346   42.70.185.89    10.10.4.58  SIP 982 Request: REGISTER sip:10.10.4.58
::'E@@EB*FY

:7\REGISTER sip:10.10.4.58 SIP/2.0
Via: SIP/2.0/UDP 42.70.185.89:51767;branch=z9hG4bK1628927745;rport
From: <sip:003@10.10.4.58>;tag=1407725481
To: <sip:003@10.10.4.58>
Contact: 
<sip:003@42.70.185.89:51767;transport=udp>;expires=1700;+g.oma.sip-im;language="
en,fr";+g.3gpp.smsip;+g.oma.sip-im.large-message;audio;+g.3gpp.icsi-ref="urn%3Au
rn-7%3A3gpp-application.ims.iari.gsma-vs";+g.3gpp.cs-voice
Call-ID: 98ec0d76-7500-6022-a8ef-651451068bbd
CSeq: 1737328324 REGISTER
Content-Length: 0
Max-Forwards: 70
Authorization: Digest 
username="003",realm="10.10.4.58",nonce="",uri="sip:10.10.4.58",response=""
Allow: INVITE, ACK, CANCEL, BYE, MESSAGE, OPTIONS, NOTIFY, PRACK, UPDATE, REFER
Privacy: none
P-Access-Network-Info: ADSL;utran-cell-id-3gpp=00000000
User-Agent: IM-client/OMA1.0 android-ngn-stack/v2.0.509 (doubango r738 - HTC 
Sensation XL with Beats Audio X315e)
P-Preferred-Identity: <sip:003@10.10.4.58>
Supported: path

### log of CsipSimple
No. Time        Source      Destination Protocol Length Info    
8199    5688.335886 192.168.3.202   10.10.4.58  SIP 607 Request: REGISTER 
sip:10.10.4.58
::'EQ@@e

:=3REGISTER sip:10.10.4.58 SIP/2.0
Via: SIP/2.0/UDP 
192.168.3.202:43238;rport;branch=z9hG4bKPjr.zE24RJc71Y3G6NdtR-Y20TnnJB52cZ
Max-Forwards: 70
From: "003@10.10.4.58" <sip:003@10.10.4.58>;tag=O0vg2qE4qCsbh4N-2eG4BCD1RS4Ht6Os
To: "003@10.10.4.58" <sip:003@10.10.4.58>
Call-ID: -ougIqa0VANk2y-SYnTpANe4RfsGt4Mj
CSeq: 54794 REGISTER
User-Agent: CSipSimple_runnymede-15/r1916
Contact: "003@10.10.4.58" <sip:003@192.168.3.202:43238;ob>
Expires: 900
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, REFER, 
MESSAGE, OPTIONS
Content-Length:  0

Original issue reported on code.google.com by marlboro...@gmail.com on 9 Oct 2012 at 10:11

GoogleCodeExporter commented 8 years ago

Original comment by boss...@yahoo.fr on 24 Oct 2012 at 6:38

GoogleCodeExporter commented 8 years ago
Issue 402 has been merged into this issue.

Original comment by boss...@yahoo.fr on 5 Nov 2012 at 6:51

GoogleCodeExporter commented 8 years ago
Hi Mamadou, we are facing the same issue on various phones, like LG Optimus 
Dual (2.3.3), Desire HD (with 4.1 mod) and others.
I saw that Android added the 'isUp()' method to NetworkInterface to check an 
interface's validity.
Is there any similar test that can be performed at Linux layer?

Thank you very much

Marco

Original comment by marco.zo...@gmail.com on 5 Dec 2012 at 5:07

GoogleCodeExporter commented 8 years ago
on all systems (windows, ios, linux...) the best interface and IP address is 
chosen from the native code using routes and metrics at 
http://code.google.com/p/doubango/source/browse/branches/2.0/doubango/tinyNET/sr
c/tnet_utils.c?r=776#599

on Android, this is done on java as some required functions are missing unless 
you directly link to the core code.
I have changed the code as suggested in comment 3:
http://code.google.com/p/imsdroid/source/browse/branches/2.0/android-ngn-stack/s
rc/org/doubango/ngn/services/impl/NgnNetworkService.java?spec=svn537&r=537#196

Original comment by boss...@yahoo.fr on 6 Dec 2012 at 12:22