<div><div><div dir="auto">Daniel,</div></div></div><div dir="auto">Sorry, I did not see your reply as well. I struggle with mobile email! :-)</div><div dir="auto">Yes, as above I used the <a href="http://s.int">s.int</a> but was possibly looking at a more elegantly constructed methid when moving the value into the avp at the start. </div><div dir="auto">Steve</div><div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 21 May 2019 at 07:50, Stephen Bucklin <<a href="mailto:steve@telcoelectronics.uk" target="_blank">steve@telcoelectronics.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div dir="auto">Hi,</div></div><div dir="auto">I would like to set is an an integer. Forgive me as I am on mobile so this is from memory. I am getting a string using REDIS something like:</div><div dir="auto"><br></div><div dir="auto">Redis_cmd("dB","GET key:xyz","r")</div><div dir="auto"><br></div><div dir="auto">I now have some string in $redus(r=>value) say </div><div dir="auto"><br></div><div dir="auto">{"this":"that","mum":"3","other":"here"}</div><div dir="auto"><br></div><div dir="auto">I have used the jansson_get to move the value of the specific key into an AVP for use. If I move the value 3 that is keyed by "num" from the Jason into the AVP it is a string. I can use $avp(val) = $(avp(val){<a href="http://s.int" target="_blank">s.int</a>}) and that will work but was wondering if there was a more elegant solution to this?</div><div dir="auto">Just finding my way around this new landscape :-)</div><div dir="auto"><br></div><div dir="auto">Steve</div><div dir="auto"><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 20 May 2019 at 18:14, Alex Balashov <<a href="mailto:abalashov@evaristesys.com" target="_blank">abalashov@evaristesys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You want to validate that the value is an integer, or coerce the internal type of the AVP to integer?<br>
<br>
—<br>
Sent from mobile, with due apologies for brevity and errors.<br>
<br>
> On May 20, 2019, at 7:52 AM, Stephen Bucklin <<a href="mailto:steve@telcoelectronics.uk" target="_blank">steve@telcoelectronics.uk</a>> wrote:<br>
> <br>
> Hi,<br>
> Any quick thoughts. I am using a REDIS "GET" to retrieve a JSON obj as a string from REDIS and then the JANSSON get value to extract a key value from the string and pop it into an AVP ($avp(val)) and wish to ensure the value is an integer in the AVP. New to this, be kind :-)<br>
> Steve<br>
> _______________________________________________<br>
> Kamailio (SER) - Users Mailing List<br>
> <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><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>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><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></div>
</blockquote></div></div>
</div>