<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi Luke,</p>
    <p>Real time processing of the logs and dispatch based on those
      C-???? values into a database of sorts then I reckon.  You will
      probably still need some way to link C-???? to the CDR entries,
      but that IMHO is optional depending on how your support process.<br>
      <br>
      <br>
    </p>
    <div class="moz-signature">
      <style type="text/css">
* { padding: 0px; margin: 0px; }
body, html { font-family: Arial, San-Serif; font-size: small; color: black; padding-left: 10px; padding-top: 3px; }
a { text-decoration: none; color: #818285; }
h1 { font-size: large; }
table { font-size: 12px; }
p + p { padding-top: 1em; }
</style>
      <p>Kind Regards,<br>
        Jaco<br>
        <br>
        On 2023/01/18 16:33, Luke Escudé wrote:<br>
      </p>
    </div>
    <blockquote type="cite"
cite="mid:SA0PR18MB3647954471EDE5C807C6900ABEC79@SA0PR18MB3647.namprd18.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 class="elementToProof"><span style="font-family: Calibri,
          Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0,
          0, 0); background-color: rgb(255, 255, 255);"
          class="elementToProof">In our case, we've managed to turn
          Asterisk into a Docker container, so we can scale up/out as
          much as needed.</span></div>
      <div class="elementToProof" style="font-family: Calibri, Arial,
        Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);
        background-color: rgb(255, 255, 255);">
        <br>
      </div>
      <div class="elementToProof" style="font-family: Calibri, Arial,
        Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);
        background-color: rgb(255, 255, 255);">
        Interestingly, after running about 500 containers in production
        (500 asterisk instances) we've found that there's a lot of
        untapped power in the smaller containers, so we ended up
        designing our PBX web portal and our dial plan to be
        multi-tenant.</div>
      <div class="elementToProof" style="font-family: Calibri, Arial,
        Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);
        background-color: rgb(255, 255, 255);">
        <br>
      </div>
      <div class="elementToProof" style="font-family: Calibri, Arial,
        Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);
        background-color: rgb(255, 255, 255);">
        So, effectively, we can stick about 20 customers (roughly 100 to
        400 SIP endpoints total) on a single Asterisk docker container
        without breaking a sweat.</div>
      <div class="elementToProof" style="font-family: Calibri, Arial,
        Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);
        background-color: rgb(255, 255, 255);">
        <br>
      </div>
      <div class="elementToProof" style="font-family: Calibri, Arial,
        Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);
        background-color: rgb(255, 255, 255);">
        The main issue now is trying to filter the real-time console
        output - We don't give customers access to any of that of
        course, just filtered logs and events via our web portal, which
        is permissions-based - so that a technician can diagnose a
        possible call flow failure without having to grep through tons
        of information.</div>
      <div class="elementToProof">
        <div id="Signature">
          <div>
            <div style="font-family: Calibri, Arial, Helvetica,
              sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
              <br>
            </div>
            <div style="">
              <p style="color:rgb(0,0,0);
                font-family:Calibri,sans-serif; font-size:12pt;
                margin:0in 0in 0.0001pt">
                <br>
              </p>
              <div dir="ltr" style="color:rgb(0,0,0);
                font-family:Calibri,Helvetica,sans-serif;
                font-size:12pt; margin:0px;
                background-color:rgb(255,255,255)">
              </div>
              <p style="color:rgb(0,0,0);
                font-family:Calibri,sans-serif; font-size:12pt;
                text-align:start; background-color:rgb(255,255,255);
                margin:0px">
                <br>
              </p>
              <p style="text-align:start;
                background-color:rgb(255,255,255); margin:0px"><span
                  style="margin:0px"><b style="color:rgb(0,0,0);
                    font-family:Calibri,sans-serif; font-size:16px"><span
                      style="margin:0px; font-family:Arial,sans-serif;
                      color:black">Luke </span></b><span style=""><font
                      face="Arial, sans-serif" color="#000000"><b>Escudé</b></font></span><br>
                </span></p>
              <p style="color:rgb(0,0,0);
                font-family:Calibri,sans-serif; font-size:12pt;
                text-align:start; background-color:rgb(255,255,255);
                margin:0px">
                <span style="margin:0px; font-size:11pt;
                  font-family:Arial,sans-serif"><span style="margin:0px;
                    font-size:16px; font-family:Calibri,sans-serif"><span
                      style="margin:0px; font-family:Arial,sans-serif;
                      color:black">Owner, CEO</span></span></span></p>
              <p style="color:rgb(0,0,0);
                font-family:Calibri,sans-serif; font-size:12pt;
                text-align:start; background-color:rgb(255,255,255);
                margin:0px">
                <span style="margin:0px; font-size:11pt;
                  font-family:Arial,sans-serif"><b
                    style="font-family:Calibri,sans-serif;
                    font-size:16px"><span style="margin:0px;
                      font-family:Arial,sans-serif; color:black"><br>
                    </span></b></span></p>
              <p style="color:rgb(0,0,0);
                font-family:Calibri,sans-serif; font-size:12pt;
                text-align:start; background-color:rgb(255,255,255);
                margin:0px">
                <span style="margin:0px; font-size:11pt;
                  font-family:Arial,sans-serif"><span style="margin:0px;
                    font-size:13.3333px">972.600.1150</span><b
                    style="font-family:Calibri,sans-serif;
                    font-size:16px"><span style="margin:0px;
                      font-family:Arial,sans-serif; color:black"><br>
                    </span></b></span></p>
              <p style="color:rgb(0,0,0);
                font-family:Calibri,sans-serif; font-size:12pt;
                text-align:start; background-color:rgb(255,255,255);
                margin:0px">
                <span style="margin:0px; font-size:11pt;
                  font-family:Arial,sans-serif"><span style="margin:0px;
                    font-size:13.3333px"><a class="moz-txt-link-abbreviated" href="mailto:support@primevox.net">support@primevox.net</a></span><b
                    style="font-family:Calibri,sans-serif;
                    font-size:16px"><span style="margin:0px;
                      font-family:Arial,sans-serif; color:black"><br>
                    </span></b></span></p>
              <p style="color:rgb(0,0,0);
                font-family:Calibri,sans-serif; font-size:12pt;
                text-align:start; background-color:rgb(255,255,255);
                margin:0px">
                <span style="margin:0px; font-size:11pt;
                  font-family:Arial,sans-serif"><span style="margin:0px;
                    font-size:13.3333px"><a
