[OpenSER-Users] case sensitivity with avp_db_load

Klaus Darilion klaus.mailinglists at pernau.at
Thu Oct 18 21:39:21 CEST 2007


Hi Daniel!

Daniel-Constantin Mierla wrote:
> On 10/17/07 16:10, Klaus Darilion wrote:
>> Currently I have users stored in DB with lower case letters. But I 
>> want to allow my user to use upper case letters as well. But this does 
>> not work as avp_db_load is case sensitive. Is there a way to handle 
>> avp_db_load case insensitive?
> is it postgres behind? AFAIK, mysql does ignore case comparison -- 
> although I may be wrong!

Yes it is postgres but AFAIK SQL queries are per default always case 
sensitive.

Here is the query from avp_db_load when the SIP request has 
sip:KLAUS.darilion at example.com in the From URI:

select value,attribute,type from conference_extension where 
username='KLAUS.darilion' AND domain='example.com' AND attribute='106'

As you see it is "username='string'" and a "=" comparison is case 
sensitive. For example in registrar module there is a module parameter 
for case insensitive lookups which will convert the strings into lower 
case for all SQL queries.

The problem is also with dbaliases module: if a user calls 
John.Doe at domain instead of john.doe at domain (which is the alias) it won't 
work:

select username,domain from dbaliases where alias_username='JohnDoe' AND 
alias_domain='example.com'

As you see the keys used by dbaliases module are the RURI.

> The issue comes from the database server, the value is passed as it is 
> gotten from the message. It is hard to predict what is the form in 
> database, upper case, lower case, mixed. Maybe the database server can 
> be configured to do ignore case string comparison.

I think the only solution would be to have a case_sensitive parameter 
(like in registrar module) in all relevant modules.

What do you think?

regards
klaus




More information about the Users mailing list