[OpenSIPS-Users] opposite of {s.int} ?
Kingsley Tart
kingsley at dns99.co.uk
Thu May 13 20:21:28 EST 2021
Hi.
Is there a transformation or something else that can convert an integer
to a string? ie do the opposite of {s.int} ?
I wanted to maintain a leg sequence number (with multi-leg accounting)
with a dialog variable, but dialog variables can only contain strings.
So I did
$dlg_val(dstSeq) = "1";
at the start. But in the failure route for next endpoint, I wanted to
do this:
$var(tmp) = $(dlg_val(dstSeq){s.int}) + 1;
$dlg_val(dstSeq) = $var(tmp);
but it doesn't like assigning an integer, so I tried
$dlg_val(dstSeq) = "$var(tmp)";
but that then assigned that literal string to the dialog variable. So
then I tried
$dlg_val(dstSeq) = $var(tmp) + "";
but that complained about type mismatching, so in the end O had to do
$avp(tmp) = $var(tmp);
$dlg_val(dstSeq) = $avp(tmp);
$avp(tmp) = NULL;
which feels messy.
More information about the Users
mailing list