href="https://outlook.office365.com/owa/calendar/PrimeVOXCommunications@primevox.net/bookings/"
title="https://outlook.office365.com/owa/calendar/PrimeVOXCommunications@primevox.net/bookings/"
                      style="margin:0px" moz-do-not-send="true">Schedule
                      a meeting!</a></span></span></p>
              <span style="color:rgb(32,31,30);
                font-family:Calibri,Arial,Helvetica,sans-serif;
                font-size:12pt; margin:0px; text-align:start;
                background-color:rgb(255,255,255);
                display:inline!important">
                <div dir="ltr" style="margin:0px; font-size:12pt;
                  font-family:Calibri,Helvetica,sans-serif;
                  color:rgb(0,0,0)">
                  <br>
                </div>
              </span>
              <div dir="ltr" style="color:rgb(0,0,0);
                font-family:Calibri,Helvetica,sans-serif;
                font-size:12pt; margin:0px; text-align:start;
                background-color:rgb(255,255,255)">
                <br>
              </div>
              <div dir="ltr" style="color:rgb(0,0,0);
                font-family:Calibri,Helvetica,sans-serif;
                font-size:12pt; margin:0px; text-align:start;
                background-color:rgb(255,255,255)">
                <span style="font-size: 12pt;">View the PrimeVOX R&D
                  Roadmap </span><a
                  href="https://trello.com/b/pzpoyn8m/primevox-engineering"
