%docentities; ]> &adminguide;
Overview This module collects the core pseudo-variables that can be used in configuration file. They are listed in Dokuwiki: http://www.kamailio.org/wiki/, in Pseudo-Variables section
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.
Parameters
<varname>shvset</varname> (string) Set the value of a shared variable ($shv(name)). The parameter can be set many times. The value of the parameter has the format: _name_ '=' _type_ ':' _value_ _name_: shared variable name _type_: type of the value i: integer value s: string value _value_: value to be set Default value is NULL. <varname>shvset</varname> parameter usage ... modparam("pv", "shvset", "debug=i:1") modparam("pv", "shvset", "pstngw=s:sip:10.10.10.10") ...
<varname>varset</varname> (string) Set the value of a script variable ($var(name)). The parameter can be set many times. The value of the parameter has the format: _name_ '=' _type_ ':' _value_ _name_: shared variable name _type_: type of the value i: integer value s: string value _value_: value to be set Default value is NULL. <varname>varset</varname> parameter usage ... modparam("pv", "varset", "init=i:1") modparam("pv", "varset", "gw=s:sip:11.11.11.11;transport=tcp") ...
<varname>avp_aliases</varname> (string) Define aliases for PV AVP names. Default value is NULL. <varname>avp_aliases</varname> parameter usage ... modparam("pv","avp_aliases","email=s:email_addr;tmp=i:100") ...
Functions
<function moreinfo="none">pv_isset(pvar)</function> Return true if a PV value is different than 'null'. Meaning of the parameters is as follows: pvar - pvar identifier. This function can be used from ANY_ROUTE. <function>pv_isset</function> usage ... if(pv_isset("$avp("s:x")")) { ... } ...
<function moreinfo="none">pv_unset(pvar)</function> Unset the value of the PV (e.g., delete AVP, set to null). Meaning of the parameters is as follows: pvar - pvar identifier. This function can be used from ANY_ROUTE. <function>pv_unset</function> usage ... pv_unset("$avp("s:x")"); ...
<function moreinfo="none">is_int(pvar)</function> Function checks if pvar argument contains integer value and returns 1 if it does and -1 otherwise. Function can be used from all kinds of routes. <function>is_int()</function> usage ... if (is_int("$var(foo)")) { xlog("L_INFO", "variable foo contains integer value\n"); } ...
<function moreinfo="none">typeof(pvar, vtype)</function> Returns true if the type of pseudo-variable matches the second parameter. The second parameter can be: 'int' - type is integer; 'str' - type is string; 'null' - type is null. Function can be used from ANYROUTE. <function>typeof()</function> usage ... if (typeof("$var(foo)", "str")) { xdbg("variable foo is a string\n"); } ...
<function moreinfo="none">not_empty(pvar)</function> Returns true if the pseudo-variables has the type string and is not empty value. Function can be used from all kinds of routes. <function>not_empty()</function> usage ... if (not_empty("$var(foo)")) { append_hf("X-Foo: $var(foo)\r\n"); } ...
<acronym>MI</acronym> Commands
<function moreinfo="none">shv_set</function> Set the value of a shared variable ($shv(name)). Parameters: _name_: shared variable name _type_: type of the value int: integer value str: string value _value_: value to be set MI FIFO Command Format: :shv_set:_reply_fifo_file_ _name_ _type_ _value_ _empty_line_ <function moreinfo="none">shv_set</function> usage ... $ &ctltool; fifo shv_set debug int 0 ...
<function moreinfo="none">shv_get</function> Get the value of a shared variable ($shv(name)). Parameters: _name_: shared variable name. If this parameter is missing, all shared variables are returned. MI FIFO Command Format: :shv_get:_reply_fifo_file_ _name_ _empty_line_ <function moreinfo="none">shv_get</function> usage ... $ &ctltool; fifo shv_get debug $ &ctltool; fifo shv_get ...
RPC Commands
<function moreinfo="none">pv.shvSet</function> Set the value of a shared variable ($shv(name)). Parameters: _name_: shared variable name _type_: type of the value int: integer value str: string value _value_: value to be set
<function moreinfo="none">pv.shvGet</function> Get the value of a shared variable ($shv(name)). Parameters: _name_: shared variable name If no name is given, all shared variables are listed