<div dir="ltr">Thanks Ovidiu,<div><br></div><div>Already tried that..</div><div><br></div><div><font face="monospace">$var(conid) = $(hdr(Route){param.value,wsconnid});<br>$var(conid) = $(var(conid){s.striptail,1}{<a href="http://s.int">s.int</a>});</font><br></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 Mon, May 3, 2021 at 11:06 PM Ovidiu Sas <<a href="mailto:osas@voipembedded.com">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">Try to convert to int using the {<a href="http://s.int" rel="noreferrer" target="_blank">s.int</a>} transformation.<br>
<br>
Regards,<br>
Ovidiu Sas<br>
<br>
On Mon, May 3, 2021 at 5:41 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 trying to do the following:<br>
><br>
> On INVITE, i add a param to RR "wsconnid" which is the connection id of the WS socket.<br>
> Afterwards, i get an OPTIONS including said param.<br>
><br>
> Next I want to retrieve the param and check if the connection is alive.<br>
><br>
> NOTE: using simply "$(hdr(Route){param.value,wsconnid})" returns an extra ">" from the end of the string, and i haven't been able to remove that any other way but with "striptail", it works fine.<br>
><br>
> ***<br>
>     $var(conid) = $(hdr(Route){param.value,wsconnid});<br>
>     $var(conid) = $(var(conid){s.striptail,1});<br>
>     xlog("L_ERR", "Connection ID parameter: [$var(conid)]");<br>
>     if (tcp_conid_alive("$var(conid)")) {<br>
>         xlog("L_ERR", "WS Connection ID $var(conid) is alive");<br>
>     } else {<br>
>         xlog("L_ERR", "WS Connection ID $var(conid) is NOT alive");<br>
>     }<br>
> ***<br>
><br>
> With that, "$var(conid)" contains the connection id properly:<br>
> ***<br>
> ERROR: <script>: Connection ID parameter: [2]<br>
> ***<br>
><br>
> but tcp_conid_alive complaints:<br>
> ***<br>
> 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>
> ***<br>
><br>
> Using a hardcoded number such as "1" generates no complaints.<br>
><br>
> Kamailio version:<br>
> version: kamailio 5.3.7 (x86_64/linux)<br>
><br>
> Not sure what's going on here, any ideas?<br>
><br>
> Regards,<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>