Discussion:
[SR-Users] MSILO not checking Expires header if Allow: is absent and Contact: is present but without expires
Anthony Messina
2014-07-18 19:04:23 UTC
Permalink
In setting up Kamailio with MSILO, I've noticed that some sip clients (I'm
using CSipSimple), upon un-REGISTER-ing do not send an Allow header, but do
send an "Expires: 0" header as well as a Contact header.

However as the Contact header doesn't contain "expires=0", it appears as
though the MSILO skips over checking the Expires header.

As such, I've had to add the following workaround to my route[REGISTRAR] block
or else these clients trigger the m_dump.

# Ensure we aren't unregistering
# Right now, CSipSimple doesn't send an Allow header with an un-REGISTER,
# so Kamailio skips to checking the Contact header for expires, and appears
# to ignore the fact that an Expires: 0 header is present.
if($hdr(Expires) != 0)
m_dump();


Looking through the msilo check_message_support function, it appears that it
never checks for the Expires header if there is no Allow header and the
Contact header does not specify an expire setting.

I do believe that we're missing the check for the Expires header, regardless
of whether or not there is an Allow header, or a Contact header with expires=0


-A
--
Anthony - http://messinet.com - http://messinet.com/~amessina/gallery
8F89 5E72 8DF0 BCF0 10BE 9967 92DC 35DC B001 4A4E
Daniel-Constantin Mierla
2014-07-21 08:16:38 UTC
Permalink
Hello,

can you try the patch from next commit?

http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6559c4383858d472637807c6ec4dd1e0616507fa

If works ok, I will backport.

Cheers,
Daniel
Post by Anthony Messina
In setting up Kamailio with MSILO, I've noticed that some sip clients (I'm
using CSipSimple), upon un-REGISTER-ing do not send an Allow header, but do
send an "Expires: 0" header as well as a Contact header.
However as the Contact header doesn't contain "expires=0", it appears as
though the MSILO skips over checking the Expires header.
As such, I've had to add the following workaround to my route[REGISTRAR] block
or else these clients trigger the m_dump.
# Ensure we aren't unregistering
# Right now, CSipSimple doesn't send an Allow header with an un-REGISTER,
# so Kamailio skips to checking the Contact header for expires, and appears
# to ignore the fact that an Expires: 0 header is present.
if($hdr(Expires) != 0)
m_dump();
Looking through the msilo check_message_support function, it appears that it
never checks for the Expires header if there is no Allow header and the
Contact header does not specify an expire setting.
I do believe that we're missing the check for the Expires header, regardless
of whether or not there is an Allow header, or a Contact header with expires=0
-A
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Anthony Messina
2014-07-21 08:24:39 UTC
Permalink
I will give this a try on Tuesday and let you know. Thanks. -A
Post by Daniel-Constantin Mierla
Hello,
can you try the patch from next commit?
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6559c4383858d472637807c6ec4dd1e0616507fa
If works ok, I will backport.
Cheers,
Daniel
Post by Anthony Messina
In setting up Kamailio with MSILO, I've noticed that some sip clients (I'm
using CSipSimple), upon un-REGISTER-ing do not send an Allow header, but do
send an "Expires: 0" header as well as a Contact header.
However as the Contact header doesn't contain "expires=0", it appears as
though the MSILO skips over checking the Expires header.
As such, I've had to add the following workaround to my
route[REGISTRAR] block
or else these clients trigger the m_dump.
# Ensure we aren't unregistering
# Right now, CSipSimple doesn't send an Allow header with an un-REGISTER,
# so Kamailio skips to checking the Contact header for expires, and appears
# to ignore the fact that an Expires: 0 header is present.
if($hdr(Expires) != 0)
m_dump();
Looking through the msilo check_message_support function, it
appears that it
never checks for the Expires header if there is no Allow header and the
Contact header does not specify an expire setting.
I do believe that we're missing the check for the Expires header, regardless
of whether or not there is an Allow header, or a Contact header with expires=0
--
Anthony - http://messinet.com - http://messinet.com/~amessina/gallery
8F89 5E72 8DF0 BCF0 10BE 9967 92DC 35DC B001 4A4E
Anthony Messina
2014-07-23 16:46:06 UTC
Permalink
Post by Daniel-Constantin Mierla
Hello,
can you try the patch from next commit?
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6559c438
3858d472637807c6ec4dd1e0616507fa
If works ok, I will backport.
This seems to work well:

ERROR: *** cfgtrace:request_route=[REGISTRAR] c=[/etc/kamailio/kamailio.cfg]
l=837 a=24 n=m_dump
DEBUG: msilo [msilo.c:994]: m_dump(): ------------ start ------------
DEBUG: msilo [msilo.c:1551]: check_message_support(): Allow message: 0
DEBUG: <core> [parser/msg_parser.c:106]: get_hdr_field(): found end of header
DEBUG: msilo [msilo.c:1015]: m_dump(): MESSAGE method not supported
ERROR: *** cfgtrace:request_route=[REGISTRAR] c=[/etc/kamailio/kamailio.cfg]
l=841 a=5 n=route

... With no futher output from msilo...

Thank you very much. -A
--
Anthony - http://messinet.com - http://messinet.com/~amessina/gallery
8F89 5E72 8DF0 BCF0 10BE 9967 92DC 35DC B001 4A4E
Daniel-Constantin Mierla
2014-07-25 09:09:33 UTC
Permalink
Thanks for testing and reporting the results, I will look to backport it
soon to 4.1 branch.

Cheers,
Daniel
Post by Anthony Messina
Post by Daniel-Constantin Mierla
Hello,
can you try the patch from next commit?
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6559c438
3858d472637807c6ec4dd1e0616507fa
If works ok, I will backport.
ERROR: *** cfgtrace:request_route=[REGISTRAR] c=[/etc/kamailio/kamailio.cfg]
l=837 a=24 n=m_dump
DEBUG: msilo [msilo.c:994]: m_dump(): ------------ start ------------
DEBUG: msilo [msilo.c:1551]: check_message_support(): Allow message: 0
DEBUG: <core> [parser/msg_parser.c:106]: get_hdr_field(): found end of header
DEBUG: msilo [msilo.c:1015]: m_dump(): MESSAGE method not supported
ERROR: *** cfgtrace:request_route=[REGISTRAR] c=[/etc/kamailio/kamailio.cfg]
l=841 a=5 n=route
... With no futher output from msilo...
Thank you very much. -A
--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Loading...