<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi Daniel,<br>
    <br>
    Thanks for the fix.&nbsp; It works fine for me.<br>
    <br>
    Peter<br>
    <br>
    <div class="moz-cite-prefix">On 11/02/13 22:45, Daniel-Constantin
      Mierla wrote:<br>
    </div>
    <blockquote cite="mid:51197484.4050900@gmail.com" type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      Hello,<br>
      <br>
      just refreshed myself with the code -- for some reason the
      response code is kept internally with an offset of 10000 (e.g.,
      reply code 200 is stored as 10200). At this time I couldn't
      remember why I decided this way, maybe because it is stored in a
      field used also for requests method type, to avoid overlapping
      value.<br>
      <br>
      Anyhow, there should be a fix pushed in the master branch to
      return the value from msrp message. Let me know if works.<br>
      <br>
      Cheers,<br>
      Daniel<br>
      <br>
      <div class="moz-cite-prefix">On 2/7/13 5:16 PM, Peter Dunkley
        wrote:<br>
      </div>
      <blockquote
        cite="mid:1360253786.11941.1.camel@pd-notebook-linux.croc.internal"
        type="cite">
        <meta http-equiv="Content-Type" content="text/html;
          charset=ISO-8859-1">
        <meta name="GENERATOR" content="GtkHTML/4.6.2">
        It's just MSRP responses (I've only gotten the client stack to
        generate 200 OKs).<br>
        <br>
        Regards,<br>
        <br>
        Peter<br>
        <br>
        On Thu, 2013-02-07 at 16:38 +0100, Daniel-Constantin Mierla
        wrote:<br>
        <blockquote type="CITE"> Hello,<br>
          <br>
          I will look over it very soon, just didn't get time yet.<br>
          <br>
          Is it for all messages, or just for some particular ones?<br>
          <br>
          Cheers,<br>
          Daniel<br>
          <br>
        </blockquote>
        <blockquote type="CITE"> On 2/7/13 11:46 AM, Peter Dunkley
          wrote:<br>
          <br>
        </blockquote>
        <blockquote type="CITE">
          <blockquote type="CITE"> Hi,<br>
            <br>
            Has anyone got any ideas about this, because it has me very
            confused.<br>
            <br>
            Peter<br>
            <br>
            On Wed, 2013-02-06 at 16:28 +0000, Peter Dunkley wrote:<br>
            <blockquote type="CITE"> Possible - but the inside the MSRP
              function the pv_get_intstrval() function is used, so in
              both the examples from my email I would expect $msrp(code)
              to resolve to an integer with a value of 200.<br>
              <br>
              Regards,<br>
              <br>
              Peter<br>
              <br>
              On Wed, 2013-02-06 at 14:09 -0200, Edson - Lists wrote:
              <blockquote type="CITE">
                <pre>Just a guess....

hex('\n') =&gt; 0x0a or '10'

So, 10200 = concat('10','200')... don't know why... but that's a hint...

Edson.

