[SR-Users] Kamailio transformation

Daniel Tryba d.tryba at pocos.nl
Mon Jun 22 16:16:29 CEST 2015


On Monday 22 June 2015 13:58:28 Ali Taher wrote:
> I tried $var(pref)= $(var(a){s.select,0,#}); but I'm getting the whole
> string if # doesn't exists.
> 
> There is a way to check if # exists by subtracting  the  length of the
> string  before and after removing # character and check if length changes ,
> but I want a cost-less method.

So just check for:
$var(pref)= $(var(a){s.select,0,#});
if($var(pref)==$var(a))
{
 var(pref)="";
}

This would cost near to nothing.



More information about the sr-users mailing list