← Volver al índice de módulos

ruxc

The module exports utility functions based on libruxc. Among them are function to perform HTTP GET and POST queries.
🛠️ Utilidades y Varios Kamailio 6.1 18 parámetros 9 funciones

Descripción general

The module exports utility functions based on libruxc. Among them are function to perform HTTP GET and POST queries. The ruxc project is available at: https://github.com/miconda/ruxc.

Documentación oficial: https://www.kamailio.org/docs/modules/stable/modules/ruxc.html
Código fuente: https://github.com/kamailio/kamailio/tree/master/src/modules/ruxc

Parámetros de configuración

ParámetroTipoDescripción
http_timeout int 3.2. http_timeout_connect (int) 3.3. http_timeout_read (int) 3.4. http_timeout_write (int) 3.5. http_tlsmode (int) 3.6. http_reuse (int) 3.7. http_retry (int) 3.8. http_logtype (int) 3.9. http_debug (
http_timeout_connect int 3.3. http_timeout_read (int) 3.4. http_timeout_write (int) 3.5. http_tlsmode (int) 3.6. http_reuse (int) 3.7. http_retry (int) 3.8. http_logtype (int) 3.9. http_debug (int)
http_timeout_read int 3.4. http_timeout_write (int) 3.5. http_tlsmode (int) 3.6. http_reuse (int) 3.7. http_retry (int) 3.8. http_logtype (int) 3.9. http_debug (int)
http_timeout_write int 3.5. http_tlsmode (int) 3.6. http_reuse (int) 3.7. http_retry (int) 3.8. http_logtype (int) 3.9. http_debug (int)
http_tlsmode int 3.6. http_reuse (int) 3.7. http_retry (int) 3.8. http_logtype (int) 3.9. http_debug (int)
http_reuse int 3.7. http_retry (int) 3.8. http_logtype (int) 3.9. http_debug (int)
http_retry int 3.8. http_logtype (int) 3.9. http_debug (int)
http_logtype int 3.9. http_debug (int)
http_debug int 3.1. http_timeout (int)
http_timeout int The interval in milliseconds after which the HTTP GET or POST query times out. It is the overall timeout, including DNS resolution, connecting time, redirects, and reading the response body. Slow DNS
http_timeout_connect int The interval in milliseconds after which to give up on connecting to the HTTP/S server. If http_timeout is set, this one takes precedence. The library beneath has a default 30 seconds connect timeout.
http_timeout_read int The interval in milliseconds after which the read on HTTP/S connection socket timeouts. If http_timeout is set, it takes precedence.
http_timeout_write int The interval in milliseconds after which the write on HTTP/S connection socket timeouts. If http_timeout is set, it takes precedence.
http_tlsmode int The mode to connect over TLS to HTTPS sites: 0 accept all certificates; 1 - accept trusted certificates.
http_reuse int Set to 1 in order to reuse the connection for all requests (each Kamailio process has its own connection). Useful to avoid TCP connect (and TLS handshake) when all requests are performed against the s
http_retry int How many times to retry if the HTTP request does not get a 200 OK response.
http_logtype int Set the log type for libruxc http functions: 0 - stdout; 1 - syslog.
http_debug int Set the debug mode for libruxc http functions: 0 - no debug; 1 - errors; 2 - debug.

Funciones exportadas

ruxc_http_get(url, hdrs, respv)

4.2. ruxc_http_post(url, body, hdrs, respv) 4.3. ruxc_http_delete(url, body, hdrs, respv)

ruxc_http_post(url, body, hdrs, respv)

4.3. ruxc_http_delete(url, body, hdrs, respv)

ruxc_http_delete(url, body, hdrs, respv)

4.1. ruxc_http_get(url, hdrs, respv)

ruxc_http_get(url, hdrs, respv)

Perform a HTTP GET request to "url", storing the response body in the "respv" variable. The "hdrs" can be empty string to skip setting them. The first two parameters can contain variables that are evaluated at runtime. The "respv" has to be the name

ruxc_http_get()

usage ... ruxc_http_get("http://api.com/index.php?r_uri=$(ru{s.escape.param})&f_uri=$(fu{s .escape.param})", "", "X-Token: abc", "$var(result)"); switch ($rc) { ... } ...

ruxc_http_post(url, body, hdrs, respv)

Perform a HTTP POST request to "url", storing the response body in the "respv" variable. The "body" and "hdrs" can be empty strings to skip setting them. The first three parameters can contain variables that are evaluated at runtime. The "respv" has

ruxc_http_post()

usage ... ruxc_http_post("http://api.com/index.php?r_uri=$(ru{s.escape.param})&f_uri=$(fu{ s.escape.param})", "", "X-Token: abc", "$var(result)"); switch ($rc) { ... } ...

ruxc_http_delete(url, body, hdrs, respv)

Perform a HTTP DELETE request to "url", storing the response body in the "respv" variable. The "body" and "hdrs" can be empty strings to skip setting them. The first three parameters can contain variables that are evaluated at runtime. The "respv" ha

ruxc_http_delete()

usage ... ruxc_http_delete("http://api.com/index.php?r_uri=$(ru{s.escape.param})&f_uri=$(f u{s.escape.param})", "", "X-Token: abc", "$var(result)"); switch ($rc) { ... } ...

Autores y contribuidores

Daniel-Constantin Mierla <miconda@gmail.com>

Copyright © 2021 http://www.asipto.com

Módulos relacionados

auth_web3 auth_xkeys avp avpops benchmark blst call_control call_obj