Try {s.unescape.user}

https://www.kamailio.org/wiki/cookbooks/5.5.x/transformations#sescapeuser

On Thu, Jul 14, 2022, 13:52 Benoit Panizzon <benoit.panizzon@imp.ch> wrote:
Hi List

Service Numbers, like to activate CFW probably often start with * and
end with a #

# is a special character that needs to be urlencoded in an SIP URI. So
best would be to use a generic kamailio urldecode transormation. I guess
{s.urldecode.param} is what I was looking for.

So when I get a call to the 'enable CFW' service I get

$rU =>  "*21+419999999%23"

So I want to extract the destination number and remove the urlencoded # sign.

So I do $var(cfw-dest) =
$var(cfw-dest) = $rU;
$var(cfw-dest) = $(var(cfw-dest){s.substr,3,0}); # "+419999999%23"
$var(cfw-dest) = $(var(cfw-dest){s.urldecode.param});

But now I end up with 419999999#  the + sigh disappeared.

Is this expected behavior? How would this be done the correct way?

Mit freundlichen Grüssen

-Benoît Panizzon-
--
I m p r o W a r e   A G    -    Leiter Commerce Kunden
______________________________________________________

Zurlindenstrasse 29             Tel  +41 61 826 93 00
CH-4133 Pratteln                Fax  +41 61 826 93 01
Schweiz                         Web  http://www.imp.ch
______________________________________________________

__________________________________________________________
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