[sr-dev] propose change strncmp to strncasecmp in presence module
Alex Balashov
abalashov at evaristesys.com
Thu Feb 19 02:53:40 CET 2015
Then, why would we make this change? :-)
--
Sent from my BlackBerry. Please excuse errors and brevity.
Original Message
From: Luis Azedo
Sent: Wednesday, February 18, 2015 8:52 PM
To: Kamailio (SER) - Development Mailing List
Reply To: Kamailio (SER) - Development Mailing List
Subject: Re: [sr-dev] propose change strncmp to strncasecmp in presence module
Hi Alex,
i guess not. the user part is case sensitive.
The URIs within each of the following sets are equivalent:
sip:%61lice at atlanta.com;transport=TCP
sip:alice at AtLanTa.CoM;Transport=tcp
sip:carol at chicago.com
sip:carol at chicago.com;newparam=5
sip:carol at chicago.com;security=on
sip:biloxi.com;transport=tcp;method=REGISTER?to=sip:bob%40biloxi.com
sip:biloxi.com;method=REGISTER;transport=tcp?to=sip:bob%40biloxi.com
sip:alice at atlanta.com?subject=project%20x&priority=urgent
sip:alice at atlanta.com?priority=urgent&subject=project%20x
The URIs within each of the following sets are not equivalent:
SIP:ALICE at AtLanTa.CoM;Transport=udp (different usernames)
sip:alice at AtLanTa.CoM;Transport=UDP
sip:bob at biloxi.com (can resolve to different ports)
sip:bob at biloxi.com:5060
________________________________________
From: sr-dev [sr-dev-bounces at lists.sip-router.org] on behalf of Alex Balashov [abalashov at evaristesys.com]
Sent: Wednesday, February 18, 2015 4:45 PM
To: sr-dev at lists.sip-router.org
Subject: Re: [sr-dev] propose change strncmp to strncasecmp in presence module
Does the SIP grammar consider differently-cased resource identifiers to
be equivalent?
On 02/18/2015 07:44 PM, Luis Azedo wrote:
> Hi,
>
> sometimes UAs do subscriptions using mixed case uris which most of the
> times leads to NOTIFY messages not getting to the UA.
>
> if used with subs_db_mode = 3 and a case insensitive dbengine it works.
>
> however, if we use other value on subs_db_mode it doesn't work or
> behaves poorly (missing cache)
>
> should we make string insensitive matches in presence module for uris ?
> i marked the 10 occurrences with >>>
>
> Thank You
>
> [lazedo at dev-01 presence]# grep strncmp . -R
> ./subscribe.c:if(ev_param->name.len== 2 && strncmp(ev_param->name.s,
> "id", 2)== 0)
> ./utils_func.h:if(strncmp(ip.s, "sip:", 4)!=0)
> ./hash.c:strncmp(s->callid.s, callid.s, callid.len)==0 &&
> ./hash.c:strncmp(s->to_tag.s, to_tag.s, to_tag.len)==0 &&
> ./hash.c:strncmp(s->from_tag.s, from_tag.s, from_tag.len)== 0)
> ./hash.c:&& strncmp(s->to_tag.s,subs->to_tag.s,subs->to_tag.len)==0)
> ./hash.c:&& strncmp(s->callid.s,subs->callid.s,subs->callid.len)==0
> ./hash.c:&& strncmp(s->to_tag.s,subs->to_tag.s,subs->to_tag.len)==0
> ./hash.c:&& strncmp(s->from_tag.s,subs->from_tag.s,subs->from_tag.len)==0)
> >>> ./hash.c:if(strncmp(s->contact.s, subs->contact.s, subs->contact.len))
> >>>./hash.c:strncmp(p->pres_uri.s, pres_uri->s, pres_uri->len)== 0 )
> ./presence.c:(reason.s && subs.reason.s && strncmp(reason.s, subs.reason.s,
> >>>./presence.c:strncmp(s->pres_uri.s, subs->pres_uri.s,
> subs->pres_uri.len)== 0 &&
> >>>./presence.c:strncmp(s->watcher_user.s, subs->watcher_user.s,
> s->watcher_user.len)== 0 &&
> >>>./presence.c:strncmp(s->watcher_domain.s,subs->watcher_domain.s,s->watcher_domain.len)==0)
> ./presence.c: if ((subs.reason.len == 12) && (strncmp(subs.reason.s,
> "polite-block", 12) == 0))
>>>>./presentity.c:strncmp(presentity->sender->s, sender.s, sender.len)== 0))
> ./event_list.c:if(sep && strncmp(sep+1, "winfo", 5)== 0)
> ./event_list.c:strncmp(p->name.s,ps->name.s, ps->name.len)== 0)
> ./event_list.c:strncmp(p->body.s,ps->body.s,ps->body.len)== 0))
>>>>./notify.c:strncmp(s->pres_uri.s, subs->pres_uri.s,subs->pres_uri.len)== 0)
> >>>./notify.c:strncmp(sender.s, contact->s, sender.len)== 0)
> ./notify.c:if( (etags.len == etag->len) && (strncmp(etags.s,
> >>>./notify.c:strncmp(s->pres_uri.s, pres_uri->s, pres_uri->len)== 0)) ||
> >>>./notify.c:strncmp(sender->s, s->contact.s, sender->len)== 0))
> ./notify.c:subs->reason.len== 12 && strncmp(subs->reason.s,
> "polite-block", 12)== 0)
> ./notify.c:if(w->uri.len == wuri.len && strncmp(w->uri.s, wuri.s,
> wuri.len)== 0)
>
>
>
>
> _______________________________________________
> sr-dev mailing list
> sr-dev at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>
--
Alex Balashov - Principal
Evariste Systems LLC
235 E Ponce de Leon Ave
Suite 106
Decatur, GA 30030
United States
Tel: +1-678-954-0670
Web: http://www.evaristesys.com/, http://www.alexbalashov.com/
_______________________________________________
sr-dev mailing list
sr-dev at lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
_______________________________________________
sr-dev mailing list
sr-dev at lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
More information about the sr-dev
mailing list