[prev in list] [next in list] [prev in thread] [next in thread]
List: serusers
Subject: Re: [SR-Users] iterate trough all Record-Route values via @hf_value.Record_Route
From: Patrick Karton <patrickarton () hotmail ! com>
Date: 2022-07-21 0:47:22
Message-ID: VI1PR0402MB3789ADB826D042ECB51EB5D0DF919 () VI1PR0402MB3789 ! eurprd04 ! prod ! outlook ! com
[Download RAW message or body]
[Attachment #2 (text/plain)]
Hello Thanks.
i found that in 5.6 version we have new pseudo var
$hfl and $hflc for that.
thats exactly what i needed.
________________________________
De : sr-users <sr-users-bounces@lists.kamailio.org> de la part de Denys Pozniak \
<denys.pozniak@gmail.com> Envoyé : mardi 19 juillet 2022 14:32
À : Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>
Objet : Re: [SR-Users] iterate trough all Record-Route values via \
@hf_value.Record_Route
Hey!
Try this one:
$(hdr(name)[N]) - represents the body of the N-th header identified by 'name'.
вт, 19 июл. 2022 г. в 15:49, Patrick Karton \
<patrickarton@hotmail.com<mailto:patrickarton@hotmail.com>>: Hello All,
i would to iterate through all ips in Record-Route through @hf_value.Record_Route.
if i put static index like @hf_value.Record_Route[0] it works.
but $var(i) = 0; @hf_value.Record_Route[$var(i)] does not work.
is there a way to get the count of all headers values through @hf_value.Record_Route
For example i would like to iterate through all Record-Route Values if i receive it \
like this
Record-Route: <sip:1.1.1.1;lr=on;nat=yes>
Record-Route: <sip:2.2.2.2:5060;lr>,<sip:3.3.3.3:22506;lr>
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
* sr-users@lists.kamailio.org<mailto:sr-users@lists.kamailio.org>
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
--
BR,
Denys Pozniak
[Attachment #3 (text/html)]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} \
</style> </head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; \
color: rgb(0, 0, 0);" class="elementToProof"> Hello Thanks.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; \
color: rgb(0, 0, 0);" class="elementToProof"> <br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; \
color: rgb(0, 0, 0);" class="elementToProof"> i found that in 5.6 version we have new \
pseudo var</div> <div style="font-family: Calibri, Arial, Helvetica, sans-serif; \
font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof"> <br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; \
color: rgb(0, 0, 0);" class="elementToProof"> $hfl and $hflc for that.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; \
color: rgb(0, 0, 0);" class="elementToProof"> thats exactly what i needed.</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" \
style="font-size:11pt" color="#000000"><b>De :</b> sr-users \
<sr-users-bounces@lists.kamailio.org> de la part de Denys Pozniak \
<denys.pozniak@gmail.com><br> <b>Envoyé :</b> mardi 19 juillet 2022 14:32<br>
<b>À :</b> Kamailio (SER) - Users Mailing List \
<sr-users@lists.kamailio.org><br> <b>Objet :</b> Re: [SR-Users] iterate trough \
all Record-Route values via @hf_value.Record_Route</font> <div> </div>
</div>
<div>
<div dir="ltr">Hey!
<div><br>
<div>Try this one:</div>
<div><strong style="color:rgb(51,51,51); font-family:Arial,sans-serif; \
font-size:14px">$(hdr(name)[N])</strong><span style="color:rgb(51,51,51); \
font-family:Arial,sans-serif; font-size:14px"> - represents the body of the N-th \
header identified by 'name'.</span><br> </div>
<div><span style="color:rgb(51,51,51); font-family:Arial,sans-serif; \
font-size:14px"><br> </span></div>
</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">вт, 19 июл. 2022 г. в 15:49, Patrick \
Karton <<a href="mailto:patrickarton@hotmail.com">patrickarton@hotmail.com</a>>:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px \
solid rgb(204,204,204); padding-left:1ex"> <div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; \
color:rgb(0,0,0)"> Hello All, </div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; \
color:rgb(0,0,0)"> <br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; \
color:rgb(0,0,0)"> i would to iterate through all ips in Record-Route \
through @hf_value.Record_Route. </div> <div \
style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; \
color:rgb(0,0,0)"> <br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; \
color:rgb(0,0,0)"> if i put static index like @hf_value.Record_Route[0] it \
works.</div> <div style="font-family:Calibri,Arial,Helvetica,sans-serif; \
font-size:12pt; color:rgb(0,0,0)"> <br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; \
color:rgb(0,0,0)"> but $var(i) = 0; @hf_value.Record_Route[$var(i)] does not \
work.</div> <div style="font-family:Calibri,Arial,Helvetica,sans-serif; \
font-size:12pt; color:rgb(0,0,0)"> <br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; \
color:rgb(0,0,0)"> is there a way to get the count of all headers values \
through @hf_value.Record_Route</div> <div \
style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; \
color:rgb(0,0,0)"> <br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; \
color:rgb(0,0,0)"> For example i would like to iterate through all Record-Route \
Values if i receive it like this</div> <div \
style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; \
color:rgb(0,0,0)"> <br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; \
color:rgb(0,0,0)">
Record-Route: <sip:1.1.1.1;lr=on;nat=yes> </div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; \
color:rgb(0,0,0)">
Record-Route: <sip:2.2.2.2:5060;lr>,<sip:3.3.3.3:22506;lr><br>
</div>
</div>
__________________________________________________________<br>
Kamailio - Users Mailing List - Non Commercial Discussions<br>
* <a href="mailto:sr-users@lists.kamailio.org" \
target="_blank">sr-users@lists.kamailio.org</a><br>
Important: keep the mailing list in the recipients, do not reply only to the \
sender!<br> Edit mailing list options or unsubscribe:<br>
* <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" \
rel="noreferrer" target="_blank"> \
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br> </blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr" class="x_gmail_signature">
<div dir="ltr"><br>
<div>
<div>BR,</div>
<div>Denys Pozniak<br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
* sr-users@lists.kamailio.org
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
--===============0052067151==--
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic