User Tools

Site Tools


cookbooks:devel:pseudovariables

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
cookbooks:devel:pseudovariables [2021/07/27 15:51]
miconda [$rpl(key)]
cookbooks:devel:pseudovariables [2022/03/22 16:52]
miconda [$Rp - Received port]
Line 171: Line 171:
 <code c> <code c>
 xlog("$$avp(x) fount $cnt($avp(x)) times\n"); xlog("$$avp(x) fount $cnt($avp(x)) times\n");
 +</code>
 +
 +**$cnt(xavp)** - return the number of xavps
 +
 +<code>
 + * $cnt($xavp(key[*])) : number of XAVPs "key".
 + * $cnt($xavp(key[n]=>sub[*])) : number of children "sub" in XAVP "key[n]".
 + * $cnt($xavp(key[*]=>sub[*])) : total number of children "sub" in all XAVPs "key".
 +
 + * $cnt($xavp(key[n])) : 1 or 0 (if this index exists or not).
 + * $cnt($xavp(key[-n])) : same but with reverse indexing (-1 is the last index).
 +
 + * $cnt($xavp(key[*]=>sub[n])) : number of children "sub[n]" that exist in all XAPVs "key".
 +
 + * $cnt($xavp(key)) is the same as $cnt($xavp(key[*])).
 + * $cnt($xavp(key=>sub)) is the same as $cnt($xavp(key[*]=>sub[*]))
 </code> </code>
 ==== $conid - TCP Connection ID ==== ==== $conid - TCP Connection ID ====
Line 564: Line 580:
  
 **$Rp** - reference to the port where the message was received **$Rp** - reference to the port where the message was received
 +
 +==== $Rn - Received socket name ====
 +
 +**$Rn** - reference to the name of the socket where the message was received
  
 ==== $RAu - Advertised socket URI ==== ==== $RAu - Advertised socket URI ====
Line 1199: Line 1219:
 } }
 </code> </code>
 +===== Header Field Iterator =====
 +
 +==== $hfitname(iname) ====
 +
 +The header name of the header field iterator.
 +
 +Example:
 +
 +<code c>
 +    hf_iterator_start("i1");
 +    while(hf_iterator_next("i1")) {
 +        xlog("hdr[$hfitname(i1)] is: $hfitbody(i1)\n");
 +    }
 +    hf_iterator_end("i1");
 +</code>
 +
 +==== $hfitbody(iname) ====
 +
 +The header body of the header field iterator.
 +
 +Example:
 +
 +<code c>
 +    hf_iterator_start("i1");
 +    while(hf_iterator_next("i1")) {
 +        xlog("hdr[$hfitname(i1)] is: $hfitbody(i1)\n");
 +    }
 +    hf_iterator_end("i1");
 +</code>
 +
 +===== Body Line Iterator =====
 +
 +==== $blitval(iname) ====
 +
 +The value of the body line iterator.
 +
 +Example:
 +
 +<code c>
 +    bl_iterator_start("b1");
 +    while(bl_iterator_next("b1")) {
 +        xlog("body line: $blitval(b1)");
 +    }
 +    bl_iterator_end("b1");
 +</code>
 +
 +
 ===== Send Data Attributes ===== ===== Send Data Attributes =====
  
Line 1843: Line 1910:
   * hdrs - SIP Headers   * hdrs - SIP Headers
   * body - Body   * body - Body
 +  * flags - flags for processing
 +    * 1 - the password is provided in HA1 format
   * auser - authentication username   * auser - authentication username
   * apasswd - authentication password   * apasswd - authentication password
Line 2009: Line 2078:
  
 ===== TLS Module ===== ===== TLS Module =====
 +
 +==== $tls(key) ====
 +
 +Variables related to TLS communication and certificates.
 +
 +The **key** can be:
 +
 +  * **m_issuer_line** - return local (my) certificate issuer line
 +  * **p_issuer_line** - return remote (peer) certificate issuer line
 +  * **m_subject_line** - return local (my) certificate subject line
 +  * **p_subject_line** - return remote (peer) certificate subject line
 +
 +Example:
 +
 +<code c>
 +if(proto==TLS) {
 +    xinfo("local certificate subject: $tls(m_subject_line)\n");
 +}
 +</code>
  
 ==== $tls_version ==== ==== $tls_version ====
 +
 The TLS/SSL version which is used on the TLS connection from which the message was received. String type. The TLS/SSL version which is used on the TLS connection from which the message was received. String type.
 ==== $tls_description ==== ==== $tls_description ====
Line 2146: Line 2235:
   * $msg(body) - sip message body   * $msg(body) - sip message body
   * $msg(body_len) - sip message body length   * $msg(body_len) - sip message body length
