[SR-Users] Check for existence of URI param

Alex Balashov abalashov at evaristesys.com
Mon Jun 28 12:54:00 CEST 2010


Greetings,

I have a Contact URI with params as in the following form returned to 
me in a 302 Moved Temporarily reply:

     <sip:a=foo;b;c=bar>

I am able to check the existence of parameters 'a' and 'b', which have 
values assigned to them, in the following way:

     failure_route[...] {
             ...
             $var(dest) = $T_rpl($ct);
             $var(dest) = $(var(dest){nameaddr.uri});
             $var(dest) = $(var(dest){uri.user});
             ...
             if(! $(var(dest){param.value,a})) {
                     ....
             }
             ...
     }

However, what I cannot seem to figure out is a reliable test condition 
for the existence of a parameter like 'b', which does not have a 
value.  I have tried:

     if(! $(var(dest){param.value,b}))

which clearly cannot work as the parameter has no _value_.

Also have tried:

     if(!defined $(var(dest){param.value,b}))

and also tests of strempty(), !defined, etc. for 
$var(dest){uri.param,b}) (prior to extraction of param list using 
{uri.user} above).

Ideas appreciated, thanks!

-- 
Alex Balashov - Principal
Evariste Systems LLC
1170 Peachtree Street
12th Floor, Suite 1200
Atlanta, GA 30309
Tel: +1-678-954-0670
Fax: +1-404-961-1892
Web: http://www.evaristesys.com/



More information about the sr-users mailing list