Em 06/02/2013 14:03, Peter Dunkley escreveu:
<font color="#737373">&gt;</font>
<font color="#737373">&gt; I am having strange behaviour with $msrp(code).</font>
<font color="#737373">&gt;</font>
<font color="#737373">&gt; The following config. fragment:</font>
<font color="#737373">&gt;</font>
<font color="#737373">&gt;          if (msrp_is_reply()) {</font>
<font color="#737373">&gt;                  xlog("Code: $msrp(code)\n");</font>
<font color="#737373">&gt;                  if ($msrp(code) &lt; 300) {</font>
<font color="#737373">&gt;                          xlog("Received OK MSRP reply\n");</font>
<font color="#737373">&gt;                  } else {</font>
<font color="#737373">&gt;                          xlog("Received failure MSRP reply\n");</font>
<font color="#737373">&gt;                  }</font>
<font color="#737373">&gt;</font>
<font color="#737373">&gt;</font>
<font color="#737373">&gt; Produces the following output:</font>
<font color="#737373">&gt;</font>
<font color="#737373">&gt;     Feb  6 15:55:02 blade14 /usr/sbin/kamailio[3831]: ERROR: &lt;script&gt;: Code: 200</font>
<font color="#737373">&gt;     Feb  6 15:55:02 blade14 /usr/sbin/kamailio[3831]: ERROR: &lt;script&gt;: Received failure MSRP reply</font>
<font color="#737373">&gt;</font>
<font color="#737373">&gt;</font>
<font color="#737373">&gt; Which I can't explain as 200 is clearly less than 300.</font>
<font color="#737373">&gt;</font>
<font color="#737373">&gt; It gets even stranger when I change the config. to this:</font>
<font color="#737373">&gt;</font>
<font color="#737373">&gt;          if (msrp_is_reply()) {</font>
<font color="#737373">&gt;                 $var(tmp) = $msrp(code)</font>
<font color="#737373">&gt;                  xlog("Code: $var(tmp)\n");</font>
<font color="#737373">&gt;                  if ($var(tmp) &lt; 300) {</font>
<font color="#737373">&gt;                          xlog("Received OK MSRP reply\n");</font>
<font color="#737373">&gt;                  } else {</font>
<font color="#737373">&gt;                          xlog("Received failure MSRP reply\n");</font>
<font color="#737373">&gt;                  }</font>
<font color="#737373">&gt;</font>
<font color="#737373">&gt;</font>
<font color="#737373">&gt; And this is the output:</font>
<font color="#737373">&gt;</font>
<font color="#737373">&gt;     Feb  6 15:56:17 blade14 /usr/sbin/kamailio[3831]: ERROR: &lt;script&gt;: Code: 10200</font>
<font color="#737373">&gt;     Feb  6 15:56:17 blade14 /usr/sbin/kamailio[3831]: ERROR: &lt;script&gt;: Received failure MSRP reply</font>
<font color="#737373">&gt;</font>
<font color="#737373">&gt;</font>
<font color="#737373">&gt; The MSRP response here was a 200 OK.  So where did the 10200 come from?</font>
<font color="#737373">&gt;</font>
<font color="#737373">&gt;</font>
<font color="#737373">&gt; Regards,</font>
<font color="#737373">&gt;</font>
<font color="#737373">&gt; Peter</font>
<font color="#737373">&gt;</font>
<font color="#737373">&gt; --</font>
<font color="#737373">&gt; Peter Dunkley</font>
<font color="#737373">&gt; Technical Director</font>
<font color="#737373">&gt; Crocodile RCS Ltd</font>
<font color="#737373">&gt;</font>
<font color="#737373">&gt;</font>
<font color="#737373">&gt;</font>
<font color="#737373">&gt; _______________________________________________</font>
<font color="#737373">&gt; sr-dev mailing list</font>
<font color="#737373">&gt; <a moz-do-not-send="true" href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a></font>
<font color="#737373">&gt; <a moz-do-not-send="true" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a></font>
<font color="#737373">&gt;</font>
</pre>
              </blockquote>
              <br>
              <table width="100%" cellpadding="0" cellspacing="0">
                <tbody>
                  <tr>
                    <td>
                      <pre>_______________________________________________
sr-dev mailing list
<a moz-do-not-send="true" href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a>
<a moz-do-not-send="true" 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>
                    </td>
                  </tr>
                </tbody>
              </table>
            </blockquote>
            <table width="100%" cellpadding="0" cellspacing="0">
              <tbody>
                <tr>
                  <td>
                    <pre>-- 
Peter Dunkley
Technical Director
Crocodile RCS Ltd
</pre>
                  </td>
                </tr>
              </tbody>
            </table>
            <br>
            <br>
            <br>
            <pre>_______________________________________________
sr-dev mailing list
<a moz-do-not-send="true" href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a>
<a moz-do-not-send="true" 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 moz-do-not-send="true" href="http://www.asipto.com">http://www.asipto.com</a>
<a moz-do-not-send="true" href="http://twitter.com/#%21/miconda">http://twitter.com/#!/miconda</a> - <a moz-do-not-send="true" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Kamailio World Conference, April 16-17, 2013, Berlin
 - <a moz-do-not-send="true" href="http://conference.kamailio.com">http://conference.kamailio.com</a> -
_______________________________________________
sr-dev mailing list
<a moz-do-not-send="true" href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a>
<a moz-do-not-send="true" 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>
        <table width="100%" cellpadding="0" cellspacing="0">
          <tbody>
            <tr>
              <td>
                <pre>-- 
Peter Dunkley
Technical Director
Crocodile RCS Ltd
</pre>
              </td>
            </tr>
          </tbody>
        </table>
      </blockquote>
      <br>
      <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla - <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://twitter.com/#%21/miconda">http://twitter.com/#!/miconda</a> - <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Kamailio World Conference, April 16-17, 2013, Berlin
 - <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://conference.kamailio.com">http://conference.kamailio.com</a> -</pre>
    </blockquote>
    <br>
  </body>
</html>