<div dir="ltr">Hi Daniel,<div><br></div><div>it seems that your suggestion is not working, we are not using python for the whole script, we have some functions written in python to manipulate jsons and to do API queries which we keep in python but the core of the routing logic is still written in Kamailio scripting language.</div><div><br></div><div>We call the python functions with python_exec()</div><div><br></div><div>I tried to use both exit() and os.exit() but it looks like they are ignored and the route execution continues, the only thing that seems to work is to return 0 from the function</div><div><br></div><div>Can you tell me please if it is safe to use the return value to exit?</div><div><br></div><div>Thanks,</div><div>Enrico.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-03-28 16:35 GMT+02:00 Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <p>Hello,</p>
    <p>in Python you can call exit() or os.exit(), this throws an
      exception which is caught by Kamailio and interpreted as the usual
      exit from kamailio.cfg.</p>
    <p>Probably we should add the KSR.x.exit() there as well, it was not
      added because python exit gave what was needed in this case</p>
    <p>Cheers,<br>
      Daniel<br>
    </p><div><div class="h5">
    <br>
    <div class="m_6995966612575938142moz-cite-prefix">On 27.03.18 16:49, Enrico Bandiera
      wrote:<br>
    </div>
    </div></div><blockquote type="cite"><div><div class="h5">
      <div dir="ltr">Hello, I'm trying to use the KSR.x.exit() function
        in a KEMI python script but at runtime i get this error:
        <div><br>
        </div>
        <div>
          <div>KSR.x.exit()</div>
          <div>AttributeError: 'module' object has no attribute 'exit'</div>
        </div>
        <div><br>
        </div>
        <div>It seems that the exit function is missing even though it
          is documented.</div>
        <div><br>
        </div>
        <div>My kamailio version is: kamailio 5.2.0-dev4 (x86_64/linux) 
          (it's a nightly)</div>
        <div><br>
        </div>
        <div>Any idea on what I can do?</div>
        <div><br>
        </div>
        <div>Thanks,</div>
        <div>Enrico.</div>
      </div>
      <br>
      <fieldset class="m_6995966612575938142mimeAttachmentHeader"></fieldset>
      <br>
      </div></div><pre>______________________________<wbr>_________________
Kamailio (SER) - Users Mailing List
<a class="m_6995966612575938142moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a>
<a class="m_6995966612575938142moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">https://lists.kamailio.org/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a><span class="HOEnZb"><font color="#888888">
</font></span></pre><span class="HOEnZb"><font color="#888888">
    </font></span></blockquote><span class="HOEnZb"><font color="#888888">
    <br>
    <pre class="m_6995966612575938142moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="m_6995966612575938142moz-txt-link-abbreviated" href="http://www.twitter.com/miconda" target="_blank">www.twitter.com/miconda</a> -- <a class="m_6995966612575938142moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda" target="_blank">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - April 16-18, 2018, Berlin - <a class="m_6995966612575938142moz-txt-link-abbreviated" href="http://www.asipto.com" target="_blank">www.asipto.com</a>
Kamailio World Conference - May 14-16, 2018 - <a class="m_6995966612575938142moz-txt-link-abbreviated" href="http://www.kamailioworld.com" target="_blank">www.kamailioworld.com</a></pre>
  </font></span></div>

</blockquote></div><br></div>