Hello,

for the first question, you could use textops

https://www.kamailio.org/docs/modules/devel/modules/textops.html#textops.f.search_hf

or just cfg regular expression match on the PV together with a transformation

if ($(hdr(Diversion){uri.user}) ~= "...")

to see if the header field contains the value.

For the second question, there is not function right now that is the opposite 
of the is.numeric. You could use some regular expression replace transformation 
for example to achieve a similar result, I think.

Cheers,

Henning

--
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://gilawa.com<https://gilawa.com/>

From: sr-users <[email protected]> On Behalf Of Lewis 
Hutchinson
Sent: Friday, May 27, 2022 3:53 PM
To: [email protected]
Subject: [SR-Users] Find Values in User part of Diversion URI

Sorry if this is a super basic ask but I can't seem to work it out, I have got 
a work around but for my own sanity wanted to post the question on here.

In Kamailio Native 5.5.2

I want to be able to look into this field $(di{uri.user}) and "find" or see if 
it "contains" a value

i.e Diversion: "TEST" sip:[email protected];user=phone;

find 234

or

contains 234

I know how to do this in in KEMI Python but for the life of me cant get my head 
around it in Native.

2ndly is there an opposite to {s.numeric} Removes all non-numeric parts of 
string.

I want the ability to strip all numeric parts.

Keep us the good work.


Lewis

__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
  * [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

Reply via email to