JFC-Group / JF-Customisation

Firmwares, Tips and Tricks regarding JF
139 stars 36 forks source link

api #1

Closed test2a closed 2 years ago

test2a commented 2 years ago

hi. i have been a jio fiber user for quite some time now and i feel pained in logging into the router to check stuff.

my idea. is there a way to get api access or something, like from a get/post which we can use existing solutions like homeassistant and connect the same there. for example, i would like to see how many connected users i have on the router, the homeassistant would send a get request and get data from there or something like that. just..... pushing ideas out

itsyourap commented 2 years ago

Will try my best! I just need to figure out the Authorization UID that is used by JioHome application to map out the mesh devices.. It will take a bit of time as I need to decompile JioHome application and figure out how the UID is generated.

test2a commented 2 years ago

I mean can't we use the web ui method? I assume it would be easier.

I have a use case where I have to update port forwarding to a local ipv6 which keeps changing.

itsyourap commented 2 years ago

Yes, it is possible but Using WEB-UI will take a lot of time to load coz it has to load all the html and JS to scrap the data! The JioHome solution is a direct api which will take a lot less time to load as compared to the WEB-UI Solution.

test2a commented 2 years ago

cool. maybe i am dreaming but imagine if we can expose jiocall api and use a normal sip to use telephony. that way we can get benefit of anywhere access to a phone number within the network without using that pesky app. i did not know about jiohome app and it seems to be a good thing for people in the jio ecosystem. if you are successful in this, homeassistant can be leveraged instead of jiohome and that opens a lot of possibilities. looking forward for updates. please keep me in the loop if you need to test something out

itsyourap commented 2 years ago

