[OpenSER-Devel] transformations

Dan Pascu dan at ag-projects.com
Tue Dec 18 21:15:45 UTC 2007


The transformations docs say that they can be cascaded. However in 
practice this doesn't work very well. If a transformation returns no 
result or an empty string, the next transformation will fail. This means 
in practice that one has to execute them one by one and test in between 
if the previous has returned something and non-empty.

Consider this example:

$var(x) = "sip:1.2.3.4:5060;p1=;p2=7";
$avp(s:y) = $(var(x){uri.param,p1}{s.unescape.user});
$avp(s:z) = $(var(x){uri.param,p3}{s.unescape.user});

Both will fail as after the first transformation the result is an empty 
string. While I'm at this, I also find it unintuitive that asking for an 
unexisting param in an uri will yield an avp containing an empty string. 
I would rather expect an undefined avp, otherwise how to distinguish 
between the case where the param doesn't exist from the case where it 
contains an empty string (p1 vs p3)?

This issue is similar with the one that gives an error if the avp/hdr on 
the right side of a statement is undefined or the one that doesn't allow 
undefined avps in boolean tests.

-- 
Dan



More information about the Devel mailing list