<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi,<br>
    <br>
    And please keep in mind that SIP calls (in asterisk 11 at least) are
    very much serialized and you're going to affect the response times
    to SIP frames by introducing extra work there - really do look at
    the ASF.<br>
    <br>
    Frankly, if you're after what I think you're after, I've been
    parsing the logs for exactly that since before ASF ... and I should
    probably convert, but for now the tail -F ... | sed -nre '...' |
    banscript is working quite nicely.<br>
    <br>
    Kind Regards,<br>
    Jaco<br>
    <br>
    <div class="moz-cite-prefix">On 22/02/2016 18:28, Scott Griepentrog
      wrote:<br>
    </div>
    <blockquote
cite="mid:CACrpESZ+DgoHA8vba7BGiDm--e=fbu8m+AUfz_S8rDEiWFRT0A@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_default" style="color:rgb(102,0,0)">​>
          unsuccessful register count</div>
        <div class="gmail_default" style="color:rgb(102,0,0)"><br>
        </div>
        <div class="gmail_default" style="color:rgb(102,0,0)">Why not
          use the security event logging system instead?  Would be
          easier than modifying chan_sip, and less prone to introducing
          undesired side affects by inserting a system call.</div>
        <div class="gmail_default" style="color:rgb(102,0,0)"><br>
        </div>
        <div class="gmail_default" style="color:rgb(102,0,0)"><a
            moz-do-not-send="true"
href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+Security+Framework"><a class="moz-txt-link-freetext" href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+Security+Framework">https://wiki.asterisk.org/wiki/display/AST/Asterisk+Security+Framework</a></a></div>
        <div class="gmail_default" style="color:rgb(102,0,0)"> ​</div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Mon, Feb 22, 2016 at 10:06 AM, Pedro
          Guillem [e-Mediate] <span dir="ltr"><<a
              moz-do-not-send="true" href="mailto:pg@e-mediate.co"
              target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:pg@e-mediate.co">pg@e-mediate.co</a></a>></span> wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div link="#0563C1" vlink="#954F72" lang="ES-CO">
              <div>
                <p class="MsoNormal"><span lang="EN-US">Hi Folks</span></p>
                <p class="MsoNormal"><span lang="EN-US">I haven´t used C
                    in a decade so i´m kind of rusty, but I understand
                    the advanced basics of it.</span></p>
                <p class="MsoNormal"><span lang="EN-US"> </span></p>
                <p class="MsoNormal"><span lang="EN-US">I know there is
                    a function called ast_safe_system() declared on
                    asterisk.c used to perform system calls.</span></p>
                <p class="MsoNormal"><span lang="EN-US">I need
                    chan_sip.c to call a local program each time a
                    registration is unsuccessful.</span></p>
                <p class="MsoNormal"><span lang="EN-US"> </span></p>
                <p class="MsoNormal"><span lang="EN-US">I know the exact
                    line of chan_sip.c where I can trigger this system
                    call, but I don´t know if I can use
                    ast_safe_system()  from within a function of
                    chan_sip.c.</span></p>
                <p class="MsoNormal"><span lang="EN-US"> </span></p>
                <p class="MsoNormal"><span lang="EN-US">Any ideas?</span></p>
                <p class="MsoNormal"><span lang="EN-US">Should I include
                    an additional header files to chan_sip.c in order to
                    call this function?</span></p>
                <p class="MsoNormal"><span lang="EN-US"> </span></p>
                <p class="MsoNormal"><span lang="EN-US">Best</span></p>
                <p class="MsoNormal"><span lang="EN-US">Pedro</span></p>
                <p class="MsoNormal"><span lang="EN-US"> </span></p>
                <p class="MsoNormal"><span lang="EN-US">PS: Yeah.. most
                    of you will probably ask why on earth would I want
                    to do that..</span></p>
                <p class="MsoNormal"><span lang="EN-US">Quick answer is
                    I don´t want to modify chan_sip.c that much in order
                    to do something like keeping an unsuccessful
                    register count… so i´d rather delegate that to a
                    third party script</span></p>
                <p class="MsoNormal"><span lang="EN-US"> </span></p>
                <p class="MsoNormal"><span lang="EN-US"> </span></p>
                <p class="MsoNormal"><span lang="EN-US"> </span></p>
                <p class="MsoNormal"> </p>
              </div>
              <br>
              <table style="border-top:1px solid #aaabb6">
                <tbody>
                  <tr>
                    <td
style="width:470px;padding-top:20px;color:#41424e;font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px">Este
                      correo electrónico se ha enviado desde un equipo
                      libre de virus y protegido por Avast. <br>
                      <a moz-do-not-send="true"
                        href="https://www.avast.com/sig-email"
                        style="color:#4453ea" target="_blank">www.avast.com</a>
                    </td>
                  </tr>
                </tbody>
              </table>
            </div>
            <br>
            --<br>
_____________________________________________________________________<br>
            -- Bandwidth and Colocation Provided by <a
              moz-do-not-send="true" href="http://www.api-digital.com"
              rel="noreferrer" target="_blank"><a class="moz-txt-link-freetext" href="http://www.api-digital.com">http://www.api-digital.com</a></a>
            --<br>
            <br>
            asterisk-dev mailing list<br>
            To UNSUBSCRIBE or update options visit:<br>
               <a moz-do-not-send="true"
              href="http://lists.digium.com/mailman/listinfo/asterisk-dev"
              rel="noreferrer" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        <div class="gmail_signature">
          <div dir="ltr"><img moz-do-not-send="true" alt="Digium logo"
              src="https://my.digium.com/images/graphics/digium_RGB_signature.gif"
style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px"
              width="288" height="50">
            <div>Scott Griepentrog<br>
              Digium, Inc · Software Developer<br>
              445 Jan Davis Drive NW · Huntsville, AL 35806 · US<br>
              direct/fax: +1 256 428 6239 · mobile: +1 256 580 6090<br>
              Check us out at: <a moz-do-not-send="true"
                href="http://digium.com" target="_blank">http://digium.com</a>
              · <a moz-do-not-send="true" href="http://asterisk.org"
                target="_blank">http://asterisk.org</a><br>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
    </blockquote>
    <br>
  </body>
</html>