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 | ||
cookbooks:5.3.x:pseudovariables [2019/11/14 16:06] giavac More on http_async_client pseudovariables |
cookbooks:5.3.x:pseudovariables [2020/02/21 17:13] btriller |
||
---|---|---|---|
Line 12: | Line 12: | ||
Pseudo-Variables are implemented by various modules, most of them are provided by **pv** (if there is no special reference to a module, expect that the pseudo-variable is provided by **pv** module). | Pseudo-Variables are implemented by various modules, most of them are provided by **pv** (if there is no special reference to a module, expect that the pseudo-variable is provided by **pv** module). | ||
- | ===== Pseudo-variables usage ===== | ||
+ | |||
+ | ===== Pseudo-variables usage ===== | ||
Pseudo-variables can be used with many modules, among them: | Pseudo-variables can be used with many modules, among them: | ||
Line 447: | Line 448: | ||
**$ru** - reference to request' | **$ru** - reference to request' | ||
+ | |||
+ | INVITE <fc # | ||
<fc # | <fc # | ||
+ | |||
==== $rU - Username in R-URI ==== | ==== $rU - Username in R-URI ==== | ||
**$rU** - reference to username in request' | **$rU** - reference to username in request' | ||
+ | |||
+ | INVITE sip:<fc # | ||
<fc # | <fc # | ||
+ | |||
==== $rv - SIP message version ==== | ==== $rv - SIP message version ==== | ||
Line 575: | Line 582: | ||
**$tn** - reference to display name of ' | **$tn** - reference to display name of ' | ||
+ | |||
+ | To: "< | ||
==== $tt - To tag ==== | ==== $tt - To tag ==== | ||
Line 590: | Line 599: | ||
**$tu** - reference to URI of ' | **$tu** - reference to URI of ' | ||
+ | |||
+ | To: " | ||
==== $tU - To URI Username ==== | ==== $tU - To URI Username ==== | ||
**$tU** - reference to username in URI of ' | **$tU** - reference to username in URI of ' | ||
+ | |||
+ | To: " | ||
==== $Tb - Startup timestamp ==== | ==== $Tb - Startup timestamp ==== | ||
Line 1356: | Line 1369: | ||
The $http_req(key) write-only variable can be used to set custom parameters before sending a HTTP query. | The $http_req(key) write-only variable can be used to set custom parameters before sending a HTTP query. | ||
- | key can be one of: | + | **key** can be one of: |
* all: if set to $null, resets all the parameters to their default value (the ones defined in modparam) | * all: if set to $null, resets all the parameters to their default value (the ones defined in modparam) | ||
* hdr: sets/ | * hdr: sets/ | ||
Line 1365: | Line 1378: | ||
* tls_client_key: | * tls_client_key: | ||
* tls_ca_path: | * tls_ca_path: | ||
- | * authmethod: Sets the preferred authentication mode for HTTP/HTTPS requests. The value is a bitmap and multiple methods can be used. Note that in this case, the CURL library will make an extra request to discover server-supported authentication methods. You may want to use a specific value. | + | * authmethod: Sets the preferred authentication mode for HTTP/HTTPS requests. The value is a bitmap and multiple methods can be used. Note that in this case, the CURL library will make an extra request to discover server-supported authentication methods. You may want to use a specific value. Valid values are: |
- | + | * 1 - BASIC authentication | |
- | Valid values are: | + | * 2 - HTTP Digest authentication |
- | * 1 - BASIC authentication | + | * 4 - GSS-Negotiate authentication |
- | * 2 - HTTP Digest authentication | + | * 8 - NTLM authentication |
- | * 4 - GSS-Negotiate authentication | + | * 16 - HTTP Digest with IE flavour. |
- | * 8 - NTLM authentication | + | * (Default value is 3 - BASIC and Digest authentication.) |
- | * 16 - HTTP Digest with IE flavour | + | |
- | + | ||
- | Default value is 3 - BASIC and Digest authentication. | + | |
* username: sets the username to use for authenticated requests | * username: sets the username to use for authenticated requests | ||
* password: sets the password to use for authenticated requests | * password: sets the password to use for authenticated requests | ||
Line 1386: | Line 1395: | ||
The following read-only pseudo variables can only be used in the callback routes executed by http_async_query() | The following read-only pseudo variables can only be used in the callback routes executed by http_async_query() | ||
- | * $http_ok: 1 if cURL executed the request successfully, | + | |
- | | + | === $http_ok |
- | | + | 1 if cURL executed the request successfully, |
- | | + | |
- | | + | === $http_err |
- | | + | cURL error string if an error occurred, $null otherwise. |
- | | + | |
+ | === $http_rs | ||
+ | HTTP status. | ||
+ | |||
+ | === $http_rr | ||
+ | HTTP reason phrase. | ||
+ | |||
+ | === $http_hdr(Name) | ||
+ | Value of the Name header (the $(http_hdr(Name)[N]) syntax can also be used, check the SIP $hdr() PV documentation for details). | ||
+ | |||
+ | === $http_mb and $http_ml | ||
+ | HTTP response buffer (including headers) and length. | ||
+ | |||
+ | === $http_rb and $http_bs | ||
+ | HTTP response body and body length, | ||
===== XMLOPS Pseudo-Variables ===== | ===== XMLOPS Pseudo-Variables ===== | ||
Line 2122: | Line 2145: | ||
* version - HEP version | * version - HEP version | ||
- | * src_ip - source IP address | ||
- | * dst_ip - destination IP address | ||
* 0x000 - HEP attribute 0x000 | * 0x000 - HEP attribute 0x000 | ||
* 0x999 - HEP attribute 0x999 | * 0x999 - HEP attribute 0x999 |