Comments (6)
Hi,
the default network interface is "guessed" based on the routing table. The algorithm
is quite simple. It does not take network cost (Wifi or Mobile) into the equation.
could you please provide output of the "netstat" command and routing table?
NOTE: I think this issue belongs in the baresip project.
/Alfred
from re.
Hi Alfred,
Ok, thanks for clearing that up. I was uncertain if this was supposted work with network cost 'out-of-the-box'.
I am unsure on how to provide output of netstat and routing table.. How do I do that? Note also that I have no jailbreaked iPhone if that is needed for output.
Br,
Per
from re.
Start baresip and type the /netstat
command. Sample output below:
/netstat
--- Network debug ---
Preferred AF: AF_INET
Local IPv4: enp2s0 - 10.0.0.2
Local IPv6: lo - ::
Domain: getinternet.no
net interfaces:
lo: 127.0.0.1
enp2s0: 10.0.0.2
lo: ::1
enp2s0: fe80::d63d:7eff:fef1:3048
net routes:
Destination Next Hop Iface Type
0.0.0.0/0 10.0.0.1 enp2s0
10.0.0.0/24 ? enp2s0
::1/128 ? lo
fe80::/64 ? enp2s0 LINKLOCAL
DNS Servers from System: (2)
0: 84.208.20.110:53
1: 84.208.20.111:53
or use the functions from your code:
net_if_debug()
net_rt_debug()
from re.
Hi,
Sorry for the delay but here's the output from netstat:
--- Network debug ---
Preferred AF: AF_INET
Local IPv4: - 83.182.162.26
Local IPv6: - 2a00:801:212:55e6:10c3:207:28ac:9372
Domain: wx3.local
net interfaces:
lo0: 127.0.0.1
lo0: ::1
lo0: fe80::1
pdp_ip0: 83.182.162.26
pdp_ip0: fe80::ce:4236:4f3d:5446
pdp_ip0: 2a00:801:212:55e6:10c3:207:28ac:9372
pdp_ip0: 2a00:801:212:55e6:75a6:1a23:88b8:2b65
en0: fe80::fc:9b02:e93d:89d6
en0: 192.168.1.129
en2: fe80::1cfc:c93d:cfbf:6dae
en2: 169.254.253.137
awdl0: fe80::6c43:b4ff:fea6:fc99
utun0: fe80::a980:8f0c:957b:c4ec
net routes:
Destination Next Hop Iface Type
DNS Servers from System: (2)
0: 192.168.1.30:53
1: 192.168.1.1:53
--
At this point I have mobile carrier network and WiFi both running and I would like to have 192.168.1.129, the WiFi address as the preferred interface.
I see no net routes. Is that normal?
Br,
Per
from re.
check if HAVE_SYS_SYSCTL_H and HAVE_NET_ROUTE_H is defined,
and that net/bsd/brt.c is being compiled.
the logic for detecting this is in src/net/mod.mk:
ifneq ($(HAVE_SYS_SYSCTL_H),)
ifneq ($(HAVE_NET_ROUTE_H),)
SRCS += net/bsd/brt.c
CFLAGS += -DHAVE_ROUTE_LIST
endif
endif
oh.. looks like net/route.h
is not available for iOS.
you might have to copy that file from another OS, and then rebuild libre
with those flags forced on.
But, I think to solve the problem properly you have to use some iOS specific
functions to retrieve the "default" interface/address.
from re.
Hi.
Yes, I noticed also that net/route.h is missing in the iPhone SDK. I does however exist in the MacOSX SDK so I just made a copy of it:
sudo cp /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/net/route.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.0.sdk/usr/include/net/
and recompiled everything.
And it seems to be working! Netstat command now shows lots of routes and baresip defaults to WiFi just like I would like it to.
I will continue running some more tests but this seems to be a close enough solution.
Thank you for all your help!
from re.
Related Issues (20)
- Some example about JSON may mislead in retest HOT 1
- DNS client only queries first server (in most cases) HOT 5
- add RFC 6062 HOT 2
- accept 401 to re-REGISTER without WWW-Authenticate stale=true HOT 7
- Use database insted of File
- DNS resolution does not respect local configuration (/etc/hosts, avahi *.local, nsswitch.conf, etc) HOT 1
- Is there any demo for ICE ? HOT 1
- Can't Build on Docker from source HOT 2
- Can I use libre and librem in windows applications? How to compile as dll? HOT 7
- Via header address is set before TCP connection is established
- How to use rtmp_send_video to publish H264 frame?
- Issue with RTP Video over Network
- Upstream .so name versioning?
- Compilation with musl-libc fails
- libre can work based on the thirdpary Lwip?
- SIGABRT after tcp_close_handler derefs conn one too many times (race condition on socket close) HOT 2
- auth won't work for binary passwords containing zero byte characters
- config with sip device
- Shani gujjar
- WEB
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from re.