[OpenSIPS-Devel] ENUM lookups, q-value, and serialize_branches()

Phil Vandry vandry at TZoNE.ORG
Mon Oct 20 21:54:33 CEST 2008


On Mon, Oct 20, 2008 at 11:31:26AM +0200, Klaus Darilion wrote:
> I just wonder if it wouldn't be easier to leave the ENUM module as it is 
> but, after enum_query() call load_contacts() (in LCR module) and the 
> manually use the first contact_avp as new RURI.

(load_contacts() and serialize_branches() are pretty much equivalent.)

This handles the case where you want to use the best match and discard
all others, but it's kludgy: you have to do post-processing on the
result of enum_query(), using load_contacts() or serialize_branches()
in a way it wasn't really designed for (load_contacts() and
serialize_branches() are designed to be followed by next_contacts() and
next_branches() respectively).

I guess you could also implement the case where you want to consider
multiple records one at a time (push the AVP values to RURI one at a
time instead of using next_contacts() or next_branches()); it's
equally kludgy.

My motivation in proposing an option for how to use the results is
that the most commonly desired behaviour shouldn't require a somewhat
obscure sequence of post-processing instructions to implement. Maybe
you think it is not worth making a change to the function to improve
ease of use of the scripting language.

But the requirement to drop records with higher Order once you have
found a matching record is still unmet. I think it is important to
implement that, at least.

In addition to complying better with the standard, dropping records with
higher Order means the ENUM data can drive the decision of whether to
consider one record only or many: if all records have different values
for Order then only one can be considered but if they all have the same
value for Order then multiple records will be automatically considered.

-Phil



More information about the Devel mailing list