<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    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>
    <br>
    DanB<br>
    <meta http-equiv="content-type" content="text/html;
      charset=windows-1252">
    <br>
  </body>
</html>