<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <tt>Right! Still, if you want to change it, see this define
      <a class="moz-txt-link-freetext" href="https://github.com/OpenSIPS/opensips/blob/master/pvar.c#L124">https://github.com/OpenSIPS/opensips/blob/master/pvar.c#L124</a> . Of
      course, you will have to recompile.<br>
      <br>
      Regards,<br>
    </tt>
    <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a>
OpenSIPS Summit 2018
  <a class="moz-txt-link-freetext" href="http://www.opensips.org/events/Summit-2018Amsterdam">http://www.opensips.org/events/Summit-2018Amsterdam</a>
</pre>
    <div class="moz-cite-prefix">On 03/14/2018 05:33 PM, Ben Newlin
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:A8311B0B-02E9-4482-8860-9EBF23FBD333@genesys.com">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Menlo;
        panose-1:2 11 6 9 3 8 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
      <div class="WordSection1">
        <p class="MsoNormal"><span style="font-size:11.0pt">Please
            disregard this. I was incorrect about the source of the
            error message. It is coming from a log statement we have
            where we are attempting to print the contents of an AVP as a
            list. In this case the list is quite long and is causing the
            buffer exhaustion.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <div>
          <p class="MsoNormal"><span
              style="font-size:11.0pt;color:black">Thanks,<o:p></o:p></span></p>
        </div>
        <p class="MsoNormal"><span style="font-size:11.0pt;color:black">Ben
            Newlin <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <div style="border:none;border-top:solid #B5C4DF
          1.0pt;padding:3.0pt 0in 0in 0in">
          <p class="MsoNormal"><b><span style="color:black">From: </span></b><span
              style="color:black">Ben Newlin
              <a class="moz-txt-link-rfc2396E" href="mailto:Ben.Newlin@genesys.com"><Ben.Newlin@genesys.com></a><br>
              <b>Date: </b>Tuesday, March 13, 2018 at 10:30 AM<br>
              <b>To: </b>OpenSIPS users mailling list
              <a class="moz-txt-link-rfc2396E" href="mailto:users@lists.opensips.org"><users@lists.opensips.org></a><br>
              <b>Subject: </b>pv_get_avp buffer length error<o:p></o:p></span></p>
        </div>
        <div>
          <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        </div>
        <p class="MsoNormal"><a name="_MailOriginalBody"
            moz-do-not-send="true"><span style="font-size:11.0pt">Hi,</span><o:p></o:p></a></p>
        <p class="MsoNormal"><span
            style="mso-bookmark:_MailOriginalBody"><span
              style="font-size:11.0pt"> </span><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="mso-bookmark:_MailOriginalBody"><span
              style="font-size:11.0pt">We have been seeing the following
              errors in our logs for some time:</span><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="mso-bookmark:_MailOriginalBody"><span
              style="font-size:11.0pt"> </span><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="mso-bookmark:_MailOriginalBody"><span
              style="font-size:10.0pt;font-family:Menlo">ERROR:core:pv_get_avp:
              local buffer length exceeded!</span><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="mso-bookmark:_MailOriginalBody"><span
              style="font-size:11.0pt"> </span><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="mso-bookmark:_MailOriginalBody"><span
              style="font-size:11.0pt">This error prints from multiple
              places in the code and we were not able to isolate the
              source until now. I have been able to consistently
              reproduce the error by calling avp_insert. It seems to
              happen every time I call it in a particular place, but I
              cannot identify the cause of the buffer issue.</span><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="mso-bookmark:_MailOriginalBody"><span
              style="font-size:11.0pt"> </span><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="mso-bookmark:_MailOriginalBody"><span
              style="font-size:11.0pt">Logs from an occurrence are here:
            </span></span><a href="https://pastebin.com/HvmrXqii"
            moz-do-not-send="true"><span
              style="mso-bookmark:_MailOriginalBody"><span
                style="font-size:11.0pt">https://pastebin.com/HvmrXqii</span></span><span
              style="mso-bookmark:_MailOriginalBody"></span></a><span
            style="mso-bookmark:_MailOriginalBody"><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="mso-bookmark:_MailOriginalBody"><span
              style="font-size:11.0pt"> </span><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="mso-bookmark:_MailOriginalBody"><span
              style="font-size:11.0pt">The relevant section of my config
              script is here:
            </span></span><a href="https://pastebin.com/301U1yY2"
            moz-do-not-send="true"><span
              style="mso-bookmark:_MailOriginalBody"><span
                style="font-size:11.0pt">https://pastebin.com/301U1yY2</span></span><span
              style="mso-bookmark:_MailOriginalBody"></span></a><span
            style="mso-bookmark:_MailOriginalBody"><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="mso-bookmark:_MailOriginalBody"><span
              style="font-size:11.0pt"> </span><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="mso-bookmark:_MailOriginalBody"><span
              style="font-size:11.0pt">I am currently running 1.11.11,
              which I know is unsupported. But I am trying to determine
              whether it is an OpenSIPS issue or whether I am using this
              function in a way that is not intended.</span><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="mso-bookmark:_MailOriginalBody"><span
              style="font-size:11.0pt"> </span><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="mso-bookmark:_MailOriginalBody"><span
              style="font-size:11.0pt">I am trying to use it to push
              values onto the end of an AVP stack. According to the docs
              [1]:</span><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="mso-bookmark:_MailOriginalBody"><span
              style="font-size:11.0pt"> </span><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="mso-bookmark:_MailOriginalBody"><span
              style="font-size:11.0pt">“If the index is greater than the
              count of values the value will be inserted at the end.”</span><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="mso-bookmark:_MailOriginalBody"><span
              style="font-size:11.0pt"> </span><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="mso-bookmark:_MailOriginalBody"><span
              style="font-size:11.0pt">So I have selected an index that
              is known to always be greater than the number of elements
              (32) and am performing the insert at that index. I must do
              this because there does not seem to be any way in OpenSIPS
              to determine the number of values in an AVP except to
              traverse the entire list. I attempted to keep track of the
              number of items in the destination list using another
              variable, but avp_insert will not accept a variable as the
              index argument, only a number.</span><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="mso-bookmark:_MailOriginalBody"><span
              style="font-size:11.0pt"> </span><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="mso-bookmark:_MailOriginalBody"><span
              style="font-size:11.0pt">I also tried reading from the
              source AVP backwards, as opposed to putting them in the
              destination AVP backwards as I do now, but there is no way
              to indicate the last index of an AVP. The common method of
              using -1 as the index does not work with AVPs.</span><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="mso-bookmark:_MailOriginalBody"><span
              style="font-size:11.0pt"> </span><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="mso-bookmark:_MailOriginalBody"><span
              style="font-size:11.0pt">Any help would be appreciated.</span><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="mso-bookmark:_MailOriginalBody"><span
              style="font-size:11.0pt"> </span><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="mso-bookmark:_MailOriginalBody"><span
              style="font-size:11.0pt">[1]:
            </span></span><a
href="http://www.opensips.org/html/docs/modules/1.11.x/avpops.html#idp5675600"
            moz-do-not-send="true"><span
              style="mso-bookmark:_MailOriginalBody"><span
                style="font-size:11.0pt">http://www.opensips.org/html/docs/modules/1.11.x/avpops.html#idp5675600</span></span><span
              style="mso-bookmark:_MailOriginalBody"></span></a><span
            style="mso-bookmark:_MailOriginalBody"><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="mso-bookmark:_MailOriginalBody"><span
              style="font-size:11.0pt"> </span><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="mso-bookmark:_MailOriginalBody"><span
              style="font-size:11.0pt"> </span><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="mso-bookmark:_MailOriginalBody"><span
              style="font-size:11.0pt;color:black">Thanks,</span><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="mso-bookmark:_MailOriginalBody"><span
              style="font-size:11.0pt;color:black"> </span><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="mso-bookmark:_MailOriginalBody"><span
              style="font-size:11.0pt;color:black">Ben Newlin
            </span><o:p></o:p></span></p>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>