[SR-Users] User connection history

Daniel Tryba d.tryba at pocos.nl
Thu Jan 10 10:44:02 CET 2019


On Thu, Jan 10, 2019 at 08:53:43AM +0100, Jos?? Antonio Guti??rrez Delgado wrote:
> Hello, what I need to know is when that user has been registered for the
> last time or, if possible, all the times he has been registered.
> 
> If you could tell me how the RPC commands are used, I would be very
> grateful, because I am starting with the servers and I do not master it
> very much.

RPC will only give you the current state. Something like
kamcmd ul.lookup location username
should give you the current info.

But for the history you have to add some logic like Dmitri already
suggested. Personally I xlog any authentication request (for use with
fail2ban to block bruteforces). Something like this works for me:

if (is_method("REGISTER|INVITE"))
{
   $var(authenticated)=www_authenticate("$rd", "subscriber");
   xlog("L_ALERT","AUTHENTICATE[$var(authenticated)]: $rm from $fu to $tu (IP:$si:$sp) $rd\n");

   if ($var(authenticated)!=1) 
   {
      www_challenge("$rd", "1");
      exit;
   }

   consume_credentials();
}




More information about the sr-users mailing list