From pkecastillo@gmail.com Fri Apr 19 10:38:16 2024 From: Ricardo Castillo To: sr-users@lists.kamailio.org Subject: [SR-Users] lcr module, avp_subst to $avp(i:709) Date: Fri, 19 Apr 2024 10:38:11 +0000 Message-ID: <171352309174.1622.14470037475840284104@main.kamailio.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1341779664==" --===============1341779664== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi, I'm trying to capture the content of an AVP from the LCR module and assig= n it to another variable to make use of what is obtained by the regex. For th= is, I have used the avp_subst. The content of $avp(i:709): 1|sip:|0|||2416027840||5061||;transport=3Dudp|11|1 I need to extract the index that indicates the port "5061" at position 8. I haven't been able to achieve this by trying several regex patterns. Has anyone experienced something similar? Thanks! --===============1341779664==-- From hw@gilawa.com Fri Apr 19 15:18:33 2024 From: Henning Westerholt To: sr-users@lists.kamailio.org Subject: [SR-Users] Re: lcr module, avp_subst to $avp(i:709) Date: Fri, 19 Apr 2024 15:18:23 +0000 Message-ID: In-Reply-To: <171352309174.1622.14470037475840284104@main.kamailio.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2013673241==" --===============2013673241== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello, If the input data is somehow well formed, you could use the following transfo= rmation to split around the pipe character for example: https://www.kamailio.org/wiki/cookbooks/devel/transformations#sselect_index_s= eparator Cheers, Henning=20 > -----Original Message----- > From: Ricardo Castillo via sr-users > Sent: Freitag, 19. April 2024 12:38 > To: sr-users(a)lists.kamailio.org > Cc: Ricardo Castillo > Subject: [SR-Users] lcr module, avp_subst to $avp(i:709) >=20 > Hi, I'm trying to capture the content of an AVP from the LCR module and ass= ign it > to another variable to make use of what is obtained by the regex. For this,= I have > used the avp_subst. >=20 > The content of $avp(i:709): > 1|sip:|0|||2416027840||5061||;transport=3Dudp|11|1 >=20 > I need to extract the index that indicates the port "5061" at position 8. > I haven't been able to achieve this by trying several regex patterns. > Has anyone experienced something similar? >=20 > Thanks! > __________________________________________________________ > Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe s= end > an email to sr-users-leave(a)lists.kamailio.org > Important: keep the mailing list in the recipients, do not reply only to th= e sender! > Edit mailing list options or unsubscribe: --===============2013673241==-- From pkecastillo@gmail.com Mon Apr 22 08:07:17 2024 From: Ricardo Castillo To: sr-users@lists.kamailio.org Subject: [SR-Users] Re: lcr module, avp_subst to $avp(i:709) Date: Mon, 22 Apr 2024 08:07:12 +0000 Message-ID: <171377323237.1622.4905026624263063595@main.kamailio.org> In-Reply-To: =?utf-8?q?=3CVI1PR07MB5216830B649494CDD0906452BF0D2=40VI1PR07MB?= =?utf-8?q?5216=2Eeurprd07=2Eprod=2Eoutlook=2Ecom=3E?= MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0616131139==" --===============0616131139== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hi Henning thanks for your response, solved! For my case exposed: 1|sip:|0|||2416027840||5061||;transport=udp|11|1 Filter $avp(port_lcr_gw) = $(avp(i:709){s.select,7,|}); verbose: NOTICE: