<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/4.4.4">
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#ffffff">
Hi,<BR>
<BR>
I am doing some work on this module right now myself.<BR>
<BR>
I did think of putting a bit of code into the auth module that, where the method is selected, checks to see if the request is an MSRP one and, if it is, selects the method using the same mechanism as for $msrp(method).<BR>
<BR>
I am also looking at the handling of the To-Path: header as I am not sure that is correct.&nbsp; If I have two MSRP clients connected to the same relay my To-Path: header in a SEND will be:
<PRE>
        To-Path: msrps://relay_address:relay_port/foo \                        &lt;-- From the Use-Path: in response to _MY_ AUTH
                        msrps://relay_address:relay_port/bar \                &lt;-- From the Use-Path: in response to peers AUTH
                        msrps://client_address:client_port/wibble        &lt;-- Peer
</PRE>
<BR>
This is based on RFC 4967 section 5.1 paragraph three:
<PRE>
        ... To form the To-Path header for outgoing
        requests, the client takes the list of URIs in the Use-Path header
        after the outermost authentication and appends the list of URIs
        provided in the path attribute in the peer's session description. ...
</PRE>
<BR>
The example event_route[] in the MSRP README contains the following logic for SEND handling:
<PRE>
                if($msrp(nexthops)&gt;1)
                {
                        msrp_reply(&quot;200&quot;, &quot;Received&quot;);
                        msrp_relay();
                        exit;
                }
                $var(sessid) = $msrp(sessid);
                if($sht(msrp=&gt;$var(sessid)::srcaddr) == $null)
                {
                        # one more hop, but we don't have address in htable
                        msrp_reply(&quot;481&quot;, &quot;No Such Session&quot;);
                        exit;
                }
                msrp_relay_flags(&quot;1&quot;);
                msrp_set_dst(&quot;$sht(msrp=&gt;$var(sessid)::srcaddr)&quot;,
                                &quot;$sht(msrp=&gt;$var(sessid)::srcsock)&quot;);
                msrp_relay();
                exit;
        }
</PRE>
<BR>
But I seem to have problems with this as the msrp_relay() when $msrp(nexthops) &gt; 1 fails (this could be related to my changes for WS support as it is a problem finding/creating a TCP connection to the next relay).&nbsp; However, ideally the MSRP relay should spot that the first two URIs on the To-Path: are itself and eat them both - setting $msrp(...) appropriately - rather than looping MSRP requests back to itself.<BR>
<BR>
Also, I think the same handling should be performed for routing REPORT requests too - so the overall logic of the MSRP event_route[] should be:<BR>
<BR>
<BLOCKQUOTE>
<PRE>
if (msrp_is_reply())
        msrp_relay();
else if ($msrp(method) == &quot;AUTH&quot;) {
        ...
} else if ($msrp(method) == &quot;SEND&quot; || $msrp(method) == &quot;REPORT&quot;) {
        ...
} else
        msrp_reply(&quot;501&quot;, &quot;Request-method-not-understood&quot;);
</PRE>
</BLOCKQUOTE>
<BR>
Regards,<BR>
<BR>
Peter<BR>
<BR>
<BR>
On Thu, 2012-10-25 at 13:16 +0200, Daniel-Constantin Mierla wrote:<BR>
<BLOCKQUOTE TYPE=CITE>
    Hello,<BR>
    <BR>
    just remembered about this one ...<BR>
    <BR>
    hmm, I would say now that the right method would be AUTH, not MSRP, but as you pointed, in SIP and HTTP the method is the first token in request. I guess you had no chance to test with some client or look at specs to see if they clarify somehow.<BR>
    <BR>
    In both cases, the method seems to be static anyhow, either AUTH or MSRP (iirc, the authentication is done only for AUTH). Both have the same length, so a quick hack would be to replace internally MSRP with AUTH for this case. But probably the safest is to extend the auth api with a function that takes the method as parameter, which is eventually used from inside msrp module.<BR>
    <BR>
    Probably before the next release I will put some efforts in this module, as the interest on it seems to increase, one of the goals being to add an internal hash table to track the connections - it should bring some performance improvement versus using htable in config...<BR>
    <BR>
    Cheers,<BR>
    Daniel<BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    On 10/19/12 3:58 PM, Peter Dunkley wrote:<BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE TYPE=CITE>
        Hi,<BR>
        <BR>
        MSRP AUTH requests must be authenticated using HTTP Digest authentication.&nbsp; Part of the concatenated data when doing this authentication is the method name.&nbsp; Because of the way MSRP requests are formatted, the part of the request-line that would contain the method name in HTTP or SIP requests is always MSRP.&nbsp; The MSRP method name (AUTH in this case) is at the end of the request-line.&nbsp; When Kamailio converts an MSRP request to SIP it has a method name of MSRP.<BR>
        <BR>
        This means that when Kamailio authenticates an MSRP request it uses &quot;MSRP&quot; as the method name, not the actual MSRP method name (AUTH).<BR>
        <BR>
        Is this correct?<BR>
        <BR>
        Should MSRP requests be authenticated with a method name of &quot;MSRP&quot; (which kind-of makes sense as this is the string at the start of the MSRP request line - which is where the method names are in HTTP and SIP) or should the MSRP method name of &quot;AUTH&quot; be used?<BR>
        <BR>
        If it is the later, does anyone know of an easy way to add this to Kamailio?<BR>
        <BR>
        Regards,<BR>
        <BR>
        Peter<BR>
        <BR>
        <TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>
-- 
Peter Dunkley
Technical Director
Crocodile RCS Ltd
</PRE>
</TD>
</TR>
</TABLE>
        <BR>
        <BR>
<PRE>
_______________________________________________
sr-dev mailing list
<A HREF="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</A>
<A HREF="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</A>
</PRE>
    </BLOCKQUOTE>
    <BR>
<PRE>
-- 
Daniel-Constantin Mierla - <A HREF="http://www.asipto.com">http://www.asipto.com</A>
<A HREF="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</A> - <A HREF="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</A>
Kamailio Advanced Training, Berlin, Nov 5-8, 2012 - <A HREF="http://asipto.com/u/kat">http://asipto.com/u/kat</A>
Kamailio Advanced Training, Miami, USA, Nov 12-14, 2012 - <A HREF="http://asipto.com/u/katu">http://asipto.com/u/katu</A>
</PRE>
</BLOCKQUOTE>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>
-- 
Peter Dunkley
Technical Director
Crocodile RCS Ltd
</PRE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>