Thank you.

On 22 Apr 2019, at 10:54, Liviu Chircu wrote:

> Sounds like an excellent suggestion to me -- I'll go ahead and move "number" 
> last.
> 
> Liviu Chircu
> OpenSIPS Developer
> http://www.opensips-solutions.com
> 
> On 22.04.2019 10:05, Dan Pascu wrote:
>> After the refactoring of the enum module the signatures of the functions are 
>> inconsistent.
>> 
>> enum_query([number], [suffix], [service])
>> i_enum_query([suffix], [service])
>> isn_query([suffix], [service])
>> 
>> It would make sense to allow all of them to accept the same arguments.
>> 
>> On a different note, regarding optional parameters, I would suggest they are 
>> ordered in such a way that the most used ones go first and least used ones 
>> are at the end. Another consideration with them is to try to preserve 
>> backward compatibility, so that the script doesn't need to be modified 
>> everywhere.
>> 
>> In this particular example, I would move number to be last for the following 
>> reasons:
>> 
>> 1. backward compatibility. previous code written like 
>> enum_query("e164.arpa") or enum_query("e164.arpa", "voice") still works 
>> without changes.
>> 
>> 2. suffix is the most used parameter here, followed by service. number is 
>> the least used as most of the time the request uri is what we want.
>> 
>> 3. calling functions like enum_query(, "e164.arpa") looks ugly. 
>> enum_query("e164.arpa", , $avp(enum_number)) while still not ideal, it looks 
>> more palatable.
>> 
>> --
>> Dan
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> Devel mailing list
>> [email protected]
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
> 
> _______________________________________________
> Devel mailing list
> [email protected]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


--
Dan





_______________________________________________
Devel mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel

Reply via email to