Hi,
on our modems we have enabled JSON RPC (System -> Administration -> Access control).
We are using this API to obtain SIM ICCID number.
During tests we noticed that we can also send through this API command IP ROUTE :
{
"jsonrpc": "2.0", "id": 1, "method": "call", "params":
[
"session_key_number", "file", "exec",
{
"command":"IP",
"params":
[
"route"
]
}
]
}
As a response, we are getting promising results. This one is returned when modem is on wired connection:
{
"jsonrpc": "2.0",
"id": 1,
"result": [
0,
{
"code": 0,
"stdout": "default via 000.00.00.00 dev eth1 \ndefault via 000.00.00.00 dev wwan0 metric 10 \n000.00.00.00/21 dev eth1 proto kernel scope link src 000.00.00.00 \n000.00.00.00.1 dev eth1 proto static scope link src 000.00.00.00 \n000.00.00.00/30 dev wwan0 proto static scope link metric 10 \n000.00.00.00 dev wwan0 proto static scope link src 000.00.00.00 metric 10 \n000.00.00.00/24 dev br- lan
proto kernel scope link src 000.00.00.00 \n000.00.00.00 via 000.00.00.00 dev wwan0 \n000.00.00.00 via 000.00.00.00 dev wwan0 \n"
}
]
}
And this one when the modem is on cellular connection:
{
"jsonrpc": "2.0",
"id": 1,
"result": [
0,
{
"code": 0,
"stdout": "default via 000.00.00.00 dev wwan0 \n000.00.00.00/30 dev wwan0 proto static scope link metric 10 \n000.00.00.00 dev wwan0 proto static scope link src 000.00.00.00 metric 10 \n000.00.00.00/24 dev br-lan proto kernel scope link src 000.00.00.00 \n000.00.00.00 via 000.00.00.00 dev wwan0 \n000.00.00.00 via 000.00.00.00 dev wwan0 \n"
}
]
}
Can you confirm that we can use this command to obtain information about the current connection type (current WAN)? And if so, can we treat the first (default via 000.00.00.00 dev wwan0)line from stdout as a current connection type?