From miconda@gmail.com Fri Oct 22 15:49:12 2021 From: Daniel-Constantin Mierla To: sr-users@lists.kamailio.org Subject: Re: [SR-Users] T_req(pv) not accessible in dialog event route in v5.5.2 Date: Fri, 22 Oct 2021 15:49:03 +0200 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1227032940==" --===============1227032940== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello, 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. 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). Cheers, Daniel On 22.10.21 01:56, Joel Serrano wrote: > I think it could be related > to:=C2=A0https://github.com/kamailio/kamailio/issues/2479 > =C2=A0 > > Commit:=C2=A0https://github.com/kamailio/kamailio/commit/2e7710e292a649c6c5= 7e46d5994d3b2cf3815865 > > > Thanks! > Joel. > > On Thu, Oct 21, 2021 at 4:22 PM Joel Serrano > wrote: > > Hello,=C2=A0 > > I'm in the process of updating some servers that are running Kam > v5.1.4 to v5.5.2. > > After the upgrade I've noticed that I've lost some custom metrics > that we have defined via config-script.=C2=A0 > > Snippet of the relevant config: > > event_route[dialog:start] { > =C2=A0 =C2=A0 # Gather metrics regarding source IP > =C2=A0 =C2=A0 xlog("L_WARN", "[DLG] - Checking country for ($si | > $T_req($si)) - START\n"); > =C2=A0 =C2=A0 if (geoip2_match("$T_req($si)", "src")) { > =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Country found > =C2=A0 =C2=A0 =C2=A0 =C2=A0 ... > =C2=A0 =C2=A0 } > =C2=A0 =C2=A0 xlog("L_WARN", "[DLG] - Checking country for ($si | > $T_req($si)) - END\n"); > } > > NOTE: xlog lines added for debugging, they normally are not there. > > > In version 5.1.4 in the logs I see:=C2=A0 > > Oct 21 15:55:47 13cn3 sbc[22606]: WARNING: