[sr-dev] Problem with $msrp(code) PV

Peter Dunkley peter.dunkley at crocodile-rcs.com
Tue Feb 12 14:53:07 CET 2013


Hi Daniel,

Thanks for the fix.  It works fine for me.

Peter

On 11/02/13 22:45, Daniel-Constantin Mierla wrote:
> Hello,
>
> 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.
>
> Anyhow, there should be a fix pushed in the master branch to return 
> the value from msrp message. Let me know if works.
>
> Cheers,
> Daniel
>
> On 2/7/13 5:16 PM, Peter Dunkley wrote:
>> It's just MSRP responses (I've only gotten the client stack to 
>> generate 200 OKs).
>>
>> Regards,
>>
>> Peter
>>
>> On Thu, 2013-02-07 at 16:38 +0100, Daniel-Constantin Mierla wrote:
>>> Hello,
>>>
>>> I will look over it very soon, just didn't get time yet.
>>>
>>> Is it for all messages, or just for some particular ones?
>>>
>>> Cheers,
>>> Daniel
>>>
>>> On 2/7/13 11:46 AM, Peter Dunkley wrote:
>>>
>>>> Hi,
>>>>
>>>> Has anyone got any ideas about this, because it has me very confused.
>>>>
>>>> Peter
>>>>
>>>> On Wed, 2013-02-06 at 16:28 +0000, Peter Dunkley wrote:
>>>>> 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.
>>>>>
>>>>> Regards,
>>>>>
>>>>> Peter
>>>>>
>>>>> On Wed, 2013-02-06 at 14:09 -0200, Edson - Lists wrote:
>>>>>> Just a guess....
>>>>>>
>>>>>> hex('\n') => 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:
>>>>>> >
>>>>>> > 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
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > _______________________________________________
>>>>>> > sr-dev mailing list
>>>>>> >sr-dev at lists.sip-router.org  <mailto: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  <mailto:sr-dev at lists.sip-router.org>
>>>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>>>>>
>>>> -- 
>>>> Peter Dunkley
>>>> Technical Director
>>>> Crocodile RCS Ltd
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> sr-dev mailing list
>>>> sr-dev at lists.sip-router.org  <mailto:sr-dev at lists.sip-router.org>
>>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>>>
>>> -- 
>>> Daniel-Constantin Mierla -http://www.asipto.com
>>> http://twitter.com/#!/miconda  <http://twitter.com/#%21/miconda>  -http://www.linkedin.com/in/miconda
>>> Kamailio World Conference, April 16-17, 2013, Berlin
>>>   -http://conference.kamailio.com  -
>>> _______________________________________________
>>> sr-dev mailing list
>>> sr-dev at lists.sip-router.org  <mailto:sr-dev at lists.sip-router.org>
>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>>
>> -- 
>> Peter Dunkley
>> Technical Director
>> Crocodile RCS Ltd
>>
>
> -- 
> Daniel-Constantin Mierla -http://www.asipto.com
> http://twitter.com/#!/miconda  -http://www.linkedin.com/in/miconda
> Kamailio World Conference, April 16-17, 2013, Berlin
>   -http://conference.kamailio.com  -

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20130212/75849058/attachment.htm>


More information about the sr-dev mailing list