[OpenSIPS-Users] Finding value-less URI parameters

Bogdan-Andrei Iancu bogdan at opensips.org
Tue Mar 20 11:36:41 CET 2012


On 03/20/2012 11:58 AM, Saúl Ibarra Corretgé wrote:
> On Mar 20, 2012, at 10:52 AM, Bogdan-Andrei Iancu wrote:
>
>> Hi Saúl,
>>
>> Indeed, it seems that the URI transformation returns empty string if the requested field does not exist (specific param, etc) - I would rather say the bug is here.
>>
> Yep, returning null would make sense IMHO. But I just ran across this: "Setting a variable to NULL is actually initializing the value to integer '0'. Script variables don't have NULL value.", so if I'd store the result in a script variable I couldn't tell the difference between "sip:saul at ag-projects.com" and "sip:saul at ag-projects.com;gr=0", right? Doh.
Yes, if you choose to store the result of a transformation into a script 
var, you are screwed ....As the generic support for variables (coverring 
AVPs, script variables, pseudo vars, etc) offers the concept of NULL 
value, I think the guilt one is the implementation for script variables 
( $var() ).

But, once again, you have the option to use any other type of variable 
(or direct checking in "if" statements) for the output of the 
transformation.

Regards,
Bogdan

-- 
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com




More information about the Users mailing list