2

i'm working with php api by Mikrotik, but i do not how control if the user is disconnected do not run the limit-uptime?

this is my code

$API->write("/ip/hotspot/user/add", false);
$API->write("=name=".$usuario, false);
$API->write("=limit-uptime=".$segundos, false);
$API->write("=password=".$password, true);
Miguel Garcia
  • 23
  • 1
  • 5

2 Answers2

1

Since version v6.34 of RouterOS you should use the following API command:

ip hotspot active login user="user" password="password" mac-address="AA:BB:CC:00:1122" ip="10.5.50.1"

You have to search in the ARP for the IP the device has assigned if you know its MAC address.

Also I strongly recommend to use the PEAR2/Net/RouterOS library, is much more simple than the older you are using.

Good luck ;)

Andreu Ramos
  • 2,758
  • 2
  • 22
  • 35
0

There is a "Keep-Alive" option in the user Hotspot configuration that controls this behavior.

Cody Gray
  • 222,280
  • 47
  • 466
  • 543
Miguel Garcia
  • 23
  • 1
  • 5