<div dir="auto">Hi Daniel,</div><div dir="auto"><br></div><div dir="auto">Thanks for checking this. I tried both (avp & dlg_var) and they both worked fine in the event route. </div><div dir="auto"><br></div><div dir="auto">Thanks!</div><div dir="auto">Joel. </div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 22, 2021 at 06:49 Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">
  
    
  
  <div>
    <p>Hello,</p>
    <p>indeed, there was a change in the behaviour based on the links
      you provided. It was not safe to use $T_req() in other route
      blocks. Maybe for event_route[dialog:start] would still be ok,
      because it is executed only on 200ok for INVITE, but dialog:end
      can be executed on dialog timeout, without any request/reply
      within dialog being processed at time.</p>
    <p>The solution is to store the source IP of the request avp/xavp (I
      think this event route is executed after corresponding transaction
      match), or in a dialog variable or in htable (using callid/from
      tag as a key).</p>
    <p>Cheers,<br>
      Daniel<br>
    </p></div><div>
    <div>On 22.10.21 01:56, Joel Serrano wrote:<br>
    </div>
    </div><div><blockquote type="cite"></blockquote></div><div><blockquote type="cite">
      
      <div dir="ltr">I think it could be related to: <a href="https://github.com/kamailio/kamailio/issues/2479" target="_blank">https://github.com/kamailio/kamailio/issues/2479</a> 
        <div><br>
        </div>
        <div>Commit: <a href="https://github.com/kamailio/kamailio/commit/2e7710e292a649c6c57e46d5994d3b2cf3815865" target="_blank">https://github.com/kamailio/kamailio/commit/2e7710e292a649c6c57e46d5994d3b2cf3815865</a></div>
        <div><br>
        </div>
        <div>Thanks!</div>
        <div>Joel.</div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Thu, Oct 21, 2021 at 4:22
          PM Joel Serrano <<a href="mailto:joel@textplus.com" target="_blank">joel@textplus.com</a>> wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">
          <div dir="ltr">Hello, 
            <div><br>
            </div>
            <div>I'm in the process of updating some servers that are
              running Kam v5.1.4 to v5.5.2.</div>
            <div><br>
            </div>
            <div>
              <div>After the upgrade I've noticed that I've lost some
                custom metrics that we have defined via config-script. </div>
              <div><br>
              </div>
              <div>Snippet of the relevant config:</div>
              <div><br>
              </div>
            </div>
            <div><font face="monospace" style="font-family:monospace;color:rgb(0,0,0)">event_route[dialog:start] {<br>
                    # Gather metrics regarding source IP<br>
                    xlog("L_WARN", "[DLG] - Checking country for ($si |
                $T_req($si)) - START\n");<br>
                    if (geoip2_match("$T_req($si)", "src")) {<br>
                        # Country found<br>
                        ...<br>
                    }<br>
                    xlog("L_WARN", "[DLG] - Checking country for ($si |
                $T_req($si)) - END\n");<br>
                }</font><br>
            </div>
            <div><br>
            </div>
            <div>NOTE: xlog lines added for debugging, they normally are
              not there.</div>
            <div><br>
            </div>
            <div><br>
            </div>
            <div>In version 5.1.4 in the logs I see: </div>
            <div><br>
            </div>
            <div><font face="monospace" style="font-family:monospace;color:rgb(0,0,0)">Oct 21 15:55:47 13cn3
                sbc[22606]: WARNING: <script>: [DLG] - Checking
                country for (A.B.C.D | 186.185.186.7) - START<br>
                Oct 21 15:55:47 13cn3 sbc[22606]: WARNING:
                <script>: [DLG] - Checking country for (A.B.C.D |
                186.185.186.7) - END<br>
              </font></div>
            <div><br>
            </div>
            <div>The same config, on v5.5.2 is returning:</div>
            <div><br>
            </div>
            <div><font face="monospace" style="font-family:monospace;color:rgb(0,0,0)">Oct 21 15:57:08 sbc0504
                sbc[22606]: WARNING: <script>: [DLG] - Checking
                country for (A.B.C.D | <null>) - START<br>
                Oct 21 15:57:08 sbc0504 sbc[22606]:
                WARNING: <script>: [DLG] - Checking country for
                (A.B.C.D | <null>) - END<br>
              </font></div>
            <div><br>
            </div>
            <div>After enabling debug logs I see:</div>
            <div><br>
            </div>
            <div><font face="monospace" style="font-family:monospace;color:rgb(0,0,0)">WARNING: <script>: [DLG] -
                Checking country for (198.1.55.124 | <null>) -
                START<br>
                <b style="font-family:monospace"><font style="font-family:monospace;color:rgb(255,0,0)">DEBUG: tmx [t_var.c:309]:
                    pv_get_t_var_req(): used in unsupported route block
                    - type 64<br>
                  </font></b>DEBUG: geoip2 [geoip2_pv.c:488]:
                geoip2_update_pv(): attempt to match: <null><br>
                DEBUG: geoip2 [geoip2_pv.c:491]: geoip2_update_pv(): no
                match for: <null></font><br>
            </div>
            <div><br>
            </div>
            <div><br>
            </div>
            <div>Did something change in the tmx module that could
              affect $T_req(pv) being accessible in the dialog:start
              event_route?</div>
            <div><br>
            </div>
            <div>Any alternatives to get the source IP of the request
              (not the reply) in the dialog:start event_route?</div>
            <div><br>
            </div>
            <div>Let me know if you prefer that I open a ticket for this
              in GH.</div>
            <div><br>
            </div>
            <div>Thanks, </div>
            <div>Joel.</div>
            <div><br>
            </div>
            <div><br>
            </div>
          </div>
        </blockquote>
      </div>
      <br>
      <fieldset></fieldset>
      </blockquote></div><div><blockquote type="cite"><pre style="font-family:monospace">__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
  * <a href="mailto:sr-users@lists.kamailio.org" target="_blank" style="font-family:monospace">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 href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank" style="font-family:monospace">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre></blockquote></div><div><blockquote type="cite">
    </blockquote>
    <pre cols="72" style="font-family:monospace">-- 
Daniel-Constantin Mierla -- <a href="http://www.asipto.com" target="_blank" style="font-family:monospace">www.asipto.com</a>
<a href="http://www.twitter.com/miconda" target="_blank" style="font-family:monospace">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda" target="_blank" style="font-family:monospace">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - Online
Nov 08-11, 2021 (Europe Timezone) - Nov 22-25, 2021 (America Timezone)
  * <a href="https://www.asipto.com/sw/kamailio-advanced-training-online/" target="_blank" style="font-family:monospace">https://www.asipto.com/sw/kamailio-advanced-training-online/</a></pre>
  </div>

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