User Tools

Site Tools


cookbooks:4.3.x:pseudovariables

Differences

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

Link to this comparison view

Next revision
Previous revision
cookbooks:4.3.x:pseudovariables [2015/06/03 13:09]
miconda created
cookbooks:4.3.x:pseudovariables [2016/02/05 11:44] (current)
oej [$uac_req(key)]
Line 1: Line 1:
 +{{ :cookbooks:4.3.x:pseudovariables.png?200|}}
 ====== Kamailio SIP Server v4.3.x (stable): Pseudo-Variables ====== ====== Kamailio SIP Server v4.3.x (stable): Pseudo-Variables ======
  
Line 152: Line 153:
 ==== $ci - Call-Id ==== ==== $ci - Call-Id ====
  
-**$ci** - reference to body of call-id header+**$ci** - reference to body of call-id header (R/O)
  
 ==== $cl - Content-Length ==== ==== $cl - Content-Length ====
Line 614: Line 615:
 It is R/W variable (you can assign values to it directly in configuration file). It is R/W variable (you can assign values to it directly in configuration file).
  
 +===== $expires(key) - Expires Values =====
 +
 +Return the min and max of expires value for current SIP message. Contact headers are checked with higher priority, if no expires parameter there, then Expires header is used
 +
 +If none is found, $null is returned.
 +
 +Possible 'key' values:
 +
 +  * $expires(min) - the minimum value for expires
 +  * $expires(max) - the maximum value for expires
 +
 +When there is only one expires value, then min and max return the same.
 +
 +Example of usage:
 +
 +<code c>
 +if($expires(max)!=$null) {
 +    xlog("max expires value is: $expires(max)\n");
 +}
 +</code>
 ===== $xavp(id) - XAVPs ===== ===== $xavp(id) - XAVPs =====
  
