Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
ref_manual:selects [2009/05/05 00:27]
janakj
ref_manual:selects [2012/05/24 21:09]
oej old revision restored
Line 112: Line 112:
  
 the test is true, when the select returns NON-EMPTY string. the test is true, when the select returns NON-EMPTY string.
 +
 +<note>
 +This way of using select is obsolete and it will generate a warning message on start-up.
 +For sip-router the if will be true only if it returns a non-empty, non-zero numerical string (e.g. "123").
 +The preferred correct ways for sip-router are:
 +
 +  if (@select.value!="")
 +
 +or
 +
 +  if (!strempty(@select.value))
 +
 +</note>
 +
  
   if (@select.value=="string") {...}   if (@select.value=="string") {...}
   if ("string"==@select.value) {...}   if ("string"==@select.value) {...}
  
-the result is true, when the select is error-free and its return value. +the result is true, when the select is error-free and its return value is equal to "string"
-Instead of constant value, you can also use values from $attribute or +Instead of constant value, you can use any expression (it could involve avps, pvars or other selects).
-@yet.another.select+
  
   if (@select.value!="string") {...}   if (@select.value!="string") {...}
Line 136: Line 149:
 obtained as select's return value. This is what you usually don't want. obtained as select's return value. This is what you usually don't want.
  
-You can also use the select as the right hand value of the attribute +You can also use the select in any kind of expression, be it in the right hand of an assignment, in an if, while() or switch().
-assignment. A new string-type attribute is created and the result value of +
-the select function call is assigned to this attribute.+
  
 +E.g.:
   $attribute=@the.select.you.want   $attribute=@the.select.you.want
  
Line 176: Line 188:
 select, just make sure you have loaded all neccessary modules. select, just make sure you have loaded all neccessary modules.
  
 +
 +===== Select List =====
 +
 +For a list with all the defined selects in the sip-router devel version (master branch), see
 +[[http://sip-router.org/docbook/sip-router/branch/master/select_list/select_list.html]].

Navigation

Wiki

Other

QR Code
QR Code ref_manual:selects (generated for current page)