<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Tried earlier like this:<div><br></div><div><div><br></div><div>287         ldap_result("memberOf/$avp(s:ldapmemberof)");</div><div>288         xlog("L_INFO", "LDAP $fU memberOf = $avp(s:ldapmemberof)");</div><div>289         while (ldap_result_next()) {</div><div>290           xlog("L_INFO", "if loop ldap_result");</div><div>291           ldap_result("memberOf/$avp(s:ldapmemberof)");</div><div>292           xlog("L_INFO", "LDAP $fU memberOf = $avp(s:ldapmemberof)");</div><div>293         }</div><div>294         xlog("L_INFO", "end ldap_result_next while");</div><div><br></div><div>Can see in log file output from line 288, but while loop doesnít start at all. Captured output with ngrep and it shows that iím receiving all 7 memberOf attributes.</div><div><br></div><div>Log output:</div><div><br></div><div><div>Sep  5 10:03:28 localhost /usr/local/sbin/kamailio[5798]: INFO: <script>: fU = virmantas.variakojis</div><div>Sep  5 10:03:28 localhost /usr/local/sbin/kamailio[5798]: INFO: <script>: LDAP virmantas.variakojis memberOf = CN=AAAAAAAA,OU=Rights Assignment,OU=Groups,DC=office,DC=xxxxxx,DC=yy</div><div>Sep  5 10:03:28 localhost /usr/local/sbin/kamailio[5798]: INFO: <script>: end ldap_result_next while</div></div><div><br></div>


<br><div><div>On 05 Sep 2014, at 11:33, Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
  
    <meta content="text/html; charset=windows-1252" http-equiv="Content-Type">
  
  <div bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    <div class="moz-cite-prefix">On 04/09/14 14:49, Virmantas Variakojis
      wrote:<br>
    </div>
    <blockquote cite="mid:CAG_Y7po=PThStdoroBCK4iyF3Pnj3eqkh7dW5dYe5meBqomd+w@mail.gmail.com" type="cite">
      <div dir="ltr">Hi,
        <div><br>
        </div>
        <div>I'm trying to fetch attribute list with kamailio
          ldap_search:</div>
        <div><br>
        </div>
        <div>ldap_search(<a class="moz-txt-link-rfc2396E" href="ldap://agents/ou=Xxxxx,dc=xxxx,dc=yyyyyy,dc=zz?memberOf?sub?(sAMAccountName=$fU)">"ldap://agents/ou=Xxxxx,dc=xxxx,dc=yyyyyy,dc=zz?memberOf?sub?(sAMAccountName=$fU)"</a>);<br>
        </div>
        <div><br>
        </div>
        <div>
          <div>ldap_result("memberOf/$avp(s:ldapmemberof1)");</div>
          <div>xlog("L_INFO", "LDAP $fU memberOf =
            $avp(s:ldapmemberof1)");</div>
          <div>if (ldap_result_next())</div>
          <div>
            {</div>
          <div>xlog("L_INFO", "if loop ldap_result");<br>
          </div>
          <div>           ldap_result("memberOf/$avp(s:ldapmemberof2)");</div>
          <div>           xlog("L_INFO", "LDAP $fU memberOf =
            $avp(s:ldapmemberof2)");</div>
          <div>}</div>
        </div>
        <div><br>
        </div>
        <div>There's must be seven returning attributes list of
          memberOf, but I can only retrieve only one of them (looks like
          last of seven). First xlog output log into my log file, but if
          loop didn't start. What I'm doing wrong?</div>
      </div>
    </blockquote>
    <br>
    IF is not a loop, it does one time testing. If you want a loop, then
    use WHILE, like:<br>
    <br>
    while(ldap_result_next()) {<br>
    ...<br>
    }<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <blockquote cite="mid:CAG_Y7po=PThStdoroBCK4iyF3Pnj3eqkh7dW5dYe5meBqomd+w@mail.gmail.com" type="cite">
      <div dir="ltr">
        <div><br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <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>
Next Kamailio Advanced Trainings 2014 - <a class="moz-txt-link-freetext" href="http://www.asipto.com/">http://www.asipto.com</a>
Sep 22-25, Berlin, Germany</pre>
  </div>

_______________________________________________<br>SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br><a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users<br></blockquote></div><br></div></body></html>