I am having strange behaviour with $msrp(code).

The following config. fragment:
        if (msrp_is_reply()) {
                xlog("Code: $msrp(code)\n");
                if ($msrp(code) < 300) {
                        xlog("Received OK MSRP reply\n");
                } else {
                        xlog("Received failure MSRP reply\n");
                }

Produces the following output:
Feb  6 15:55:02 blade14 /usr/sbin/kamailio[3831]: ERROR: <script>: Code: 200
Feb  6 15:55:02 blade14 /usr/sbin/kamailio[3831]: ERROR: <script>: Received failure MSRP reply

Which I can't explain as 200 is clearly less than 300.

It gets even stranger when I change the config. to this:
        if (msrp_is_reply()) {
               $var(tmp) = $msrp(code)
                xlog("Code: $var(tmp)\n");
                if ($var(tmp) < 300) {
                        xlog("Received OK MSRP reply\n");
                } else {
                        xlog("Received failure MSRP reply\n");
                }

And this is the output:
Feb  6 15:56:17 blade14 /usr/sbin/kamailio[3831]: ERROR: <script>: Code: 10200
Feb  6 15:56:17 blade14 /usr/sbin/kamailio[3831]: ERROR: <script>: Received failure MSRP reply

The MSRP response here was a 200 OK.  So where did the 10200 come from?


Regards,

Peter
-- 
Peter Dunkley
Technical Director
Crocodile RCS Ltd