Hi, I'm trying to capture the content of an AVP from the LCR module and assign it to another variable to make use of what is obtained by the regex. For this, I have used the avp_subst.
The content of $avp(i:709): 1|sip:|0|||2416027840||5061||;transport=udp|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!
Hello,
If the input data is somehow well formed, you could use the following transformation to split around the pipe character for example: https://www.kamailio.org/wiki/cookbooks/devel/transformations#sselect_index_...
Cheers,
Henning
-----Original Message----- From: Ricardo Castillo via sr-users sr-users@lists.kamailio.org Sent: Freitag, 19. April 2024 12:38 To: sr-users@lists.kamailio.org Cc: Ricardo Castillo pkecastillo@gmail.com Subject: [SR-Users] lcr module, avp_subst to $avp(i:709)
Hi, I'm trying to capture the content of an AVP from the LCR module and assign it to another variable to make use of what is obtained by the regex. For this, I have used the avp_subst.
The content of $avp(i:709): 1|sip:|0|||2416027840||5061||;transport=udp|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! __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
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: <script>: splited: 5061
;)