I want to count the first REGISTER request during an initial register or re-register from UE. In my scscf instance, I have defined att_init_reg and att_rereg counters to count the number of initial registers and re-registers respectively. In my early tests, the following piece of logic worked as expected to filter the very first register request (one that is sent from UE before getting challenged). However, more tests showed that during re-registers, UE sends a REGISTER request, containing an authorization header and non-empty response, in that case the code is unable to distinguish a re-register attempt and the related counter fails to increment. Is there a way to fix this issue?
#!ifdef WITH_XHTTP_PROM /* Only count the first register request */ if (!is_present_hf("Authorization") || search_hf("Authorization","response=""","f")) { if ($var(impu_registered) != 1) { prom_counter_inc("att_init_reg", "1"); } else { prom_counter_inc("att_rereg", "1"); } } #!endif