[Kamailio-Devel] case sensitive matching

Iñaki Baz Castillo ibc at aliax.net
Thu Oct 2 21:10:49 CEST 2008


El Jueves, 2 de Octubre de 2008, Daniel-Constantin Mierla escribió:
> Hello,
>
> related to case sensitiveness required by comparisons, see:
>
> http://sourceforge.net/tracker/index.php?func=detail&aid=2047019&group_id=1
>39143&atid=743023
>
> Do you think there is good to have dedicated operators for case
> sensitive comparisons in config file as well?

I don't know if it's possible, but the best way would be to create a 
different "==" for each part:

- URI userinfo part:  $ru == "aliCE"
  - Case sensitive
  - Allows hexadecimal escaping ("aliCE"  ==
   "%61aliCE  !=  "aliCE")

- URI protocol and domain:  $rp == "sip", $rd == "domain.org"
  - Case insensitive

- URI parameters/headers:
  - Case insensitive
  - Allows hexadecimal escaping in key and value (";tag=aliCE"  ==
   "T%61G=%61aliCE )

- Complete URI:  $uri == "sip:user at domain"
  Is it possible to compare each part of the URI as above?


>
> For example:
> - == - does now ignore-case comparison

I think this is perfect since all the SIP grammarm, except URI username and 
method names (INVITE, BYE...), are case insensitive (header name, header 
value...).


> - === - should do case sensitive comparison (I think this operator
> exists in other languages as well, not sure exactly the purpose)

AFAIK the meaning of "===" operator changes in each language.


Regards.

-- 
Iñaki Baz Castillo



More information about the Devel mailing list