<div dir="ltr">Hello Daniel,<div><br></div><div>Yes, initially my question was about the tcpops returning an error, but then i realized i was passing the parameter as it was returned by </div><div><br></div><div><span style="font-family:monospace">$var(conid) = $(hdr(Route){uri.param,</span><span style="font-family:monospace">wsconnid})</span><br></div><div><br></div><div>Which had an extra ">" at the end.</div><div><br></div><div>But the problem wasn't really with the tcpops function, but with the transformation.</div><div><br></div><div>Thanks for taking the time to read the emails :) </div><div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Regards,</div><div><br></div>David Villasmil<div>email: <a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@gmail.com</a></div><div>phone: +34669448337</div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 4, 2021 at 3:08 PM Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p>The email written by you, to which I replied, had:</p>
<p>"""<br>
</p>
<div>but now i'd really like to understand why $var(whatever) which
contains "4" would result in:<br>
</div>
<div><br>
</div>
<div>ERROR: <core> [core/sr_module.c:1638]: get_int_fparam():
Could not convert PV to int<br>
ERROR: tcpops [tcpops_mod.c:374]: w_tcp_conid_state(): invalid
parameter 'conid' (must be a number)<br>
</div>
<div><br>
</div>
<div>?</div>
<div>"""</div>
<div><br>
</div>
<div>So the question/error was about tcpops function ... maybe you
wanted to mean something else, or I do not understand properly ...
?!?!<br>
</div>
<div><br>
</div>
<div>Cheers,<br>
Daniel<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>On 04.05.21 15:53, David Villasmil
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Not really, the question was about
<div><br>
</div>
<div><font face="monospace">$var(conid) =
$(hdr(Route){uri.param,wsconnid})<br>
</font></div>
<div><br>
</div>
<div>which returns an extra ">" from:</div>
<div><br>
</div>
<div><span style="font-family:monospace">Route:
<<a>sip:10.231.32.37;r2=on;lr</a>;</span><span style="font-family:monospace">wsconnid=13></span><br>
</div>
<div><br>
</div>
<div>if i print $var(conid) i would get:</div>
<div><br>
</div>
<div><span style="font-family:monospace">May 3 19:24:45
ip-10-231-32-37 /usr/sbin/kamailio[10015]: ERROR:
<script>: WS Connection ID 13></span><br style="font-family:monospace">
</div>
<div><span style="font-family:monospace"><br>
</span></div>
<div><span style="font-family:monospace">But then prepending </span>{uri.param,wsconnid}
with {nameaddr.uri} and adding {<a href="http://s.int" target="_blank">s.int</a>} did the trick, like so:</div>
<div><br>
</div>
<div><font face="monospace">$(hdr(Route){nameaddr.uri}{uri.param,wsconnid}{<a href="http://s.int/" target="_blank">s.int</a>});</font><br>
</div>
<div><br>
</div>
<div>Now I understand adding {nameaddr.uri} would basically
remove those "<" and ">" and that's why it then works.</div>
<div><br>
</div>
<div>Thanks Daniel and Ovidiu,<br>
</div>
<div>
<div>
<div dir="ltr">
<div dir="ltr">
<div><br>
</div>
David Villasmil
<div>email: <a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@gmail.com</a></div>
<div>phone: +34669448337</div>
</div>
</div>
</div>
<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Tue, May 4, 2021 at 2:41 PM
Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p>The question was about the tcpops function, because that
one printed the logs.</p>
<p>Cheers,<br>
Daniel<br>
</p>
<div>On 04.05.21 15:15, David Villasmil wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">I was using it like:
<div><br>
</div>
<div>$var(conid) = $(hdr(Route){uri.param,wsconnid}{<a href="http://s.int" target="_blank">s.int</a>})<br>
</div>
<div><br clear="all">
<div>
<div dir="ltr">
<div dir="ltr">
<div>Regards,</div>
<div><br>
</div>
David Villasmil
<div>email: <a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@gmail.com</a></div>
<div>phone: +34669448337</div>
</div>
</div>
</div>
<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Tue, May 4, 2021 at
7:24 AM Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p>Hello,</p>
<p>you have to show how you use the function and
pass the parameters to it.</p>
<p>Cheers,<br>
Daniel<br>
</p>
<div>On 04.05.21 00:27, David Villasmil wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">That did the trick (and adding the
s.init)
<div><br>
</div>
<div>
<div>$var(conid) =
$(hdr(Route){nameaddr.uri}{uri.param,wsconnid}{<a href="http://s.int" target="_blank">s.int</a>});<br>
</div>
</div>
<div><br>
</div>
<div>Now, i understand uri.param returning and
extra ">".</div>
<div><br>
</div>
<div>but now i'd really like to understand why
$var(whatever) which contains "4" would result
in:<br>
</div>
<div><br>
</div>
<div>ERROR: <core>
[core/sr_module.c:1638]: get_int_fparam():
Could not convert PV to int<br>
ERROR: tcpops [tcpops_mod.c:374]:
w_tcp_conid_state(): invalid parameter 'conid'
(must be a number)<br>
</div>
<div><br>
</div>
<div>?</div>
<div><br>
</div>
<div><br clear="all">
<div>
<div dir="ltr">
<div dir="ltr">
<div>Regards,</div>
<div><br>
</div>
David Villasmil
<div>email: <a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@gmail.com</a></div>
<div>phone: +34669448337</div>
</div>
</div>
</div>
<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Mon, May 3,
2021 at 11:03 PM Ovidiu Sas <<a href="mailto:osas@voipembedded.com" target="_blank">osas@voipembedded.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">You should
try something like this:<br>
$var(wsconnid) =
$(hdr(Route){nameaddr.uri}{uri.param,wsconnid})<br>
First you need to extract the URI, and then
the URI parameter.<br>
<br>
The param.value transformation is expecting a
true param list, not uri<br>
or nameaddress.<br>
<br>
Regards,<br>
Ovidiu Sas<br>
<br>
On Mon, May 3, 2021 at 3:29 PM David Villasmil<br>
<<a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@gmail.com</a>>
wrote:<br>
><br>
> Hello guys,<br>
><br>
> I'm possible using this wrong, but here
it is;<br>
> I need to get a previously set parameter
to rr, named "wsconnid":<br>
><br>
> $var(wsconnid) =
$(hdr(Route){param.value,wsconnid})<br>
> xlog("L_ERR", "Connection ID parameter:
$var(wsconnid)");<br>
><br>
> And i'm getting:<br>
><br>
> May 3 19:24:45 ip-10-231-32-37
/usr/sbin/kamailio[10015]: ERROR:
<script>: WS Connection ID 13><br>
> May 3 19:24:49 ip-10-231-32-37
/usr/sbin/kamailio[10014]: ERROR:
<script>: Got an OPTIONS We now need to
get the connection id from rr<br>
><br>
> This is an example:<br>
> Route: <a><sip:10.231.32.37;r2=on;lr;wsconnid=13></a><br>
><br>
> The function is returning "13>"
instead of "13".<br>
><br>
> Thanks all,<br>
><br>
> David Villasmil<br>
> email: <a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@gmail.com</a><br>
> phone: +34669448337<br>
>
__________________________________________________________<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>
<br>
<br>
<br>
-- <br>
VoIP Embedded, Inc.<br>
<a href="http://www.voipembedded.com" rel="noreferrer" target="_blank">http://www.voipembedded.com</a><br>
<br>
__________________________________________________________<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>
<fieldset></fieldset>
<pre>__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
* <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a>
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
* <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<pre cols="72">--
Daniel-Constantin Mierla -- <a href="http://www.asipto.com" target="_blank">www.asipto.com</a>
<a href="http://www.twitter.com/miconda" target="_blank">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda" target="_blank">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - Online
May 17-20, 2021 (Europe Timezone) - June 7-10, 2021 (America Timezone)
* <a href="https://www.asipto.com/sw/kamailio-advanced-training-online/" target="_blank">https://www.asipto.com/sw/kamailio-advanced-training-online/</a></pre>
</div>
</blockquote>
</div>
</blockquote>
<pre cols="72">--
Daniel-Constantin Mierla -- <a href="http://www.asipto.com" target="_blank">www.asipto.com</a>
<a href="http://www.twitter.com/miconda" target="_blank">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda" target="_blank">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - Online
May 17-20, 2021 (Europe Timezone) - June 7-10, 2021 (America Timezone)
* <a href="https://www.asipto.com/sw/kamailio-advanced-training-online/" target="_blank">https://www.asipto.com/sw/kamailio-advanced-training-online/</a></pre>
</div>
</blockquote>
</div>
</blockquote>
<pre cols="72">--
Daniel-Constantin Mierla -- <a href="http://www.asipto.com" target="_blank">www.asipto.com</a>
<a href="http://www.twitter.com/miconda" target="_blank">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda" target="_blank">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - Online
May 17-20, 2021 (Europe Timezone) - June 7-10, 2021 (America Timezone)
* <a href="https://www.asipto.com/sw/kamailio-advanced-training-online/" target="_blank">https://www.asipto.com/sw/kamailio-advanced-training-online/</a></pre>
</div>
</blockquote></div>