Hi,

Issue:

In CPL, during a location lookup, the lookup fails
for users with an '_' in the user portion of the AOR.
For example, if the AOR is [EMAIL PROTECTED], cpl
registration lookup always fail.

Patch:

Use tolower(c) instead of (0x20)|(c) when building
the interpreters copy of the AOR.


John



Index: sip-server/modules/cpl-c/cpl.c
===================================================================
RCS file: /cvsroot/openser/sip-server/modules/cpl-c/cpl.c,v
retrieving revision 1.13
diff -u -r1.13 cpl.c
--- sip-server/modules/cpl-c/cpl.c      10 Oct 2006 18:45:56 -0000      1.13
+++ sip-server/modules/cpl-c/cpl.c      8 Nov 2006 16:13:25 -0000
@@ -494,7 +494,7 @@
                /* do we need to strip realm prefix? */
                if (cpl_env.realm_prefix.len && 
cpl_env.realm_prefix.len<domain->len){
                        for( i=cpl_env.realm_prefix.len-1 ; i>=0 ; i-- )
-                               if ( 
cpl_env.realm_prefix.s[i]!=((domain->s[i])|(0x20)) )
+                               if ( 
cpl_env.realm_prefix.s[i]!=tolower(domain->s[i]) )
                                        break;
                        if (i==-1)
                                do_strip = 1;
@@ -520,13 +520,13 @@
                p += username->len;
        } else {
                for(i=0;i<username->len;i++)
-                       *(p++) = (0x20)|(username->s[i]);
+                       *(p++) = tolower(username->s[i]);
        }
        if (sip || cpl_env.use_domain) {
                *(p++) = '@';
                /* host part in lower cases */
                for( i=do_strip*cpl_env.realm_prefix.len ; i< domain->len ; i++ 
)
-                       *(p++) = (0x20)|(domain->s[i]);
+                       *(p++) = tolower(domain->s[i]);
        }
        *(p++) = 0;
 
_______________________________________________
Devel mailing list
[email protected]
http://openser.org/cgi-bin/mailman/listinfo/devel

Reply via email to