Hi All,
I am trying to integrate Kamailio (1.5.2-notls) into our existing database structure using a view for the subscriber table and using the location table to store the registration information.
I am successfully able to register a phone using this method.
One of our requirements is to set an "outboundproxy" and "outboundproxyport" parameter in the location table for a particular sip account (username). I am trying to do this with the sqlops module.
What I have come across though is that when the registration information is saved to the location table the username is stored in lower case. So when my sqlops query is run against the username it does not match.
Is there a way to tell the usrloc module to store the username in the same case as it is received?
For example, in the subscriber table I have view defined that for my user account returns the following information:
------------- select * from subscriber where username = 'BruceNW9440'; username | domain | password | ha1 | ha1b -------------+---------------+------------+----------------------------------+---------------------------------- BruceNW9440 | 10.10.10.10 | 00minger00 | 1f2d688f65be04a61cab36a1fb3f426a | 6529d45f5c418daf35be7b3dd4a858cb (1 row) -------------
Now, if I check the above against the location table:
-------------- select * from location where username = 'BruceNW9440';
0 rows returned --------------
If I run the same query using "brucenw9440" as the username (lowercase) then the correct information is returned.
I have the following log line in my kamailio configuration script:
xlog("L_INFO","Username: $au, OutboundProxy: $Ri, OutboundProxyPort: $Rp");
The details of this log appear correct when it is logged:
Dec 9 14:21:03 ibis /opt/kamailio/sbin/kamailio[16972]: [ID 197553 local0.info] Username: BruceNW9440, OutboundProxy: 10.10.10.10, OutboundProxyPort: 5060
However, when my sqlopt query is run it does not find a match because of the incorrect case:
sql_query("bfl", "UPDATE location SET outboundproxy = '$Ri', outboundproxyport = '$Rp' WHERE username = '$au'", "res");
I've had a read through the usrloc module documentation and I cannot seem to find a reference to any options that will preserve the case. I also cannot find if there is a parameter to save('location') that will preserve the case. I cant seem to find a reference to the save() function on the wiki. I must be missing something small.
We have some sip usernames that are case sensitive so any help in being able to resolve this would be greatly appreciated.
Thanks Bruce
El Miércoles, 9 de Diciembre de 2009, Bruce McAlister escribió:
According to RFC 3261 BNF grammar, the username part of a SIP URI is case sensitive, this is:
sip:alice@domain.org != sip:Alice@domain.org
but domain part is case insensitive so:
sip:alice@domain.org == sip:alice@DOMain.ORG
The former case is a bug in usrloc module as it should respect the exact string for the username part. Please report it in the tracker.
Regards.
El Miércoles, 9 de Diciembre de 2009, Bruce McAlister escribió:
http://sourceforge.net/tracker/?group_id=139143&atid=743020
Hi Iñaki
Iñaki Baz Castillo wrote:
I have now logged this bug in the bug tracker, it can be found here:
https://sourceforge.net/tracker/?func=detail&aid=2911707&group_id=13...
Thanks Bruce
Hello,
two things to mention here: - there is a transformation that can be used to convert to lower case: http://www.kamailio.org/dokuwiki/doku.php/transformations:3.0.x#s.tolower
Good for using it in sqlops queries.
- there is a parameter for registrar module that controls the case sensitiveness (I mentioned it in the tracker -- I haven't used it, but should work, is there from the time of ser 0.9).
Cheers, Daniel
On 12/10/09 12:13 AM, Bruce McAlister wrote:
El Jueves, 10 de Diciembre de 2009, Daniel-Constantin Mierla escribió:
I didn't know it :)