[sr-dev] Bug in transformations in kamailio 1.5

marius zbihlei marius.zbihlei at 1and1.ro
Wed Apr 28 15:19:41 CEST 2010


Hello,

I have a small configuration file containing just the following lines in 
the route block:

    $var(domain1)="sip:+491 at example.com";
    $var(domain2)="sip:491 at example.com";
    if( $(var(domain1){uri.user}{re.subst,/^\+//}) == 
$(var(domain2){uri.user}) ) {
        if ($(var(domain1){uri.domain}) == $(var(domain2){uri.domain})) {
        xlog("L_ERR", "TEST OK");
        }else  {
        xlog("L_ERR", "TEST FAILED");
        }
    }

The user check is ok, but somehow in 1.5 the domain check  fails. I have 
dug a little deeper and it seems that when comparing the uri.domain 
str's they are wrong(it compares xample.com to example.com, but the 
length of the str is still 11). The only way I could replicate this was 
with the use of
a re.subst expression. I guess this is the culprit, as removing it fixed 
the problem.

Any ideas on why this happens?

I didn't manage to replicate in ser, will try in kamailio 3.0.

Marius






More information about the sr-dev mailing list