<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Thanks for spotting it, I pushed a commit adding a note about
      availability of sr Lua module by loading app_lua_sr Kamailio
      module as well as updated the Lua script examples to use KSR
      instead of sr.</p>
    <p>But, on the other hand, the example in the docs for
      lua_dostring() does not have the line you pasted:</p>
    <p>lua_dostring("KSR.pv.seti(\"$$var(var1)\", $avp(var1) <
      $avp(var3) and 1 or 0)");</p>
    <p>just assuming is was on your local testing.</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 30.07.20 18:50, Julien Chavanton
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAKmcL2nEDep4xPS86KznLg9s+egCmF2s9XgY=Z+8R9Y57rYt_A@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div><br>
          lua_dostring("sr.pv.seti(\"$$var(var1)\", $avp(var1) <
          $avp(var3) and 1 or 0)");<br>
          <div><br>
          </div>
          <div>results in error :<br>
            kamailio app lual_dostring(): error from Lua:  attempt to
            index global 'sr' (a nil value)</div>
          <div><br>
            replacing sr with KSR is working :<br>
          </div>
          <div><br>
          </div>
          <div>lua_dostring("KSR.pv.seti(\"$$var(var1)\", $avp(var1)
            < $avp(var3) and 1 or 0)");</div>
          <br>
        </div>
        Shall we update the docs for<br>
        <a
href="https://kamailio.org/docs/modules/devel/modules/app_lua.html#app_lua.f.lua_dostring"
          moz-do-not-send="true">https://kamailio.org/docs/modules/devel/modules/app_lua.html#app_lua.f.lua_dostring</a>
        ?<br>
        <br>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Funding: <a class="moz-txt-link-freetext" href="https://www.paypal.me/dcmierla">https://www.paypal.me/dcmierla</a></pre>
  </body>
</html>