Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
ref_manual:selects [2009/05/04 22:27] – janakj | ref_manual:selects [2012/05/24 19:17] (current) – oej | ||
---|---|---|---|
Line 4: | Line 4: | ||
You might ask, why the select framework was introduced at all? The main reason | You might ask, why the select framework was introduced at all? The main reason | ||
was that everytime you wanted to check any part (header, etc.) of the | was that everytime you wanted to check any part (header, etc.) of the | ||
- | incomming | + | incoming |
Moreover this function (due to historic limitations) might get at most two | Moreover this function (due to historic limitations) might get at most two | ||
parameters. If you need more you have to use workaround and set attributes | parameters. If you need more you have to use workaround and set attributes | ||
Line 39: | Line 39: | ||
text with the select identifier, so it must be enclosed in double quotes.) | text with the select identifier, so it must be enclosed in double quotes.) | ||
Xlog formatting also support selects as a element while composing the final | Xlog formatting also support selects as a element while composing the final | ||
- | value - the formatting element is '' | + | value - the formatting element is '' |
Return value of the select is text string, but be aware, it might be also | Return value of the select is text string, but be aware, it might be also | ||
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. | ||
+ | |||
+ | < | ||
+ | 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. " | ||
+ | The preferred correct ways for sip-router are: | ||
+ | |||
+ | if (@select.value!="" | ||
+ | |||
+ | or | ||
+ | |||
+ | if (!strempty(@select.value)) | ||
+ | |||
+ | </ | ||
+ | |||
if (@select.value==" | if (@select.value==" | ||
if (" | if (" | ||
- | 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 " |
- | Instead of constant value, you can also use values from $attribute | + | Instead of a constant value, you can use any expression (it could involve avps, pvars or other selects). |
- | @yet.another.select | + | |
if (@select.value!=" | if (@select.value!=" | ||
Line 136: | Line 149: | ||
obtained as select' | obtained as select' | ||
- | You can also use the select | + | You can also use the select |
- | 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:// |