Hi Bogdan,
I tried it and it works fine. It is also important that when the table is cached into memory that it is done in lowercase. I searched briefly but could not locate the code where this is done (maybe in the DB module?).
I tried puting a domain in uppercase letters into MySQL while having the
From header in lowercase. This worked also.
thank you
George
-----Original Message----- From: Bogdan-Andrei Iancu [mailto:bogdan@voice-system.ro] Sent: Monday, March 13, 2006 2:33 PM To: Papadopoulos Georgios Cc: daniel@voice-system.ro; users@openser.org; Juha Heinanen Subject: Re: [Users] Domain: is_from_local() is case sensitive in caching mode.
Hi George,
right indeed - I fixed this problem on CVS. please update and give it a try id everything ok.
the PDT (Prefix-to-Domain Translation) module was affected by this problem.
thanks for report, bogdan
Papadopoulos Georgios wrote:
Hello,
I have been looking into the code. strncasecmp does case insensitive comparison, so this part is correct. My guess is that the hash function should use the lowercase domain.
In my case I have in the domain table "i-call.gr" and
"sip.i-call.gr".
If the From header is ....@i-Call.gr then is_from_local()
returns false
(in caching mode).
I hope this helps
George
-----Original Message----- From: Bogdan-Andrei Iancu [mailto:bogdan@voice-system.ro] Sent: Monday, March 13, 2006 11:32 AM To: Papadopoulos Georgios Cc: daniel@voice-system.ro; users@openser.org; Juha Heinanen Subject: Re: [Users] Domain: is_from_local() is case sensitive in caching mode.
Hi Georgios,
indeed, the search through the cache is done case sensitive via strncasesmp().
Juha, souldn't the domain matching be case insensitive?
regards, bogdan
Georgios Papadopoulos wrote:
I am pretty sure (I am using OpenSER 1.0.0). What about the part where the table is cached into memory?
Do you do
select lower(domain) from domain? I tried briefly to find
the relevant
piece of code but I couldn't.
George
-----Original Message----- From: Daniel-Constantin Mierla [mailto:daniel@voice-system.ro] Sent: Saturday, March 11, 2006 3:50 PM To: Papadopoulos Georgios Cc: users@openser.org Subject: Re: [Users] Domain: is_from_local() is case sensitive in caching mode.
Hello,
On 03/10/06 17:51, Papadopoulos Georgios wrote:
Hello,
I have noticed that is_from_local in the Domain module is case-sensitive if the module is in caching mode. In
non-caching mode
it is case insensitive. Could this be fixed in the future?
are you sure? I was looking in the sources and the comparison is case-insensitive.
Cheers, Daniel
thank you
George
Disclaimer The information in this e-mail and any attachments is
confidential. It is intended solely for the attention and
use of the
named addressee(s). If you are not the intended recipient,
or person
responsible for delivering this information to the intended
recipient,
please notify the sender immediately. Unless you are the intended recipient or his/her representative you are not
authorized to, and
must not, read, copy, distribute, use or retain this
message or any
part of it. E-mail transmission cannot be guaranteed to be
secure or
error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses.
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users
Disclaimer The information in this e-mail and any attachments is
confidential. It is intended solely for the attention and use of the named addressee(s). If you are not the intended recipient, or person responsible for delivering this information to the intended recipient, please notify the sender immediately. Unless you are the intended recipient or his/her representative you are not authorized to, and must not, read, copy, distribute, use or retain this message or any part of it. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses.
Papadopoulos Georgios writes:
I tried it and it works fine. It is also important that when the table is cached into memory that it is done in lowercase. I searched briefly but could not locate the code where this is done (maybe in the DB module?).
it is done by hash.c/hash_table_install function. you could add statement
for (i = 0; i < np->domain.len; i++) domain[i] = tolower(domain[i]);
before
(void) strncpy(np->domain.s, domain, np->domain.len);
-- juha
still is not clear for me what will be the advantage of keeping the domain names into the cache in a specific format? what is here important is how they are compared...
regards, bogdan
Juha Heinanen wrote:
Papadopoulos Georgios writes:
I tried it and it works fine. It is also important that when the table is cached into memory that it is done in lowercase. I searched briefly but could not locate the code where this is done (maybe in the DB module?).
it is done by hash.c/hash_table_install function. you could add statement
for (i = 0; i < np->domain.len; i++) domain[i] = tolower(domain[i]);
before
(void) strncpy(np->domain.s, domain, np->domain.len);
-- juha
Bogdan-Andrei Iancu writes:
still is not clear for me what will be the advantage of keeping the domain names into the cache in a specific format? what is here important is how they are compared...
i think you are right. as long as hash calculation is always done on lower case domain name and if comparison is done case insensitively, it should not matter how domain names are stored.
-- juha