<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hello,</p>
    <p>do you check that header_name parameter set for
      KSR.hdr.is_present() is a string value?</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 22.02.22 15:36, Wojciech Kopciewicz
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAFtx=7Yer+r2-D-GCo1tHy0Dg7x4fbNwtQYT_=Mf+J9aLgAFqw@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div class="gmail_default"
          style="font-family:arial,helvetica,sans-serif">
          <p
style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,47);font-family:-apple-system,BlinkMacSystemFont,"Segoe
            UI",Helvetica,Arial,sans-serif,"Apple Color
            Emoji","Segoe UI Emoji";font-size:14px">Hi,</p>
          <p
style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,47);font-family:-apple-system,BlinkMacSystemFont,"Segoe
            UI",Helvetica,Arial,sans-serif,"Apple Color
            Emoji","Segoe UI Emoji";font-size:14px">Intermittently
            we are observing the following error when checking if given
            header is present in SIP INVITE:<br>
          </p>
          <p dir="auto"
style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,47);font-family:-apple-system,BlinkMacSystemFont,"Segoe
            UI",Helvetica,Arial,sans-serif,"Apple Color
            Emoji","Segoe UI Emoji";font-size:14px">SystemError:
            returned a result with an error set</p>
          <p dir="auto"
style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,47);font-family:-apple-system,BlinkMacSystemFont,"Segoe
            UI",Helvetica,Arial,sans-serif,"Apple Color
            Emoji","Segoe UI Emoji";font-size:14px">The
            complete stack trace is (some names redacted):<br
              style="box-sizing:border-box">
            11(28) ERROR: {1 195 INVITE
            nMHZDN.10nOIDt4ldOwz5cqz0XnMepA9} app_python3
            [python_support.c:156]: python_handle_exception(): apy_exec:
            modify_headers((null)): Unhandled exception in the Python
            code:<br style="box-sizing:border-box">
            TypeError: an integer is required (got type NoneType)</p>
          <p dir="auto"
style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,47);font-family:-apple-system,BlinkMacSystemFont,"Segoe
            UI",Helvetica,Arial,sans-serif,"Apple Color
            Emoji","Segoe UI Emoji";font-size:14px">The
            above exception was the direct cause of the following
            exception:</p>
          <p dir="auto"
style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,47);font-family:-apple-system,BlinkMacSystemFont,"Segoe
            UI",Helvetica,Arial,sans-serif,"Apple Color
            Emoji","Segoe UI Emoji";font-size:14px">Traceback
            (most recent call last):<br style="box-sizing:border-box">
            File "/etc/kamailio/kamailio.py", line 25, in modify_headers<br
              style="box-sizing:border-box">
            self.modify_header("SomeHeader")<br
              style="box-sizing:border-box">
            File "/etc/kamailio/kamailio.py", line 29, in modify_header<br
              style="box-sizing:border-box">
            present = KSR.hdr.is_present(header_name)<br
              style="box-sizing:border-box">
            SystemError: returned a result with an error set</p>
          <p
style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,47);font-family:-apple-system,BlinkMacSystemFont,"Segoe
            UI",Helvetica,Arial,sans-serif,"Apple Color
            Emoji","Segoe UI Emoji";font-size:14px">Kamailio
            version (kamailio -v output):<br>
          </p>
          <p
style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,47);font-family:-apple-system,BlinkMacSystemFont,"Segoe
            UI",Helvetica,Arial,sans-serif,"Apple Color
            Emoji","Segoe UI Emoji";font-size:14px"><span
style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(34,34,34)">version:
              kamailio 5.4.6 (x86_64/linux)</span></p>
          <p dir="auto"
style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,47);font-family:-apple-system,BlinkMacSystemFont,"Segoe
            UI",Helvetica,Arial,sans-serif,"Apple Color
            Emoji","Segoe UI Emoji";font-size:14px"><span
style="color:rgb(34,34,34);font-family:arial,helvetica,sans-serif;font-size:small">flags:
              USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS,
              DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP,
              PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC,
              DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT,
              USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR,
              USE_DST_BLACKLIST, HAVE_RESOLV_RES,
              TLS_PTHREAD_MUTEX_SHARED</span><br
style="color:rgb(34,34,34);font-family:arial,helvetica,sans-serif;font-size:small">
            <span
style="color:rgb(34,34,34);font-family:arial,helvetica,sans-serif;font-size:small">ADAPTIVE_WAIT_LOOPS
              1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024,
              BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB</span><br
style="color:rgb(34,34,34);font-family:arial,helvetica,sans-serif;font-size:small">
            <span
style="color:rgb(34,34,34);font-family:arial,helvetica,sans-serif;font-size:small">poll
              method support: poll, epoll_lt, epoll_et, sigio_rt,
              select.</span><br
style="color:rgb(34,34,34);font-family:arial,helvetica,sans-serif;font-size:small">
            <span
style="color:rgb(34,34,34);font-family:arial,helvetica,sans-serif;font-size:small">id:
              unknown</span><br
style="color:rgb(34,34,34);font-family:arial,helvetica,sans-serif;font-size:small">
            <span
style="color:rgb(34,34,34);font-family:arial,helvetica,sans-serif;font-size:small">compiled
              with gcc 8.3.0</span><br>
          </p>
          <p
style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,47);font-family:-apple-system,BlinkMacSystemFont,"Segoe
            UI",Helvetica,Arial,sans-serif,"Apple Color
            Emoji","Segoe UI Emoji";font-size:14px"><span
style="color:rgb(34,34,34);font-family:arial,helvetica,sans-serif;font-size:small">Operation
              system: </span><span
style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(34,34,34)">Linux
              kamailio-5c7484c74d-vhhr8 5.4.0-1056-azure
              #58~18.04.1-Ubuntu SMP Wed Jul 28 23:14:18 UTC 2021 x86_64
              GNU/Linux</span><span
style="color:rgb(34,34,34);font-family:arial,helvetica,sans-serif;font-size:small"> </span></p>
          <p
style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,47);font-family:-apple-system,BlinkMacSystemFont,"Segoe
            UI",Helvetica,Arial,sans-serif,"Apple Color
            Emoji","Segoe UI Emoji";font-size:14px">Are
            you able to help me find the root cause of this issue?</p>
        </div>
        <div>
          <div dir="ltr" class="gmail_signature"
            data-smartmail="gmail_signature">
            <div dir="ltr">
              <div>
                <div dir="ltr">
                  <div>Pozdrawiam / Best regards,<br>
                  </div>
                  <div dir="ltr">
                    <div>Wojtek</div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <p dir="ltr"
        style="line-height:1.8;margin-top:0pt;margin-bottom:0pt"><font
          size="2"><i><span style="background-color:rgb(255,255,255);font-family:Arial;white-space:pre-wrap">For more information on how and why we collect your personal information, please visit our </span><span style="white-space:pre-wrap;color:rgb(38,50,56);font-family:Roboto,sans-serif"><a href="https://www.motorolasolutions.com/en_us/about/privacy-policy.html?elqTrackId=8980d888905940e39a2613a7a3dcb0a7&elqaid=2786&elqat=2#privacystatement" target="_blank" moz-do-not-send="true">Privacy Policy</a>.</span></i></font></p>
      <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>
    <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>
Kamailio Advanced Training - Online
  Mar 28-31, 2022 (Europe Timezone)
  * <a class="moz-txt-link-freetext" href="https://www.asipto.com/sw/kamailio-advanced-training-online/">https://www.asipto.com/sw/kamailio-advanced-training-online/</a></pre>
  </body>
</html>