Found the APIs used by JioHome to control the Router... Anyway, couldn't find any API to block devices on the Router.. (JioHome doesn't have this feature) and also is removed from the WEB-UI (I couldn't find it anywhere)... So the only way to block devices under the JioFiber Router remains in the hands of MyJio...

test2a commented 2 years ago

i would be happy if we got current users from the router. you say you found the api, very nice.

i have to ask, do you know how jiovoice works? is it like a regular SIP because i was thinking, what if we use credentials from jio voice and use in a SIP client like https://github.com/DoubangoTelecom/sipml5. that way, we can have a dedicated Rpi device for outgoing calls via a regular phone like jio already does but also by hosting this sip client on a Rpi and locally using any browser to access the same. that would be great.

itsyourap commented 2 years ago

Thanks for the suggestion. I would like to inform you that there is a limited number of APIs till now in JioFiber Firmware:-

  1. Login
  2. Forced Login
  3. Change password of user accounts
  4. Getting the Wi-Fi SSIDs and Passwords
  5. Getting the Device Topology (i.e., the connected devices)
  6. Get Wi-Fi status (On or Off)
  7. Get Mesh Status (On or Off)
  8. Enable or Disable Wi-Fi
  9. Enable or Disable Mesh

Also, I am trying to figure out how JioCall works right now. Will let you know if I find anything.

test2a commented 2 years ago

what exactly is the mesh thing?

itsyourap commented 2 years ago

Mesh lets you to use repeater with your Router AFAIK.

Mesh routers enable devices in your network to have faster speeds, greater coverage, and a more reliable connection. While traditional routers broadcast WiFi from a single point, mesh WiFi systems have multiple access points.

test2a commented 2 years ago

cool. i do understand the tech bit in jio context, not much. anyways, https://github.com/ericpignet/home-assistant-tplink_router something like this with what you found. a this might be helpful for a lot of people who are into automation and stuff

itsyourap commented 2 years ago

I have already found the SIP Credentials but the problem is it works quite differently in this case. For example, the realm FQDN is available only under Jio's internal DNS to which only the Router is connected. Elsewhere the FQDN returns a NXDOMAIN.

You can also get yourself your SIP Credentials just in the dbglog labelled as something like "VoiceAppCCs.dat".

Also, I would like you to explore the dbglog once as it contains many useful information like CPE parameters (XML received from TR-069), SIP Logs, System Logs, Debug Output, etc...

test2a commented 2 years ago

I have a question, when a user installs and opens JIOVOICE on a jio network, how does it authenticate with router? My assumption is we need to mimic jiovoice app and then any sip client should work? Would that work ?

itsyourap commented 2 years ago

That is exactly what I am trying to figure out. But the problem is the JioCall app is greatly obsfucated hence its really hard to understand. The app's launch activity is com.witsoftware.wmc.application.p052ui.HomeActivity.java which says the app isn't built by Jio (like JioHome, which was easy to understand) but by Wit-Software. Its really hard to understand the algorithm.

Also for the router authentication, the app communicates with this link : _http://192.168.29.1:8080/request_account_

test2a commented 2 years ago

i totally forgot about this https://github.com/test2a/JioFiberwebhosting so what i did was i manually updated the ipv6 address of the raspberry pi so that it can be allowed in the firewall.

do you think this can be done via post? i have attempted to do that with python but its not pretty.

https://github.com/test2a/JioFiberautomation

so my idea is to get current ip via

ifconfig eth0| grep 'inet6' | grep 'global' | awk '{ print $2}'

to a text file and hopefully bash can push it to router without going through python and selenium which is hacky at best.

Otus9051 commented 2 years ago

Yes, you can host websites with IPv6, infact, I have already tried it, only caveat is, many people do not support IPv6. Also to note, Jio never builds their own thing, they always have a partnership with some company which saves them a ton of money.

test2a commented 2 years ago

@Otus9051 what this project does is bypass the ipv6 thing. so it uses duckdns to get your ipv6, then its free for all. i used this to get assistance, SSH from a guy living in finland last time.

the problem is when jio changes your IPV6, that new address has to be manually added to jio router config page to allow it outside access. if i can do it programatically, that would automate it completly.

test2a commented 2 years ago

@Otus9051 just go through my projects linked and you would understand my problem.

Otus9051 commented 2 years ago

the problem is when jio changes your IPV6, that new address has to be manually added to jio router config page to allow it outside access. if i can do it programatically, that would automate it completly.

For me tho, I have a JCO4032, I didn't have to do that, i just port forwarded it and it worked. I also used DuckDNS.

test2a commented 2 years ago

@Otus9051 how do you do the port forwarding? i want to know that bit

Otus9051 commented 2 years ago

Open WebUI -> Security -> Firewall -> Port Forwarding -> Add New -> Add your INTERNAL IP in the Destination Address -> Select Port and stuff -> Save image

test2a commented 2 years ago

@Otus9051 yes exactly. i want some api to push data to this page programatically so i do not have to manually update it everytime the ipv6 changes. manually is fine and i do that but i want to automate it with bash or something

Otus9051 commented 2 years ago

You don't need to update it... It stays as is after you do it.

Otus9051 commented 2 years ago

If you are talking about the IP at DuckDNS, then yes you may need to automate it. If you are talking about the Internal IP, there is a trick to set a static internal IP for a particular MAC Address. Go to WebUI -> Network -> LAN -> LAN IPv4 Reserved IPs -> Add New -> Add your Computer Name (put it as whatever you like), your desired IP Address and MAC Address. image

test2a commented 2 years ago

Screenshot_20211109_104315

test2a commented 2 years ago

i checked my home now. i have set ipv6 address in the firewall

test2a commented 2 years ago

i have to update it often manually because this ipv6 is changing and that new address needs to be put in this box

Otus9051 commented 2 years ago

You are in the wrong section. You need to be at Port Forwarding and not IPv6 Firewall Rules.

test2a commented 2 years ago

what why....

test2a commented 2 years ago

when i do this, the ipv6 is global accessible. what should i have done?

Otus9051 commented 2 years ago

I mean both work but going in Port Forward is better as you don't need to manually update it on your side, instead, you need to update it on DuckDNS' side

test2a commented 2 years ago

Screenshot_20211109_104728

Otus9051 commented 2 years ago

Do you have something like Discord where we can talk then fully summarize the topic? this place is getting messy as hell.

test2a commented 2 years ago

sure. will matrix work?

test2a commented 2 years ago

john. sent

test2a commented 2 years ago

i already sent to that address. check

Otus9051 commented 2 years ago

Element is drunk. Send me your ID

itsyourap commented 2 years ago

Couldn't manage to work with the SIP Credentials found in the dbglog. Please take a look at these files in the dbglog :-

JuiceLog.txt
JuiceConfig.cfg
FixedVoiceCcsXML.dat

These files do contain helpful information regarding the usage of SIP in the router but I am not able to reproduce it on my side.

I am closing this issue for now.

k4976 commented 1 year ago

Thanks for the suggestion. I would like to inform you that there is a limited number of APIs till now in JioFiber Firmware:-

  1. Login
  2. Forced Login
  3. Change password of user accounts
  4. Getting the Wi-Fi SSIDs and Passwords
  5. Getting the Device Topology (i.e., the connected devices)
  6. Get Wi-Fi status (On or Off)
  7. Get Mesh Status (On or Off)
  8. Enable or Disable Wi-Fi
  9. Enable or Disable Mesh

Also, I am trying to figure out how JioCall works right now. Will let you know if I find anything.

Bro have you get apis used in jiohome app, i need it because when i use web ui to get data from it many times all connected devices won't be shown or sometimes uptime, ipv4 or ipv6 ip also not available but devices is connected to jiofiber and internet is also working and when i request for lan clients stats it took to around 5< secs to get data from jiofiber

one thing also happend when i fetching data one time all connected devices shown and when i request 2nd time it won't be available and then again in 3rd request it's showing data device which is missing in 2nd request and uptime is also proper means it won't disconnect while 2nd request but still won't shown correctly

Please share jiohome api with me so that i can get proper & correct data quickly

itsyourap commented 1 year ago

@k4976 Please see #20 to know about the APIs