-  * $msg(hdrs) - sip message headers +  * $msg(hdrs) - sip message headers (surrounding white space and EoL chars trimmed) 
-  * $msg(fline) - sip message first line+  * $msg(fline) - sip message first line (surrounding white space and EoL chars trimmed) 
 +  * $msg(fpart) - sip message first line and the headers 
 +  * $msg(lpart) - sip message headers and the body 
 +===== POSOPS Module ===== 
 + 
 +==== $pos(key) ==== 
 + 
 +Get attributes after a function of the module is executed. 
 + 
 +The key can be: 
 + 
 +  * ret - the return code on success or -1 
 +  * idx - position inside message buffer, for find/search it is the start of matching 
 +  * len - the length of matching string for search functions
  
 ===== XHTTP Module ===== ===== XHTTP Module =====
Line 2347: Line 2449:
   * 2 charge   * 2 charge
   * 3 spare   * 3 spare
 +
 +
 +==== $sipt(redirection_info) / $sipt_redirection_info ===
 +Returns the value of the Redirecting reason of the Call Diversion Information header from ISUP. 
 +Returns -1 if there is a parsing error or if the Call Diversion Information is not present.
 +
 +Can return the following values:
 +
 +  * 0 Unknown
 +  * 1 User busy
 +  * 2 no reply
 +  * 3 unconditional
 +  * 4 deflection during alerting
 +  * 5 deflection immediate response
 +  * 6 mobile subscriber not reachable
 +
 +
 +==== $sipt(redirection_number) / $sipt_redirection_number ===
 +Returns the value (Address signal) of the Redirection Number.
 +Returns -1 if there is a parsing error or if the Redirection Number is not present.
 +
 +Example:
 +<code c>
 +# get the redirection number
 +$avp(s:redir_num) = $sipt(redirection_number);
 +</code>
 +
 +
 +==== $sipt(redirection_number.nai) / $sipt_redirection_number_nai ===
 +Returns the value of the Nature of Address Indicator of the Redirection Number. Returns -1 if there is a parsing error or if the Redirection Number is not present.
 +
 +Can return the following values:
 +
 +  * 0 Spare
 +  * 1 Subscriber Number (national use)
 +  * 2 Unknown (national use)
 +  * 3 National (significant) number
 +  * 4 International use
 +
 +
 +==== $sipt(calling_party_number) ===
 +Returns the value (Address signal) of the Calling Party for the IAM message.
 +Returns -1 if there is a parsing error or if the Calling Party Number is not present.
 +
 +
 +==== $sipt(called_party_number) ===
 +Returns the value (Address signal) of the Called Party for the IAM message.
 +Returns -1 if there is a parsing error or if the Called Party Number is not present.
 +
 +
 +==== $sipt(sipt_redirection_information_reason) ===
 +Returns the value of the Redirection reason of the Redirection information header from ISUP. 
 +Returns -1 if there is a parsing error or if the Redirection information is not present.
 +
 +
 +==== $sipt(sipt_redirection_information_original_reason) ===
 +Returns the value of the Original Redirection reason of the Redirection information header from ISUP. 
 +Returns -1 if there is a parsing error or if the Redirection information is not present.
 +
 +
 +==== $sipt(redirecting_number.nai) ===
 +Returns the value of the Nature of Address Indicator of the Redirecting Number. Returns -1 if there is a parsing error or if the Redirecting Number is not present.
 +
 +Can return the following values:
 +
 +  * 0 Spare
 +  * 1 Subscriber Number (national use)
 +  * 2 Unknown (national use)
 +  * 3 National (significant) number
 +  * 4 International use
 +
 +
 +==== $sipt(redirecting_number) ===
 +Returns the value (Address signal) of the Redirecting Number for the IAM message.
 +Returns -1 if there is a parsing error or if the Redirecting Number is not present.
 +
 +
 +==== $sipt(original_called_number.nai) ===
 +Returns the value of the Nature of Address Indicator of the Original Called Number. Returns -1 if there is a parsing error or if the Original Called Number is not present.
 +
 +Can return the following values:
 +
 +  * 0 Spare
 +  * 1 Subscriber Number (national use)
 +  * 2 Unknown (national use)
 +  * 3 National (significant) number
 +  * 4 International use
 +
 +
 +==== $sipt(original_called_number) ===
 +Returns the value (Address signal) of the Original Called Number for the IAM message.
 +Returns -1 if there is a parsing error or if the Original Called Number is not present.
 +
 +
 +==== $sipt(generic_number.nai) ===
 +Returns the value of the Nature of Address Indicator of the Generic Number. Returns -1 if there is a parsing error or if the Generic Number is not present.
 +
 +Can return the following values:
 +
 +  * 0 Spare
 +  * 1 Subscriber Number (national use)
 +  * 2 Unknown (national use)
 +  * 3 National (significant) number
 +  * 4 International use
 +
 +
 +==== $sipt(generic_number) ===
 +Returns the value (Address signal) of the Generic Number for the IAM message.
 +Returns -1 if there is a parsing error or if the Generic Number is not present.
  
  
cookbooks/devel/pseudovariables.txt · Last modified: 2022/04/11 15:24 by henningw