Line 893: Line 914:
  
 The 'key' can be any string. The 'key' can be any string.
 +
 +===== Erlang module Pseudo-Variables =====
 +
 +==== Erlang pseudo-variable attributes ===
 +
 +* type - get variable type. Possible types are: atom, integer, list, string, tuple, pid and ref.
 +
 +* length - get length of list or tuple.
 +
 +* format - prints a term, in clear text. It tries to resemble the term printing in the Erlang shell.
 +
 +==== $erl_atom(name) ====
 +//$erl_atom(name)// pseudo variable allows create analog to Erlang atom data type.
 +Erlang atom is a literal, a constant with name. Formatted output pseudo variable
 +atom could be enclosed in single quotes (') if it does not begin with a 
 +lower-case letter or if it contains other characters than alphanumeric characters,
 +underscore (_), or @.
 +
 +Example:
 +
 +<code c>
 +$erl_atom(A) = "node@host.tld";
 +
 +xlogl("L_DEBUG","$$erl_atom(A): $erl_atom(A=>format)\n");
 +</code>
 +
 +==== $erl_list(name) ====
 +Compound data type with a variable number of terms. Formally, a list is either
 +the empty list [] or consists of one or more elements.
 +
 +Example:
 +
 +<code c>
 +$erl_atom(E) = "example";
 +$erl_list(L) = "list";
 +$erl_list(L) = "of";
 +$erl_list(L) = $erl_atom(E);
 +
 +xlogl("L_DEBUG","length(L): $erl_list(L=>length), format(L): $erl_list(L=>format)\n");
 +
 +# empty list
 +$erl_tuple(E[*]) = $null;
 +</code>
 +
 +==== $erl_tuple(name) ====
 +From the Erlang point of view the tuple compound data type with a fixed number
 +of terms. The module implementation of tuple has the same behavior as the list.
 +
 +Example:
 +
 +<code c>
 +$erl_atom(e) = "error";
 +
 +$erl_tuple(T) = "badrpc";
 +$erl_tuple(T) = $erl_atom(e);
 +
 +xlogl("L_DEBUG","length(T): $erl_tuple(T=>length), format(T): $erl_tuple(T=>format)\n");
 +</code>
 +
 +==== $erl_pid(name) ====
 +Holds Eralng process identifier. Provides access to Erlang PID value and could
 +be used in send message.
 +
 +==== $erl_ref(name) ====
 +Holds Erlang reference. Provides access to reference value and could be used in
 +send message.
 +
 +==== $erl_xbuff(name) ====
 +Generic pseudo variable to acts as other pseudo variables exported from Erlang
 +module.
  
 ===== HTable module Pseudo-Variables ===== ===== HTable module Pseudo-Variables =====
Line 1215: Line 1306:
 <code c> <code c>
 $uac_req(method)="OPTIONS"; $uac_req(method)="OPTIONS";
-$uac_req(ruri)="sip:kamailio.org"; +$uac_req(ruri)="sip:alice@kamailio.org"; 
-$uac_req(furi)="sip:kamailio.org"; +$uac_req(turi)="sip:alice@kamailio.org"; 
-$uac_req(turi)="sip:kamailio.org";+$uac_req(furi)="sip:daniel@kamailio.org";
 $uac_req(evroute) = 1; $uac_req(evroute) = 1;
 uac_req_send(); uac_req_send();
Line 1316: Line 1407:
  
 </code> </code>
 +
  
 ===== TLS module Pseudo-Variables ===== ===== TLS module Pseudo-Variables =====
  
 ==== $tls_version ==== ==== $tls_version ====
 +The TLS/SSL version which is used on the TLS connection from which the message was received. String type.
 ==== $tls_description ==== ==== $tls_description ====
 +The TLS/SSL description of the TLS connection from which the message was received. String type.
 ==== $tls_cipher_info ==== ==== $tls_cipher_info ====
 +The TLS/SSL cipher which is used on the TLS connection from which the message was received. String type.
 ==== $tls_cipher_bits ==== ==== $tls_cipher_bits ====
 +The number of cipher bits which are used on the TLS connection from which the message was received. String and Integer type.
 ==== $tls_peer_version ==== ==== $tls_peer_version ====
 +The version of the certificate. String type.
 ==== $tls_my_version ==== ==== $tls_my_version ====
 +The version of the certificate. String type.
 ==== $tls_peer_serial ==== ==== $tls_peer_serial ====
 +The serial number of the certificate. String and Integer type.
 ==== $tls_my_serial ==== ==== $tls_my_serial ====
 +The serial number of the certificate. String and Integer type.
 ==== $tls_peer_subject ==== ==== $tls_peer_subject ====
 +ASCII dump of the fields in the subject section of the certificate. String type. Example:
 +    /C=AT/ST=Vienna/L=Vienna/O=enum.at/CN=enum.at
 ==== $tls_peer_issuer ==== ==== $tls_peer_issuer ====
 +ASCII dump of the fields in the issuer section of the certificate. String type.
 ==== $tls_my_subject ==== ==== $tls_my_subject ====
 +ASCII dump of the fields in the subject section of the certificate. String type.
 ==== $tls_my_issuer ==== ==== $tls_my_issuer ====
 +ASCII dump of the fields in the issuer section of the certificate. String type.
 ==== $tls_peer_subject_cn ==== ==== $tls_peer_subject_cn ====
 +commonName in the subject section of the certificate. String type.
 ==== $tls_peer_issuer_cn ==== ==== $tls_peer_issuer_cn ====
 +commonName in the issuer section of the certificate. String type.
 ==== $tls_my_subject_cn ==== ==== $tls_my_subject_cn ====
 +commonName in the subject section of the certificate. String type.
 ==== $tls_my_issuer_cn ==== ==== $tls_my_issuer_cn ====
 +commonName in the issuer section of the certificate. String type.
 ==== $tls_peer_subject_locality ==== ==== $tls_peer_subject_locality ====
 +localityName in the subject section of the certificate. String type.
 ==== $tls_peer_issuer_locality ==== ==== $tls_peer_issuer_locality ====
 +localityName in the issuer section of the certificate. String type.
 ==== $tls_my_subject_locality ==== ==== $tls_my_subject_locality ====
 +localityName in the subject section of the certificate. String type.
 ==== $tls_my_issuer_locality ==== ==== $tls_my_issuer_locality ====
 +localityName in the issuer section of the certificate. String type.
 ==== $tls_peer_subject_country ==== ==== $tls_peer_subject_country ====
 +countryName in the subject section of the certificate. String type.
 ==== $tls_peer_issuer_country ==== ==== $tls_peer_issuer_country ====
 +countryName in the issuer section of the certificate. String type.
 ==== $tls_my_subject_country ==== ==== $tls_my_subject_country ====
 +countryName in the subject section of the certificate. String type.
 ==== $tls_my_issuer_country ==== ==== $tls_my_issuer_country ====
 +countryName in the issuer section of the certificate. String type.
 ==== $tls_peer_subject_state ==== ==== $tls_peer_subject_state ====
 +stateOrProvinceName in the subject section of the certificate. String type.
 ==== $tls_peer_issuer_state ==== ==== $tls_peer_issuer_state ====
 +stateOrProvinceName in the issuer section of the certificate. String type.
 ==== $tls_my_subject_state ==== ==== $tls_my_subject_state ====
 +stateOrProvinceName in the subject section of the certificate. String type.
 ==== $tls_my_issuer_state ==== ==== $tls_my_issuer_state ====
 +stateOrProvinceName in the issuer section of the certificate. String type.
 ==== $tls_peer_subject_organization ==== ==== $tls_peer_subject_organization ====
 +organizationName in the subject section of the certificate. String type.
 ==== $tls_peer_issuer_organization ==== ==== $tls_peer_issuer_organization ====
 +organizationName in the issuer section of the certificate. String type.
 ==== $tls_my_subject_organization ==== ==== $tls_my_subject_organization ====
 +organizationName in the subject section of the certificate. String type.
 ==== $tls_my_issuer_organization ==== ==== $tls_my_issuer_organization ====
 +organizationName in the issuer section of the certificate. String type.
 ==== $tls_peer_subject_unit ==== ==== $tls_peer_subject_unit ====
 +organizationalUnitName in the subject section of the certificate. String type.
 ==== $tls_peer_issuer_unit ==== ==== $tls_peer_issuer_unit ====
 +organizationalUnitName in the issuer section of the certificate. String type.
 ==== $tls_my_subject_unit ==== ==== $tls_my_subject_unit ====
 +organizationalUnitName in the subject section of the certificate. String type.
 ==== $tls_my_issuer_unit ==== ==== $tls_my_issuer_unit ====
 +organizationalUnitName in the issuer section of the certificate. String type.
 ==== $tls_peer_san_email ==== ==== $tls_peer_san_email ====
 +email address in the "subject alternative name" extension. String type.
 ==== $tls_my_san_email ==== ==== $tls_my_san_email ====
 +email address in the "subject alternative name" extension. String type.
 ==== $tls_peer_san_hostname ==== ==== $tls_peer_san_hostname ====
 +hostname (DNS) in the "subject alternative name" extension. String type.
 ==== $tls_my_san_hostname ==== ==== $tls_my_san_hostname ====
 +hostname (DNS) in the "subject alternative name" extension. String type.
 ==== $tls_peer_san_uri ==== ==== $tls_peer_san_uri ====
 +URI in the "subject alternative name" extension. String type.
 ==== $tls_my_san_uri ==== ==== $tls_my_san_uri ====
 +URI in the "subject alternative name" extension. String type.
 ==== $tls_peer_san_ip ==== ==== $tls_peer_san_ip ====
 +ip address in the "subject alternative name" extension. String type.
 ==== $tls_my_san_ip ==== ==== $tls_my_san_ip ====
 +ip address in the "subject alternative name" extension. String type.
  
 ===== XHTTP module Pseudo-Variables ===== ===== XHTTP module Pseudo-Variables =====
Line 1468: Line 1605:
 The key can be: The key can be:
  
-* line - return current line in config +  * line - return current line in config 
-* name - return the name of current config file+  * name - return the name of current config file
  
 Example: Example:
cookbooks/4.3.x/pseudovariables.1433329746.txt.gz · Last modified: 2015/06/03 13:09 by miconda