Hello guys,
I'm possible using this wrong, but here it is; I need to get a previously set parameter to rr, named "wsconnid":
$var(wsconnid) = $(hdr(Route){param.value,wsconnid}) xlog("L_ERR", "Connection ID parameter: $var(wsconnid)");
And i'm getting:
May 3 19:24:45 ip-10-231-32-37 /usr/sbin/kamailio[10015]: ERROR: <script>: WS Connection ID 13> 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
This is an example: Route: sip:10.231.32.37;r2=on;lr;wsconnid=13
The function is returning "13>" instead of "13".
Thanks all,
David Villasmil email: david.villasmil.work@gmail.com phone: +34669448337
You should try something like this: $var(wsconnid) = $(hdr(Route){nameaddr.uri}{uri.param,wsconnid}) First you need to extract the URI, and then the URI parameter.
The param.value transformation is expecting a true param list, not uri or nameaddress.
Regards, Ovidiu Sas
On Mon, May 3, 2021 at 3:29 PM David Villasmil david.villasmil.work@gmail.com wrote:
Hello guys,
I'm possible using this wrong, but here it is; I need to get a previously set parameter to rr, named "wsconnid":
$var(wsconnid) = $(hdr(Route){param.value,wsconnid}) xlog("L_ERR", "Connection ID parameter: $var(wsconnid)");
And i'm getting:
May 3 19:24:45 ip-10-231-32-37 /usr/sbin/kamailio[10015]: ERROR: <script>: WS Connection ID 13> 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
This is an example: Route: sip:10.231.32.37;r2=on;lr;wsconnid=13
The function is returning "13>" instead of "13".
Thanks all,
David Villasmil email: david.villasmil.work@gmail.com phone: +34669448337 __________________________________________________________ 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:
That did the trick (and adding the s.init)
$var(conid) = $(hdr(Route){nameaddr.uri}{uri.param,wsconnid}{s.int});
Now, i understand uri.param returning and extra ">".
but now i'd really like to understand why $var(whatever) which contains "4" would result in:
ERROR: <core> [core/sr_module.c:1638]: get_int_fparam(): Could not convert PV to int ERROR: tcpops [tcpops_mod.c:374]: w_tcp_conid_state(): invalid parameter 'conid' (must be a number)
?
Regards,
David Villasmil email: david.villasmil.work@gmail.com phone: +34669448337
On Mon, May 3, 2021 at 11:03 PM Ovidiu Sas osas@voipembedded.com wrote:
You should try something like this: $var(wsconnid) = $(hdr(Route){nameaddr.uri}{uri.param,wsconnid}) First you need to extract the URI, and then the URI parameter.
The param.value transformation is expecting a true param list, not uri or nameaddress.
Regards, Ovidiu Sas
On Mon, May 3, 2021 at 3:29 PM David Villasmil david.villasmil.work@gmail.com wrote:
Hello guys,
I'm possible using this wrong, but here it is; I need to get a previously set parameter to rr, named "wsconnid":
$var(wsconnid) = $(hdr(Route){param.value,wsconnid}) xlog("L_ERR", "Connection ID parameter: $var(wsconnid)");
And i'm getting:
May 3 19:24:45 ip-10-231-32-37 /usr/sbin/kamailio[10015]: ERROR:
<script>: WS Connection ID 13> > 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 > > This is an example: > Route: <sip:10.231.32.37;r2=on;lr;wsconnid=13> > > The function is returning "13>" instead of "13". > > Thanks all, > > David Villasmil > email: david.villasmil.work@gmail.com > phone: +34669448337 > __________________________________________________________ > 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 -- VoIP Embedded, Inc. http://www.voipembedded.com __________________________________________________________ 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
Hello,
you have to show how you use the function and pass the parameters to it.
Cheers, Daniel
On 04.05.21 00:27, David Villasmil wrote:
That did the trick (and adding the s.init)
$var(conid) = $(hdr(Route){nameaddr.uri}{uri.param,wsconnid}{s.int http://s.int});
Now, i understand uri.param returning and extra ">".
but now i'd really like to understand why $var(whatever) which contains "4" would result in:
ERROR: <core> [core/sr_module.c:1638]: get_int_fparam(): Could not convert PV to int ERROR: tcpops [tcpops_mod.c:374]: w_tcp_conid_state(): invalid parameter 'conid' (must be a number)
?
Regards,
David Villasmil email: david.villasmil.work@gmail.com mailto:david.villasmil.work@gmail.com phone: +34669448337
On Mon, May 3, 2021 at 11:03 PM Ovidiu Sas <osas@voipembedded.com mailto:osas@voipembedded.com> wrote:
You should try something like this: $var(wsconnid) = $(hdr(Route){nameaddr.uri}{uri.param,wsconnid}) First you need to extract the URI, and then the URI parameter. The param.value transformation is expecting a true param list, not uri or nameaddress. Regards, Ovidiu Sas On Mon, May 3, 2021 at 3:29 PM David Villasmil <david.villasmil.work@gmail.com <mailto:david.villasmil.work@gmail.com>> wrote: > > Hello guys, > > I'm possible using this wrong, but here it is; > I need to get a previously set parameter to rr, named "wsconnid": > > $var(wsconnid) = $(hdr(Route){param.value,wsconnid}) > xlog("L_ERR", "Connection ID parameter: $var(wsconnid)"); > > And i'm getting: > > May 3 19:24:45 ip-10-231-32-37 /usr/sbin/kamailio[10015]: ERROR: <script>: WS Connection ID 13> > 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 > > This is an example: > Route: <sip:10.231.32.37;r2=on;lr;wsconnid=13> > > The function is returning "13>" instead of "13". > > Thanks all, > > David Villasmil > email: david.villasmil.work@gmail.com <mailto:david.villasmil.work@gmail.com> > phone: +34669448337 > __________________________________________________________ > 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 <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users> -- VoIP Embedded, Inc. http://www.voipembedded.com <http://www.voipembedded.com> __________________________________________________________ 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 <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users>
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:
I was using it like:
$var(conid) = $(hdr(Route){uri.param,wsconnid}{s.int})
Regards,
David Villasmil email: david.villasmil.work@gmail.com phone: +34669448337
On Tue, May 4, 2021 at 7:24 AM Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
you have to show how you use the function and pass the parameters to it.
Cheers, Daniel On 04.05.21 00:27, David Villasmil wrote:
That did the trick (and adding the s.init)
$var(conid) = $(hdr(Route){nameaddr.uri}{uri.param,wsconnid}{s.int});
Now, i understand uri.param returning and extra ">".
but now i'd really like to understand why $var(whatever) which contains "4" would result in:
ERROR: <core> [core/sr_module.c:1638]: get_int_fparam(): Could not convert PV to int ERROR: tcpops [tcpops_mod.c:374]: w_tcp_conid_state(): invalid parameter 'conid' (must be a number)
?
Regards,
David Villasmil email: david.villasmil.work@gmail.com phone: +34669448337
On Mon, May 3, 2021 at 11:03 PM Ovidiu Sas osas@voipembedded.com wrote:
You should try something like this: $var(wsconnid) = $(hdr(Route){nameaddr.uri}{uri.param,wsconnid}) First you need to extract the URI, and then the URI parameter.
The param.value transformation is expecting a true param list, not uri or nameaddress.
Regards, Ovidiu Sas
On Mon, May 3, 2021 at 3:29 PM David Villasmil david.villasmil.work@gmail.com wrote:
Hello guys,
I'm possible using this wrong, but here it is; I need to get a previously set parameter to rr, named "wsconnid":
$var(wsconnid) = $(hdr(Route){param.value,wsconnid}) xlog("L_ERR", "Connection ID parameter: $var(wsconnid)");
And i'm getting:
May 3 19:24:45 ip-10-231-32-37 /usr/sbin/kamailio[10015]: ERROR:
<script>: WS Connection ID 13> > 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 > > This is an example: > Route: <sip:10.231.32.37;r2=on;lr;wsconnid=13> > > The function is returning "13>" instead of "13". > > Thanks all, > > David Villasmil > email: david.villasmil.work@gmail.com > phone: +34669448337 > __________________________________________________________ > 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 -- VoIP Embedded, Inc. http://www.voipembedded.com __________________________________________________________ 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
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:
-- Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio Advanced Training - Online May 17-20, 2021 (Europe Timezone) - June 7-10, 2021 (America Timezone)
The question was about the tcpops function, because that one printed the logs.
Cheers, Daniel
On 04.05.21 15:15, David Villasmil wrote:
I was using it like:
$var(conid) = $(hdr(Route){uri.param,wsconnid}{s.int http://s.int})
Regards,
David Villasmil email: david.villasmil.work@gmail.com mailto:david.villasmil.work@gmail.com phone: +34669448337
On Tue, May 4, 2021 at 7:24 AM Daniel-Constantin Mierla <miconda@gmail.com mailto:miconda@gmail.com> wrote:
Hello, you have to show how you use the function and pass the parameters to it. Cheers, Daniel On 04.05.21 00:27, David Villasmil wrote:
That did the trick (and adding the s.init) $var(conid) = $(hdr(Route){nameaddr.uri}{uri.param,wsconnid}{s.int <http://s.int>}); Now, i understand uri.param returning and extra ">". but now i'd really like to understand why $var(whatever) which contains "4" would result in: ERROR: <core> [core/sr_module.c:1638]: get_int_fparam(): Could not convert PV to int ERROR: tcpops [tcpops_mod.c:374]: w_tcp_conid_state(): invalid parameter 'conid' (must be a number) ? Regards, David Villasmil email: david.villasmil.work@gmail.com <mailto:david.villasmil.work@gmail.com> phone: +34669448337 On Mon, May 3, 2021 at 11:03 PM Ovidiu Sas <osas@voipembedded.com <mailto:osas@voipembedded.com>> wrote: You should try something like this: $var(wsconnid) = $(hdr(Route){nameaddr.uri}{uri.param,wsconnid}) First you need to extract the URI, and then the URI parameter. The param.value transformation is expecting a true param list, not uri or nameaddress. Regards, Ovidiu Sas On Mon, May 3, 2021 at 3:29 PM David Villasmil <david.villasmil.work@gmail.com <mailto:david.villasmil.work@gmail.com>> wrote: > > Hello guys, > > I'm possible using this wrong, but here it is; > I need to get a previously set parameter to rr, named "wsconnid": > > $var(wsconnid) = $(hdr(Route){param.value,wsconnid}) > xlog("L_ERR", "Connection ID parameter: $var(wsconnid)"); > > And i'm getting: > > May 3 19:24:45 ip-10-231-32-37 /usr/sbin/kamailio[10015]: ERROR: <script>: WS Connection ID 13> > 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 > > This is an example: > Route: <sip:10.231.32.37;r2=on;lr;wsconnid=13> > > The function is returning "13>" instead of "13". > > Thanks all, > > David Villasmil > email: david.villasmil.work@gmail.com <mailto:david.villasmil.work@gmail.com> > phone: +34669448337 > __________________________________________________________ > 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 <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users> -- VoIP Embedded, Inc. http://www.voipembedded.com <http://www.voipembedded.com> __________________________________________________________ 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 <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users> __________________________________________________________ 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 <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users>
-- Daniel-Constantin Mierla -- www.asipto.com <http://www.asipto.com> www.twitter.com/miconda <http://www.twitter.com/miconda> -- www.linkedin.com/in/miconda <http://www.linkedin.com/in/miconda> Kamailio Advanced Training - Online May 17-20, 2021 (Europe Timezone) - June 7-10, 2021 (America Timezone) * https://www.asipto.com/sw/kamailio-advanced-training-online/ <https://www.asipto.com/sw/kamailio-advanced-training-online/>
Not really, the question was about
$var(conid) = $(hdr(Route){uri.param,wsconnid})
which returns an extra ">" from:
Route: sip:10.231.32.37;r2=on;lr;wsconnid=13
if i print $var(conid) i would get:
May 3 19:24:45 ip-10-231-32-37 /usr/sbin/kamailio[10015]: ERROR: <script>: WS Connection ID 13>
But then prepending {uri.param,wsconnid} with {nameaddr.uri} and adding { s.int} did the trick, like so:
$(hdr(Route){nameaddr.uri}{uri.param,wsconnid}{s.int});
Now I understand adding {nameaddr.uri} would basically remove those "<" and ">" and that's why it then works.
Thanks Daniel and Ovidiu,
David Villasmil email: david.villasmil.work@gmail.com phone: +34669448337
On Tue, May 4, 2021 at 2:41 PM Daniel-Constantin Mierla miconda@gmail.com wrote:
The question was about the tcpops function, because that one printed the logs.
Cheers, Daniel On 04.05.21 15:15, David Villasmil wrote:
I was using it like:
$var(conid) = $(hdr(Route){uri.param,wsconnid}{s.int})
Regards,
David Villasmil email: david.villasmil.work@gmail.com phone: +34669448337
On Tue, May 4, 2021 at 7:24 AM Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
you have to show how you use the function and pass the parameters to it.
Cheers, Daniel On 04.05.21 00:27, David Villasmil wrote:
That did the trick (and adding the s.init)
$var(conid) = $(hdr(Route){nameaddr.uri}{uri.param,wsconnid}{s.int});
Now, i understand uri.param returning and extra ">".
but now i'd really like to understand why $var(whatever) which contains "4" would result in:
ERROR: <core> [core/sr_module.c:1638]: get_int_fparam(): Could not convert PV to int ERROR: tcpops [tcpops_mod.c:374]: w_tcp_conid_state(): invalid parameter 'conid' (must be a number)
?
Regards,
David Villasmil email: david.villasmil.work@gmail.com phone: +34669448337
On Mon, May 3, 2021 at 11:03 PM Ovidiu Sas osas@voipembedded.com wrote:
You should try something like this: $var(wsconnid) = $(hdr(Route){nameaddr.uri}{uri.param,wsconnid}) First you need to extract the URI, and then the URI parameter.
The param.value transformation is expecting a true param list, not uri or nameaddress.
Regards, Ovidiu Sas
On Mon, May 3, 2021 at 3:29 PM David Villasmil david.villasmil.work@gmail.com wrote:
Hello guys,
I'm possible using this wrong, but here it is; I need to get a previously set parameter to rr, named "wsconnid":
$var(wsconnid) = $(hdr(Route){param.value,wsconnid}) xlog("L_ERR", "Connection ID parameter: $var(wsconnid)");
And i'm getting:
May 3 19:24:45 ip-10-231-32-37 /usr/sbin/kamailio[10015]: ERROR:
<script>: WS Connection ID 13> > 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 > > This is an example: > Route: <sip:10.231.32.37;r2=on;lr;wsconnid=13> > > The function is returning "13>" instead of "13". > > Thanks all, > > David Villasmil > email: david.villasmil.work@gmail.com > phone: +34669448337 > __________________________________________________________ > 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 -- VoIP Embedded, Inc. http://www.voipembedded.com __________________________________________________________ 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
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:
-- Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio Advanced Training - Online May 17-20, 2021 (Europe Timezone) - June 7-10, 2021 (America Timezone)
--
Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio Advanced Training - Online May 17-20, 2021 (Europe Timezone) - June 7-10, 2021 (America Timezone)
The email written by you, to which I replied, had:
"""
but now i'd really like to understand why $var(whatever) which contains "4" would result in:
ERROR: <core> [core/sr_module.c:1638]: get_int_fparam(): Could not convert PV to int ERROR: tcpops [tcpops_mod.c:374]: w_tcp_conid_state(): invalid parameter 'conid' (must be a number)
? """
So the question/error was about tcpops function ... maybe you wanted to mean something else, or I do not understand properly ... ?!?!
Cheers, Daniel
On 04.05.21 15:53, David Villasmil wrote:
Not really, the question was about
$var(conid) = $(hdr(Route){uri.param,wsconnid})
which returns an extra ">" from:
Route: sip:10.231.32.37;r2=on;lr;wsconnid=13
if i print $var(conid) i would get:
May 3 19:24:45 ip-10-231-32-37 /usr/sbin/kamailio[10015]: ERROR:
<script>: WS Connection ID 13> But then prepending {uri.param,wsconnid} with {nameaddr.uri} and adding {s.int <http://s.int>} did the trick, like so: $(hdr(Route){nameaddr.uri}{uri.param,wsconnid}{s.int <http://s.int/>}); Now I understand adding {nameaddr.uri} would basically remove those "<" and ">" and that's why it then works. Thanks Daniel and Ovidiu, David Villasmil email: david.villasmil.work@gmail.com <mailto:david.villasmil.work@gmail.com> phone: +34669448337 On Tue, May 4, 2021 at 2:41 PM Daniel-Constantin Mierla <miconda@gmail.com <mailto:miconda@gmail.com>> wrote: The question was about the tcpops function, because that one printed the logs. Cheers, Daniel On 04.05.21 15:15, David Villasmil wrote: > I was using it like: > > $var(conid) = $(hdr(Route){uri.param,wsconnid}{s.int <http://s.int>}) > > Regards, > > David Villasmil > email: david.villasmil.work@gmail.com > <mailto:david.villasmil.work@gmail.com> > phone: +34669448337 > > > On Tue, May 4, 2021 at 7:24 AM Daniel-Constantin Mierla > <miconda@gmail.com <mailto:miconda@gmail.com>> wrote: > > Hello, > > you have to show how you use the function and pass the > parameters to it. > > Cheers, > Daniel > > On 04.05.21 00:27, David Villasmil wrote: >> That did the trick (and adding the s.init) >> >> $var(conid) = >> $(hdr(Route){nameaddr.uri}{uri.param,wsconnid}{s.int >> <http://s.int>}); >> >> Now, i understand uri.param returning and extra ">". >> >> but now i'd really like to understand why $var(whatever) >> which contains "4" would result in: >> >> ERROR: <core> [core/sr_module.c:1638]: get_int_fparam(): >> Could not convert PV to int >> ERROR: tcpops [tcpops_mod.c:374]: w_tcp_conid_state(): >> invalid parameter 'conid' (must be a number) >> >> ? >> >> >> Regards, >> >> David Villasmil >> email: david.villasmil.work@gmail.com >> <mailto:david.villasmil.work@gmail.com> >> phone: +34669448337 >> >> >> On Mon, May 3, 2021 at 11:03 PM Ovidiu Sas >> <osas@voipembedded.com <mailto:osas@voipembedded.com>> wrote: >> >> You should try something like this: >> $var(wsconnid) = >> $(hdr(Route){nameaddr.uri}{uri.param,wsconnid}) >> First you need to extract the URI, and then the URI >> parameter. >> >> The param.value transformation is expecting a true param >> list, not uri >> or nameaddress. >> >> Regards, >> Ovidiu Sas >> >> On Mon, May 3, 2021 at 3:29 PM David Villasmil >> <david.villasmil.work@gmail.com >> <mailto:david.villasmil.work@gmail.com>> wrote: >> > >> > Hello guys, >> > >> > I'm possible using this wrong, but here it is; >> > I need to get a previously set parameter to rr, named >> "wsconnid": >> > >> > $var(wsconnid) = $(hdr(Route){param.value,wsconnid}) >> > xlog("L_ERR", "Connection ID parameter: $var(wsconnid)"); >> > >> > And i'm getting: >> > >> > May 3 19:24:45 ip-10-231-32-37 >> /usr/sbin/kamailio[10015]: ERROR: <script>: WS >> Connection ID 13> >> > 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 >> > >> > This is an example: >> > Route: <sip:10.231.32.37;r2=on;lr;wsconnid=13> >> > >> > The function is returning "13>" instead of "13". >> > >> > Thanks all, >> > >> > David Villasmil >> > email: david.villasmil.work@gmail.com >> <mailto:david.villasmil.work@gmail.com> >> > phone: +34669448337 >> > __________________________________________________________ >> > 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 >> <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users> >> >> >> >> -- >> VoIP Embedded, Inc. >> http://www.voipembedded.com <http://www.voipembedded.com> >> >> __________________________________________________________ >> 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 >> <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users> >> >> >> __________________________________________________________ >> 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 <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users> > > -- > Daniel-Constantin Mierla -- www.asipto.com <http://www.asipto.com> > www.twitter.com/miconda <http://www.twitter.com/miconda> -- www.linkedin.com/in/miconda <http://www.linkedin.com/in/miconda> > Kamailio Advanced Training - Online > May 17-20, 2021 (Europe Timezone) - June 7-10, 2021 (America Timezone) > * https://www.asipto.com/sw/kamailio-advanced-training-online/ <https://www.asipto.com/sw/kamailio-advanced-training-online/> > -- Daniel-Constantin Mierla -- www.asipto.com <http://www.asipto.com> www.twitter.com/miconda <http://www.twitter.com/miconda> -- www.linkedin.com/in/miconda <http://www.linkedin.com/in/miconda> Kamailio Advanced Training - Online May 17-20, 2021 (Europe Timezone) - June 7-10, 2021 (America Timezone) * https://www.asipto.com/sw/kamailio-advanced-training-online/ <https://www.asipto.com/sw/kamailio-advanced-training-online/>
Hello Daniel,
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
$var(conid) = $(hdr(Route){uri.param,wsconnid})
Which had an extra ">" at the end.
But the problem wasn't really with the tcpops function, but with the transformation.
Thanks for taking the time to read the emails :)
Regards,
David Villasmil email: david.villasmil.work@gmail.com phone: +34669448337
On Tue, May 4, 2021 at 3:08 PM Daniel-Constantin Mierla miconda@gmail.com wrote:
The email written by you, to which I replied, had:
""" but now i'd really like to understand why $var(whatever) which contains "4" would result in:
ERROR: <core> [core/sr_module.c:1638]: get_int_fparam(): Could not convert PV to int ERROR: tcpops [tcpops_mod.c:374]: w_tcp_conid_state(): invalid parameter 'conid' (must be a number)
? """
So the question/error was about tcpops function ... maybe you wanted to mean something else, or I do not understand properly ... ?!?!
Cheers, Daniel
On 04.05.21 15:53, David Villasmil wrote:
Not really, the question was about
$var(conid) = $(hdr(Route){uri.param,wsconnid})
which returns an extra ">" from:
Route: sip:10.231.32.37;r2=on;lr;wsconnid=13
if i print $var(conid) i would get:
May 3 19:24:45 ip-10-231-32-37 /usr/sbin/kamailio[10015]: ERROR:
<script>: WS Connection ID 13> But then prepending {uri.param,wsconnid} with {nameaddr.uri} and adding { s.int} did the trick, like so: $(hdr(Route){nameaddr.uri}{uri.param,wsconnid}{s.int}); Now I understand adding {nameaddr.uri} would basically remove those "<" and ">" and that's why it then works. Thanks Daniel and Ovidiu, David Villasmil email: david.villasmil.work@gmail.com phone: +34669448337 On Tue, May 4, 2021 at 2:41 PM Daniel-Constantin Mierla <miconda@gmail.com> wrote: > The question was about the tcpops function, because that one printed the > logs. > > Cheers, > Daniel > On 04.05.21 15:15, David Villasmil wrote: > > I was using it like: > > $var(conid) = $(hdr(Route){uri.param,wsconnid}{s.int}) > > Regards, > > David Villasmil > email: david.villasmil.work@gmail.com > phone: +34669448337 > > > On Tue, May 4, 2021 at 7:24 AM Daniel-Constantin Mierla < > miconda@gmail.com> wrote: > >> Hello, >> >> you have to show how you use the function and pass the parameters to it. >> >> Cheers, >> Daniel >> On 04.05.21 00:27, David Villasmil wrote: >> >> That did the trick (and adding the s.init) >> >> $var(conid) = $(hdr(Route){nameaddr.uri}{uri.param,wsconnid}{s.int}); >> >> Now, i understand uri.param returning and extra ">". >> >> but now i'd really like to understand why $var(whatever) which contains >> "4" would result in: >> >> ERROR: <core> [core/sr_module.c:1638]: get_int_fparam(): Could not >> convert PV to int >> ERROR: tcpops [tcpops_mod.c:374]: w_tcp_conid_state(): invalid parameter >> 'conid' (must be a number) >> >> ? >> >> >> Regards, >> >> David Villasmil >> email: david.villasmil.work@gmail.com >> phone: +34669448337 >> >> >> On Mon, May 3, 2021 at 11:03 PM Ovidiu Sas <osas@voipembedded.com> >> wrote: >> >>> You should try something like this: >>> $var(wsconnid) = $(hdr(Route){nameaddr.uri}{uri.param,wsconnid}) >>> First you need to extract the URI, and then the URI parameter. >>> >>> The param.value transformation is expecting a true param list, not uri >>> or nameaddress. >>> >>> Regards, >>> Ovidiu Sas >>> >>> On Mon, May 3, 2021 at 3:29 PM David Villasmil >>> <david.villasmil.work@gmail.com> wrote: >>> > >>> > Hello guys, >>> > >>> > I'm possible using this wrong, but here it is; >>> > I need to get a previously set parameter to rr, named "wsconnid": >>> > >>> > $var(wsconnid) = $(hdr(Route){param.value,wsconnid}) >>> > xlog("L_ERR", "Connection ID parameter: $var(wsconnid)"); >>> > >>> > And i'm getting: >>> > >>> > May 3 19:24:45 ip-10-231-32-37 /usr/sbin/kamailio[10015]: ERROR: >>> <script>: WS Connection ID 13> >>> > 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 >>> > >>> > This is an example: >>> > Route: <sip:10.231.32.37;r2=on;lr;wsconnid=13> >>> > >>> > The function is returning "13>" instead of "13". >>> > >>> > Thanks all, >>> > >>> > David Villasmil >>> > email: david.villasmil.work@gmail.com >>> > phone: +34669448337 >>> > __________________________________________________________ >>> > 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 >>> >>> >>> >>> -- >>> VoIP Embedded, Inc. >>> http://www.voipembedded.com >>> >>> __________________________________________________________ >>> 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 >>> >> >> __________________________________________________________ >> 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 >> >> -- >> Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda >> Kamailio Advanced Training - Online >> May 17-20, 2021 (Europe Timezone) - June 7-10, 2021 (America Timezone) >> * https://www.asipto.com/sw/kamailio-advanced-training-online/ >> >> -- > Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda > Kamailio Advanced Training - Online > May 17-20, 2021 (Europe Timezone) - June 7-10, 2021 (America Timezone) > * https://www.asipto.com/sw/kamailio-advanced-training-online/ > > -- Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio Advanced Training - Online May 17-20, 2021 (Europe Timezone) - June 7-10, 2021 (America Timezone) * https://www.asipto.com/sw/kamailio-advanced-training-online/