<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <tt>The $rc in the switch is the return value of xlog(), which
      probably is success.<br>
      Just remove the xlog after the radius_send_auth(), or store the
      $rc in a variable and test that variable.<br>
      <br>
      Best regards,<br>
    </tt>
    <pre class="moz-signature" cols="72">Răzvan Crainea
OpenSIPS Solutions
<a class="moz-txt-link-abbreviated" href="http://www.opensips-solutions.com">www.opensips-solutions.com</a></pre>
    <div class="moz-cite-prefix">On 01/16/2017 12:24 PM, Dragomir
      Haralambiev wrote:<br>
    </div>
    <blockquote
cite="mid:CADzurO+GDuir0njL-vF4c3-BKdi=uz1p8zB+QPukH2WO5fOO-A@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>Hello,</div>
        <div><br>
        </div>
        <div>I see problem when using switch .. case.<br>
          Opensips version 2.2.2.</div>
        <div><br>
        </div>
        <div>Here is part of my script:</div>
        <div><br>
        </div>
        <div>
          <div><span class="gmail-Apple-tab-span" style="white-space:pre">      </span>radius_send_auth("out","in");</div>
          <div><span class="gmail-Apple-tab-span" style="white-space:pre">      </span>xlog("L_ERR",<span class="gmail-Apple-tab-span" style="white-space:pre">       </span>"Radius
            return $rc");</div>
          <div><span class="gmail-Apple-tab-span" style="white-space:pre">              </span>switch
            ($rc) {</div>
          <div><span class="gmail-Apple-tab-span" style="white-space:pre">                      </span>case
            -1:</div>
          <div><span class="gmail-Apple-tab-span" style="white-space:pre">                              </span>xlog("L_ERR",
            "ERROR during authentication");</div>
          <div><span class="gmail-Apple-tab-span" style="white-space:pre">                              </span>sl_reply_error(); </div>
          <div><span class="gmail-Apple-tab-span" style="white-space:pre">                              </span>exit;</div>
          <div><span class="gmail-Apple-tab-span" style="white-space:pre">                      </span>case
            -2:</div>
          <div><span class="gmail-Apple-tab-span" style="white-space:pre">                              </span>xlog("L_ERR",
            "Authentication denied");</div>
          <div><span class="gmail-Apple-tab-span" style="white-space:pre">                              </span>sl_reply_error(); </div>
          <div><span class="gmail-Apple-tab-span" style="white-space:pre">                              </span>exit;</div>
          <div><span class="gmail-Apple-tab-span" style="white-space:pre">              </span>}
            # end switch</div>
          <div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>xlog("L_ERR",<span class="gmail-Apple-tab-span" style="white-space:pre">     </span>"Continue
            ....");</div>
        </div>
        <div><br>
        </div>
        <div>This is results:</div>
        <div>Jan 16 10:16:55 sbc-01 /usr/sbin/opensips[7820]: Radius
          return -1</div>
        <div>Jan 16 10:16:55 sbc-01 /usr/sbin/opensips[7820]: Continue
          ....</div>
        <div><br>
        </div>
        <div>Best regards,</div>
        <div>Dragomir</div>
      </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>