This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
tutorials:faq:main [2020/10/15 08:31] miconda |
tutorials:faq:main [2021/04/03 13:18] s.safarov_gmail.com |
||
---|---|---|---|
Line 51: | Line 51: | ||
But note that many global parameters can be changed via RPC/MI commands without restart (e.g., TCP connecting timeout, debug level). Applying changes related to loaded modules or routing block require always a restart. | But note that many global parameters can be changed via RPC/MI commands without restart (e.g., TCP connecting timeout, debug level). Applying changes related to loaded modules or routing block require always a restart. | ||
- | If you use a KEMI scripting language (Lua, Python, JavaScript, Squirrel), then you can reload the routing logic script without restarting Kamailio by issuing an RPC command (see KEMI interpreter modules documentation for more details: app_lua, app_python, app_python3, | + | If you use a KEMI scripting language (Lua, Python, JavaScript, Ruby, Squirrel), then you can reload the routing logic script without restarting Kamailio by issuing an RPC command (see KEMI interpreter modules documentation for more details: app_lua, app_python, app_python3, |
??? What is the license of Kamailio? | ??? What is the license of Kamailio? | ||
Line 217: | Line 217: | ||
<code c> | <code c> | ||
- | $xavp(fU) = " | + | $xavp(fuser) = " |
... | ... | ||
- | $xavp(fU[0]) = " | + | $xavp(fuser[0]) = " |
... | ... | ||
- | $fU = $xavp(fU); | + | $fU = $xavp(fuser); |
</ | </ | ||
Line 606: | Line 606: | ||
However, if return code is 0, the next action after function() is not executed. It can be used only of positive or negative response code. | However, if return code is 0, the next action after function() is not executed. It can be used only of positive or negative response code. | ||
+ | |||
+ | On the other hand, the pseudo-variables (including $rc) have to be compared as an integer, the rules for evaluating return code of the functions do not apply, for example: | ||
+ | |||
+ | <code c> | ||
+ | $var(x) = 0; | ||
+ | if($var(x) == 0) { | ||
+ | # do something | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | To compare the return code of a function with a number is recommended to use the value stored in $rc, because the priority of the operators can convert function return code to internal-true or internal-false. Therefore the next approach should be used: | ||
+ | |||
+ | <code c> | ||
+ | function_returns_four(); | ||
+ | $var(rc4) = $rc; | ||
+ | if($var(rc4)==4) { | ||
+ | # it goes here | ||
+ | } else { | ||
+ | # it doesn' | ||
+ | } | ||
+ | ... | ||
+ | function_returns_two(); | ||
+ | $var(rc2) = $rc; | ||
+ | if($var(rc4)==$var(rc2)) { | ||
+ | # it doesn' | ||
+ | } else { | ||
+ | # it goes here | ||
+ | } | ||
+ | ... | ||
+ | if (function_returns_four() && $rc ieq 6 ) { | ||
+ | # it doesn' | ||
+ | } else if ($rc ieq 4) { | ||
+ | # it goes here | ||
+ | } else { | ||
+ | # it doesn' | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Note that $rc is overwritten by a new function call, therefore store its value in another variable (like $var(...)) if it is needed for longer time. | ||
+ | |||
+ | For pseudo-variables, | ||
+ | |||
+ | <code c> | ||
+ | $var(x) = 1; | ||
+ | if($var(x)) { | ||
+ | # do something | ||
+ | } | ||
+ | </ | ||
??? How is the SIP request retransmission handled? | ??? How is the SIP request retransmission handled? |