%docentities; ]> &adminguide;
Overview This module collects extensions from &kamailio; core. &kamailio; Core CookBook is available at: http://kamailio.org/dokuwiki/
Dependencies
&kamailio; Modules The following modules must be loaded before this module: No dependencies on other &kamailio; modules.
External Libraries or Applications The following libraries or applications must be installed before running &kamailio; with this module loaded: None.
Functions
<function moreinfo="none">setsflag(flag)</function> Set the script flag. Meaning of the parameters is as follows: flag - the index of the script flag to be set. Can be integer or pseudo-variable with integer value. This function can be used from ANY_ROUTE. <function>setsflag</function> usage ... setsflag("1"); ... $var(flag) = 11; setsflag("$var(flag)"); ...
<function moreinfo="none">issflagset(flag)</function> Return true of the script flag is set. Meaning of the parameters is as follows: flag - the index of the script flag to be tested. Can be integer or pseudo-variable with integer value. This function can be used from ANY_ROUTE. <function>issflagset</function> usage ... if(issflagset("1")) { ... } ...
<function moreinfo="none">resetsflag(flag)</function> Reset the script flag. Meaning of the parameters is as follows: flag - the index of the script flag to be reset. Can be integer or pseudo-variable with integer value. This function can be used from ANY_ROUTE. <function>resetsflag</function> usage ... resetsflag("1"); ...
<function moreinfo="none">setbflag(flag [, branch])</function> Set the branch flag. Meaning of the parameters is as follows: flag - the index of the branch flag to be set. Can be integer or pseudo-variable with integer value. branch - the index of the branch whose flag to be set. Can be integer or pseudo-variable with integer value. If omitted, then branch 0 is used (R-URI). This function can be used from ANY_ROUTE. <function>setbflag</function> usage ... setbflag("1"); ... $var(flag) = 11; setbflag("$var(flag)", "1"); ...
<function moreinfo="none">isbflagset(flag [, branch])</function> Return true of the branch flag is set. Meaning of the parameters is as follows: flag - the index of the branch flag to be tested. Can be integer or pseudo-variable with integer value. branch - the index of the branch whose flag to be set. Can be integer or pseudo-variable with integer value. If omitted, then branch 0 is used (R-URI). This function can be used from ANY_ROUTE. <function>isbflagset</function> usage ... if(isbflagset("1")) { ... } ...
<function moreinfo="none">resetbflag(flag [, branch])</function> Reset the branch flag. Meaning of the parameters is as follows: flag - the index of the branch flag to be reset. Can be integer or pseudo-variable with integer value. branch - the index of the branch whose flag to be set. Can be integer or pseudo-variable with integer value. If omitted, then branch 0 is used (R-URI). This function can be used from ANY_ROUTE. <function>resetbflag</function> usage ... resetbflag("1"); ...
<function moreinfo="none">setdsturi(uri)</function> Set the destination address URI (outbound proxy address). Meaning of the parameters is as follows: uri - Valid SIP URI representing the address where to send the request. It must be a static string, no variables are evaluated at runtime. If you need to set outbound proxy address via a variable, use assginment to $du. This function can be used from ANY_ROUTE. <function>setdsturi</function> usage ... setdsturi("sip:10.0.0.10"); ...
<function moreinfo="none">resetdsturi()</function> Reset the destination address URI (outbound proxy address). This function can be used from ANY_ROUTE. <function>resetdsturi</function> usage ... resetdsturi(); ...
<function moreinfo="none">isdsturiset()</function> Check if the destination address URI (outbound proxy address) is set. This function can be used from ANY_ROUTE. <function>isdsturiset</function> usage ... if(isdsturiset()) { ... } ...
<function moreinfo="none">pv_printf(var, str)</function> Evalues the str and sets the resulting value to variable var. For backward compatibility reasons, the same function can be executed via 'avp_printf(var, str)'. Meaning of the parameters is as follows: var - name of a writable variable str - string that may contain variables which will be evaluated at runtime. This function can be used from ANY_ROUTE. <function>pv_printf</function> usage ... pv_printf("$ru", "sip:$rU@$fd"); pv_printf("$avp(x)", "From: $fU - To: $tU"); ...
<function moreinfo="none">is_myself(uri)</function> Check if the parameter matches the 'myself' condition (i.e., is a local IP or domain). Meaning of the parameters is as follows: uri - Valid SIP URI or IP address to check against the list of local IP addresses or domains. The parameter value can contain pseudo-variables. This function can be used from ANY_ROUTE. <function>is_myself</function> usage ... if(is_myself("$fu")) { ... } ...
<function moreinfo="none">setdebug(level)</function> Set the debug log level per process. Meaning of the parameters is as follows: level - the debug log level to be set. Can be integer or pseudo-variable with integer value. This function can be used from ANY_ROUTE. <function>setdebug</function> usage ... setdebug("1"); ... $var(level) = 2; setdebug("$var(level)"); ...
<function moreinfo="none">resetdebug()</function> Reset the local debug log level back to the value of core parameter 'debug'. This function can be used from ANY_ROUTE. <function>resetdebug</function> usage ... resetdebug(); ...
<function moreinfo="none">km_append_branch([uri])</function> This function was replaced by append_branch() from corex module, starting with version 4.0.0.
MI Commands
<function moreinfo="none">arg</function> Print command line arguments. Name: arg Parameters: none. MI FIFO Command Format: :arg:_reply_fifo_file_ _empty_line_
<function moreinfo="none">kill</function> Kill the application. Name: kill Parameters: none. MI FIFO Command Format: :kill:_reply_fifo_file_ _empty_line_
<function moreinfo="none">pwd</function> Print working directory. Name: pwd Parameters: none. MI FIFO Command Format: :pwd:_reply_fifo_file_ _empty_line_
<function moreinfo="none">uptime</function> Print uptime. Name: uptime Parameters: none. MI FIFO Command Format: :uptime:_reply_fifo_file_ _empty_line_
<function moreinfo="none">version</function> Print version information. Name: version Parameters: none. MI FIFO Command Format: :version:_reply_fifo_file_ _empty_line_
<function moreinfo="none">which</function> Print list of available MI commands. Name: which Parameters: none. MI FIFO Command Format: :which:_reply_fifo_file_ _empty_line_
<function moreinfo="none">get_statistics</function> Print the list of available internal statistics. Name: get_statistics Parameters: statsid - which statistics to be printed. If set to 'all' then all statistics are printed; if set to 'statsgroup:' then all statistics in the group are printed; if set to 'statsname' then the statistics identified by the name is printed. MI FIFO Command Format: :get_statistics:_reply_fifo_file_ _statsid_ _empty_line_
<function moreinfo="none">reset_statistics</function> Reset internal statistics. Name: reset_statistics Parameters: statsid - which statistics to be reset, give as name. MI FIFO Command Format: :reset_statistics:_reply_fifo_file_ _statsid_ _empty_line_
<function moreinfo="none">clear_statistics</function> Return statistics and reset their value in one command. Name: get_statistics Parameters: statsid - same as for get_statistics. MI FIFO Command Format: :clear_statistics:_reply_fifo_file_ _statsid_ _empty_line_
RPC Commands
<function moreinfo="none">pkg.stats</function> Print private memory (pkg) usage statistics per process. It can take optinally a filter to print statistics only for a specific process or set of processes. If no filter is given, it prints statistics for all processes. The filter can be: pid value - print statistics for specific process pid. rank value - print statistics for specific process rank. index value - print statistics for specific index in process table. Examples: &sercmd; pkg.stats &sercmd; pkg.stats pid 1234 &sercmd; pkg.stats rank 1 &sercmd; pkg.stats index 10
<function moreinfo="none">stats.get_statistics</function> Print the list of available internal statistics. Parameters: statsid - which statistics to be printed. If set to 'all' then all statistics are printed; if set to 'statsgroup:' then all statistics in the group are printed; if set to 'statsname' then the statistics identified by the name is printed. Examples: &sercmd; stats.get_statistics all &sercmd; stats.get_statistics core: &sercmd; stats.get_statistics unsupported_methods &sercmd; stats.get_statistics shmem: fwd_requests fwd_replies
<function moreinfo="none">stats.reset_statistics</function> Reset internal statistics. Parameters: statsid - same as for get_statistics. Examples: &sercmd; stats.reset_statistics all &sercmd; stats.reset_statistics core: &sercmd; stats.reset_statistics unsupported_methods &sercmd; stats.reset_statistics shmem: fwd_requests fwd_replies
<function moreinfo="none">stats.clear_statistics</function> Return statistics and reset their value in one command. Parameters: statsid - same as for get_statistics. Examples: &sercmd; stats.reset_statistics all &sercmd; stats.reset_statistics core: &sercmd; stats.reset_statistics unsupported_methods &sercmd; stats.reset_statistics shmem: fwd_requests fwd_replies