<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    <div class="moz-cite-prefix">On 06/11/14 09:38, Dan Christian Bogos
      wrote:<br>
    </div>
    <blockquote cite="mid:545B3373.4050504@gmail.com" type="cite">
      <meta content="text/html; charset=windows-1252"
        http-equiv="Content-Type">
      Hey Guys,<br>
      <br>
      We are facing quite often this error: <br>
      <br>
      /usr/sbin/kamailio[16985]: ERROR:<br>
      <core> [dset.c:435]: print_dset(): ERROR: redirection
      buffeROR:<br>
      redirection buffer length exceed<br>
      <br>
      When the error is generated, there will be a missing contact in
      the redirects (not to mention that Kamailio will crash in
      uac_redirect for versions before 4.2.0). <br>
      <br>
      Can anyone explain the nature of this buffer and whether is
      affected by a single contact or all the contacts together building
      the final redirect? How can we control what's in that buffer from
      the script?<br>
      <br>
      This is our script part building the redirects, out of location
      data:<br>
      """<br>
          if(!reg_fetch_contacts("location", "$ru", "called")) {<br>
                      send_reply("404", "Not Found");<br>
                      exit;<br>
              }<br>
              if $(ulc(called=>count)) == 0 { # No contacts for this
      user online<br>
                      sl_send_reply("404", "Not found");<br>
                      exit;<br>
              }<br>
              $var(i) = 0;<br>
              while($var(i) < $(ulc(called=>count))) {<br>
                      $var(pathUri) =
      $(ulc(called=>path)[$var(i)]{s.strip,1}{s.striptail,1}); #Strip
      <> so we can apply real uri transformations<br>
                      $var(newRURI) = $(ulc(called=>addr)[$var(i)]) +
      ";ipbxep=" + $(var(pathUri){uri.host});<br>
                      if $var(i) == 0 {<br>
                              $ru = $var(newRURI);<br>
                      } else {<br>
                              append_branch($var(newRURI));<br>
                      }<br>
                      $var(i) = $var(i) + 1;<br>
              }<br>
      """<br>
      <br>
      Thanks in advance for any kind of tip!<br>
    </blockquote>
    looks like the overall buffer for contacts in redirect is 512 in
    size, perhaps same value from early beginnings. MAX_REDIRECTION_LEN
    in config.h needs to be changed to larger value -- should 1024 be
    enough?<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Kamailio Advanced Training, Nov 24-27, Berlin - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a></pre>
  </body>
</html>