<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    Hi,<br>
    <br>
    thanks - that solved our problem<br>
    <br>
    /niklas<br>
    <br>
    <div class="moz-cite-prefix">On 2022-11-15 09:14, <a class="moz-txt-link-abbreviated" href="mailto:sdamm@pascom.net">sdamm@pascom.net</a>
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:FRYP281MB02886967ED2EC1AA2AAAA3D9F7049@FRYP281MB0288.DEUP281.PROD.OUTLOOK.COM">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <style type="text/css" style="display:none;">P {margin-top:0;margin-bottom:0;}</style>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255,
        255, 255);" class="elementToProof">
        <span style="color: black; font-family: Calibri, Arial,
          Helvetica, sans-serif; font-size: 12pt;">Hi,</span><br>
      </div>
      <div>
        <div id="Signature">
          <div class="x_container" style="max-width:900px">
            <div class="x_row" style="padding-top:15px;
              font-family:Source Sans Pro,sans-serif; font-size:14px;
              padding-bottom:10px" align="left">
              <div style="font-size:15px;font-family:"Segoe
                UI", "Segoe UI Web (West European)",
                "Segoe UI", -apple-system,
                "system-ui", Roboto, "Helvetica
                Neue", sans-serif;margin:0px;color:rgb(36, 36,
                36);text-align:start;background-color:rgb(255, 255,
                255)">
                <div style="font-size:12pt;font-family:Calibri, Arial,
                  Helvetica, sans-serif;margin:0px;color:black">
                  our python configuration consists of many files, too.
                  To have the reload working, we have this block in our
                  configuration:<br>
                </div>
                <div style="margin:0px">
                  <div style="margin:0px;max-width:900px">
                    <div style="margin:0px">
                      <p style="margin-top:0px;margin-bottom:0px"><br
                          class="ContentPasted0">
                      </p>
                      <div style="margin:0px"><span
                          style="font-family:"Courier New",
                          monospace;margin:0px" class="ContentPasted0">import
                          mod1</span></div>
                      <div style="margin:0px"><span
                          style="font-family:"Courier New",
                          monospace;margin:0px" class="ContentPasted0">import
                          mod2</span></div>
                      <div style="margin:0px"><span
                          style="font-family:"Courier New",
                          monospace;margin:0px" class="ContentPasted0">import
                          mod3</span></div>
                      <div style="margin:0px"><span
                          style="font-family:"Courier New",
                          monospace;margin:0px" class="ContentPasted0">from
                          importlib import reload</span><br
                          class="ContentPasted0">
                      </div>
                      <div style="margin:0px"><br class="ContentPasted0">
                      </div>
                      <div style="margin:0px"><span
                          style="font-family:"Courier New",
                          monospace;margin:0px" class="ContentPasted0">def
                          mod_init():</span>
                        <div style="margin:0px"><span
                            style="font-family:"Courier New",
                            monospace;margin:0px" class="ContentPasted0"> 
                              KSR.info("===== initializing
                            kamailio.py\n")</span></div>
                        <div style="margin:0px"><span
                            style="font-family:"Courier New",
                            monospace;margin:0px" class="ContentPasted0"> 
                              reload(mod1)</span></div>
                        <div style="margin:0px"><span
                            style="font-family:"Courier New",
                            monospace;margin:0px" class="ContentPasted0"> 
                              reload(mod2)</span></div>
                        <div style="margin:0px"><span
                            style="font-family:"Courier New",
                            monospace;margin:0px" class="ContentPasted0"> 
                              reload(mod3)</span></div>
                        <div style="margin:0px"><span
                            style="font-family:"Courier New",
                            monospace;margin:0px" class="ContentPasted0"> 
                              KSR.info("===== Done reloading modules\n")</span></div>
                      </div>
                      <div style="margin:0px"><span
                          style="font-family:"Courier New",
                          monospace;margin:0px" class="ContentPasted0"> 
                            return kamailio()</span><br
                          class="ContentPasted0">
                      </div>
                    </div>
                    <div style="font-size:14px;font-family:"Source
                      Sans Pro", sans-serif;margin:0px;padding:15px
                      0px 10px" align="left">
                    </div>
                    <div style="font-size:14px;font-family:"Source
                      Sans Pro", sans-serif;margin:0px;padding:15px
                      0px 10px" align="left">
                      <span style="font-size: 12pt; margin: 0px;
                        font-family: Calibri, Arial, Helvetica,
                        sans-serif; color: rgb(0, 0, 0);
                        background-color: rgba(0, 0, 0, 0);"
                        class="ContentPasted0">​</span><span
                        style="font-size: 12pt; margin: 0px;
                        font-family: Calibri, Arial, Helvetica,
                        sans-serif; color: rgb(0, 0, 0);
                        background-color: rgba(0, 0, 0, 0);"
                        class="ContentPasted0">modX will be the modules
                        you import at the top.</span><br
                        class="ContentPasted0">
                    </div>
                    <div style="font-size:14px;font-family:"Source
                      Sans Pro", sans-serif;margin:0px;padding:15px
                      0px 10px" class="ContentPasted0" align="left">
                      <span style="font-family: Calibri, Helvetica,
                        sans-serif; font-size: 12pt; color: rgb(36, 36,
                        36); background-color: rgba(0, 0, 0, 0);">HTH<br>
                      </span></div>
                    <div style="font-size:14px;font-family:"Source
                      Sans Pro", sans-serif;margin:0px;padding:15px
                      0px 10px" class="ContentPasted0" align="left">
                      <span style="background-color: rgba(0, 0, 0, 0);
                        color: rgb(36, 36, 36); font-family: Calibri,
                        Helvetica, sans-serif; font-size: 12pt;">Sebastian</span></div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <hr style="display:inline-block;width:98%" tabindex="-1">
      <div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt"
          face="Calibri, sans-serif" color="#000000"><b>From:</b>
          sr-users <a class="moz-txt-link-rfc2396E" href="mailto:sr-users-bounces@lists.kamailio.org"><sr-users-bounces@lists.kamailio.org></a> on behalf
          of Niklas Larsson <a class="moz-txt-link-rfc2396E" href="mailto:niklas@tese.se"><niklas@tese.se></a><br>
          <b>Sent:</b> Monday, November 14, 2022 10:46<br>
          <b>To:</b> Henning Westerholt <a class="moz-txt-link-rfc2396E" href="mailto:hw@gilawa.com"><hw@gilawa.com></a>; Kamailio
          (SER) - Users Mailing List <a class="moz-txt-link-rfc2396E" href="mailto:sr-users@lists.kamailio.org"><sr-users@lists.kamailio.org></a><br>
          <b>Subject:</b> Re: [SR-Users] KEMI - app_python3 - reload
          multiple python files</font>
        <div> </div>
      </div>
      <div class="BodyFragment"><font size="2"><span
            style="font-size:11pt;">
            <div class="PlainText">Hi,<br>
              <br>
              that is what we do:<br>
              <br>
              import sys<br>
              import KSR as KSR<br>
              import constants<br>
              import endpointparam as epParam<br>
              import iendpoint as ep<br>
              from util import ParseAddress<br>
              from endpoint import GetEgressEndPointInstance,
              CreateAsteriskEndPoint, <br>
              CreateSipTrunkEndPoint<br>
              <br>
              etc<br>
              <br>
              Been googling a bit, and it's should be possible to do a
              module.reload() <br>
              - but is there a way to find out in that the modules needs
              to be reloaded?<br>
              <br>
              /niklas<br>
              <br>
              Den 2022-11-14 kl. 09:05, skrev Henning Westerholt:<br>
              > Hello,<br>
              ><br>
              > have you tried to just use "import my-file" the file
              my-file in your kamailio.py?<br>
              ><br>
              > Cheers,<br>
              ><br>
              > Henning<br>
              ><br>
              <br>
              __________________________________________________________<br>
              Kamailio - Users Mailing List - Non Commercial Discussions<br>
              <a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><br>
              Important: keep the mailing list in the recipients, do not
              reply only to the sender!<br>
              Edit mailing list options or unsubscribe:<br>
              <a
                href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
                moz-do-not-send="true" class="moz-txt-link-freetext">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
            </div>
          </span></font></div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
<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>
    <br>
  </body>
</html>