title="https://trello.com/b/pzpoyn8m/primevox-engineering"
                  moz-do-not-send="true"><span style="font-size: 12pt;">here</span></a></div>
              <span style="font-family: Calibri, Helvetica, sans-serif;
                text-align: start; background-color: rgb(255, 255, 255);
                display: inline !important; font-size: 12pt;">View the
                PrimeVOX Status Page
              </span><span style="font-family:Calibri, Helvetica,
                sans-serif;text-align:start;background-color:rgb(255,
                255, 255);display:inline !important"><a
                  href="https://status.primevox.net/"
                  title="https://status.primevox.net/"
                  moz-do-not-send="true"><span style="font-size: 12pt;">here</span></a></span><br>
            </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> Jaco
          Kroon <a class="moz-txt-link-rfc2396E" href="mailto:jaco@uls.co.za"><jaco@uls.co.za></a><br>
          <b>Sent:</b> Wednesday, January 18, 2023 1:31 AM<br>
          <b>To:</b> Asterisk Developers Mailing List
          <a class="moz-txt-link-rfc2396E" href="mailto:asterisk-dev@lists.digium.com"><asterisk-dev@lists.digium.com></a>; Luke Escudé
          <a class="moz-txt-link-rfc2396E" href="mailto:luke@primevox.net"><luke@primevox.net></a><br>
          <b>Subject:</b> Re: [asterisk-dev] Logging and multi-tenancy</font>
        <div> </div>
      </div>
      <div>
        <p>Hi Luke,</p>
        <p><br>
        </p>
        On 2022/12/23 18:48, Luke Escudé wrote:<br>
        <blockquote type="cite">
          <style type="text/css" style="display:none">p
        {margin-top:0;
        margin-bottom:0}</style>
          <div class="x_elementToProof"
            style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0);
            background-color:rgb(255,255,255)">
            So, it's possible to achieve multi-tenancy in Asterisk with
            well-designed dial plan. By multi-tenancy, in terms of
            Asterisk, I mean each "customer" has their own separate dial
            plan, and each customer cannot "see" another.</div>
        </blockquote>
        <p>As long as each "customer" has their own "endpoint" details
          (for whatever protocol they use to connect), yes, this is
          technically possible.  There are other risks associated, eg,
          if you give them access to AMI or even to the CLI ... how do
          you control data visibility?  This just gets very, very risky.<br>
        </p>
        <p><br>
        </p>
        <p>Given that a well tuned asterisk instance can use sub 100MB
          of RAM ... I don't see the problem with running an asterisk
          instance per tenant.  Eliminates most of the above concerns,
          and if you do it right, pretty much all of the issues just
          goes away.  The one serious downside is that you need to bind
          each one to a different IP ... which is also not a major
          problem, one idea around this is to use a SIP proxy to
          dispatch to the correct "private" IP based on the registered
          to realm.<br>
        </p>
        <blockquote type="cite">
          <div class="x_elementToProof"
            style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0);
            background-color:rgb(255,255,255)">
            <br>
          </div>
          <div class="x_elementToProof"
            style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0);
            background-color:rgb(255,255,255)">
            However, when it comes to looking at the asterisk
            CLI/console, you see all the calls flowing across all dial
            plans, which can be a lot to look at.</div>
        </blockquote>
        Correct.<br>
        <blockquote type="cite">
          <div class="x_elementToProof"
            style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0);
            background-color:rgb(255,255,255)">
            <br>
          </div>
          <div class="x_elementToProof"
            style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0);
            background-color:rgb(255,255,255)">
            What is the possibility of adding some kind of "tenancy
            filtering" to CLI logging?</div>
        </blockquote>
        Extremely unlikely.<br>
        <blockquote type="cite">
          <div class="x_elementToProof"
            style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0);
            background-color:rgb(255,255,255)">
            <br>
            Example: At the beginning of a dial plan call, let's say
            exten => s, we set LoggingTenancy(customer_id), then all
            of the subsequent log messages are visible in the CLI only
            if you run the "logging view tenant (x)" or something like
            this.</div>
          <div class="x_elementToProof"
            style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0);
            background-color:rgb(255,255,255)">
            <br>
          </div>
          <div class="x_elementToProof"
            style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0);
            background-color:rgb(255,255,255)">
            That would make it easier to diagnose call issues on
            high-volume systems.</div>
        </blockquote>
        <p>Agreed.  We generally use the full log.  So in logger.conf:</p>
        <p><br>
        </p>
        <p>full => notice,warning,error,debug,verbose(4),dtmf,fax</p>
        <p><br>
        </p>
        <p>Now each call will have a C-?????? tag associated with it. 
          So after the call has completed, find the C-????? tag (You can
          for example use your LoggingTenancy idea here, but something
          like Verbose(TENTANT=?????, CLI=${CALLERID(full},
          DST=${EXTEN}) - this will give you something to grep for in
          the full log to find C-??????, then grep C-?????? full.<br>
        </p>
        <blockquote type="cite">
          <div class="x_elementToProof"
            style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0);
            background-color:rgb(255,255,255)">
            <br>
          </div>
          <div class="x_elementToProof"
            style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:12pt; color:rgb(0,0,0);
            background-color:rgb(255,255,255)">
            I, personally, do not have the ability to implement this,
            but I wanted to put it out there.</div>
        </blockquote>
        <br>
        <blockquote type="cite">
          <div class="x_elementToProof">
            <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
              font-size:12pt; color:rgb(0,0,0)">
              <br>
            </div>
            <div id="x_Signature">
              <div>
                <div
                  style="font-family:Calibri,Arial,Helvetica,sans-serif;
                  font-size:12pt; color:rgb(0,0,0)">
                  <br>
                </div>
                <div style="">
                  <p style="color:rgb(0,0,0);
                    font-family:Calibri,sans-serif; font-size:12pt;
                    margin:0in 0in 0.0001pt">
                    <br>
                  </p>
                  <div dir="ltr" style="color:rgb(0,0,0);
                    font-family:Calibri,Helvetica,sans-serif;
                    font-size:12pt; margin:0px;
                    background-color:rgb(255,255,255)">
                  </div>
                  <p style="color:rgb(0,0,0);
                    font-family:Calibri,sans-serif; font-size:12pt;
                    text-align:start; background-color:rgb(255,255,255);
                    margin:0px">
                    <br>
                  </p>
                  <p style="text-align:start;
                    background-color:rgb(255,255,255); margin:0px"><span
                      style="margin:0px"><b style="color:rgb(0,0,0);
                        font-family:Calibri,sans-serif; font-size:16px"><span
                          style="margin:0px;
                          font-family:Arial,sans-serif; color:black">Luke </span></b><span
                        style=""><font face="Arial, sans-serif"
                          color="#000000"><b>Escudé</b></font></span><br>
                    </span></p>
                  <p style="color:rgb(0,0,0);
                    font-family:Calibri,sans-serif; font-size:12pt;
                    text-align:start; background-color:rgb(255,255,255);
                    margin:0px">
                    <br>
                  </p>
                  <p style="color:rgb(0,0,0);
                    font-family:Calibri,sans-serif; font-size:12pt;
                    text-align:start; background-color:rgb(255,255,255);
                    margin:0px">
                    <span style="margin:0px; font-size:11pt;
                      font-family:Arial,sans-serif"><span
                        style="margin:0px; font-size:13.3333px">972.600.1150</span><b
                        style="font-family:Calibri,sans-serif;
                        font-size:16px"><span style="margin:0px;
                          font-family:Arial,sans-serif; color:black"><br>
                        </span></b></span></p>
                  <p style="color:rgb(0,0,0);
                    font-family:Calibri,sans-serif; font-size:12pt;
                    text-align:start; background-color:rgb(255,255,255);
                    margin:0px">
                    <span style="margin:0px; font-size:11pt;
                      font-family:Arial,sans-serif"><span
                        style="margin:0px; font-size:13.3333px"><a
                          class="x_moz-txt-link-abbreviated
                          moz-txt-link-freetext"
                          href="mailto:support@primevox.net"
                          moz-do-not-send="true">support@primevox.net</a></span><b
                        style="font-family:Calibri,sans-serif;
                        font-size:16px"><span style="margin:0px;
                          font-family:Arial,sans-serif; color:black"><br>
                        </span></b></span></p>
                  <p style="color:rgb(0,0,0);
                    font-family:Calibri,sans-serif; font-size:12pt;
                    text-align:start; background-color:rgb(255,255,255);
                    margin:0px">
                    <span style="margin:0px; font-size:11pt;
                      font-family:Arial,sans-serif"><span
                        style="margin:0px; font-size:13.3333px"><a
href="https://outlook.office365.com/owa/calendar/PrimeVOXCommunications@primevox.net/bookings/"
title="https://outlook.office365.com/owa/calendar/PrimeVOXCommunications@primevox.net/bookings/"
                          style="margin:0px" moz-do-not-send="true">Schedule
                          a meeting!</a></span></span></p>
                  <span style="color:rgb(32,31,30);
                    font-family:Calibri,Arial,Helvetica,sans-serif;
                    font-size:12pt; margin:0px; text-align:start;
                    background-color:rgb(255,255,255);
                    display:inline!important">
                    <div dir="ltr" style="margin:0px; font-size:12pt;
                      font-family:Calibri,Helvetica,sans-serif;
                      color:rgb(0,0,0)">
                      <br>
                    </div>
                  </span>
                  <div dir="ltr" style="color:rgb(0,0,0);
                    font-family:Calibri,Helvetica,sans-serif;
                    font-size:12pt; margin:0px; text-align:start;
                    background-color:rgb(255,255,255)">
                    <br>
                  </div>
                  <div dir="ltr" style="color:rgb(0,0,0);
                    font-family:Calibri,Helvetica,sans-serif;
                    font-size:12pt; margin:0px; text-align:start;
                    background-color:rgb(255,255,255)">
                    <span style="font-size:12pt">View the PrimeVOX
                      R&D Roadmap </span><a
                      href="https://trello.com/b/pzpoyn8m/primevox-engineering"
title="https://trello.com/b/pzpoyn8m/primevox-engineering"
                      moz-do-not-send="true"><span
                        style="font-size:12pt">here</span></a></div>
                  <span style="font-family:Calibri,Helvetica,sans-serif;
                    text-align:start; background-color:rgb(255,255,255);
                    display:inline!important; font-size:12pt">View the
                    PrimeVOX Status Page
                  </span><span
                    style="font-family:Calibri,Helvetica,sans-serif;
                    text-align:start; background-color:rgb(255,255,255);
                    display:inline!important"><a
                      href="https://status.primevox.net/"
                      title="https://status.primevox.net/"
                      moz-do-not-send="true"><span
                        style="font-size:12pt">here</span></a></span><br>
                </div>
              </div>
            </div>
          </div>
          <br>
          <fieldset class="x_moz-mime-attachment-header"></fieldset>
        </blockquote>
      </div>
    </blockquote>
  </body>
</html>