Daniel-Constantin Mierla writes:
For db only the sql query can be done only on ruid (for update and delete), there is a parameter for that now.
yes, but at least in case of unregister, the implementation is inefficient, because before calling delete, it needs to call get:
if (ul.get_urecord_by_ruid_d, ul.get_aorhash(&aor), _ruid, &r, &c) != 0) { LM_WARN("AOR/Contact not found\n"); return -1; } if (ul.delete_ucontact(r, c) != 0) { LM_WARN("could not delete contact\n"); return -1; }
that results in two db queries instead of one. another disadvantage is that aor needs to be available when unregister is called.
i'm currently testing new version of unregister that (if uri param is empty string), calls new ul api function delete_urecord_by_ruid.
once i get it tested, i would like to commit the code, because then unregister can be done more efficiently and without knowing what the aor is.
-- juha