<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>RE: [SR-Users] carrierroute cr_route fails with pvars</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Hello Ole,<BR>
<BR>
I think the move to 6 buffers(it has only a small memory penalty) should suffice, because there are no module functions that might have more than 6 parameters.<BR>
<BR>
If I remember correctly, I have also patched&nbsp; the kamailio_3.0 branch, so if you are using 3.0.0 you might already have the patch in place so you can remove the if's from the cfg.<BR>
<BR>
Cheers<BR>
Marius<BR>
-----Original Message-----<BR>
From: Ole Kaas [<A HREF="mailto:obk@tet.dk">mailto:obk@tet.dk</A>]<BR>
Sent: Thu 5/13/2010 6:40 PM<BR>
To: Marius Zbihlei<BR>
Cc: users@lists.kamailio.org<BR>
Subject: Re: [SR-Users] carrierroute cr_route fails with pvars<BR>
<BR>
<BR>
Den 03/05/2010 kl. 12.13 skrev marius zbihlei:<BR>
&gt; You are right, if you use 2 PV in the cr_route function things will go badly.<BR>
&gt;<BR>
&gt; The reason is that the core function get_str_fparam() returns a pointer to a static buffer, and in total there are three(3) static buffers to return, so after a fourth call the first value (if cached which is the case in your proof) will be overwritten by the fourth. A solution is to increase the number of buffers to a number larger than 3 (but still small - keep in mind that each buffer is 1kB). I have tested with 6 and it works.<BR>
&gt;<BR>
<BR>
So maybe this can't be fixed (easily) without a performace penalty? At least a note in the doc would have saved me some trouble - or maybe an error message in the log (if possible).<BR>
<BR>
&gt; Please modify PV_PRINT_BUF_NO in sr_module.c(line 1418) to a larger value , compile and retest.<BR>
&gt;<BR>
<BR>
Ok, I'll check it out when I upgrade to 3.0.1 or later. For now I've made a workaround in the config with some &quot;if&quot; constructs.<BR>
<BR>
Thanks,<BR>
Ole<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>