Re: How to count the first re-register request?

James Browne via sr-users <[email protected]>
Newsgroups gmane.comp.voip.ser
Message-ID <CAEpCD+qc1YdN3C9HuRJK-1K7zzivy-nLufLXgPA2wO+BoCA1UQ@mail.gmail.com>
Hi
In that case, I would get the return code of the pv_auth_check()
function and use that for the metrics.
- https://www.kamailio.org/docs/modules/devel/modules/auth.html#auth.f.pv_auth_check

It's not simple to look at a REGISTER request that has auth in it and
know whether it's a reREGISTER (after several minutes, for example, to
refresh a binding) or simply an authenticated REGISTER for which the
client has just been challenged, but this function can tell you by its
return code. The return codes are the same as those for
pv_www_authenticate().
- -4 (nonce expired)
- -6 (nonce reused)

Those two would tell you that the REGISTER credentials were
generated/used some time ago - default 600 seconds - and therefore
this must be a re-REGISTER.

Does that help?
James

On Tue, 20 May 2025 at 07:13, James Morrison via sr-users
<[email protected]> wrote:
>
> Thanks for reply
> I already know how to detect if it is a new register or re-register. As you know during registration UE first sends a register request which automatically fails the authentication (which is exactly what I want to count)  and then the next request with response to that authentication challenge. In scripts I just want to count the first request, but when it is a re-register, sometimes the first request has the authentication header and response value is not empty.
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions -- [email protected]
> To unsubscribe send an email to [email protected]
> Important: keep the mailing list in the recipients, do not reply only to the sender!
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the sender!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.