Browse code

modules: readme files regenerated - ruxc ... [skip ci]

Kamailio Dev authored on 26/08/2021 09:16:25
Showing 1 changed files
... ...
@@ -40,6 +40,7 @@ Daniel-Constantin Mierla
40 40
 
41 41
               4.1. ruxc_http_get(url, hdrs, respv)
42 42
               4.2. ruxc_http_post(url, body, hdrs, respv)
43
+              4.3. ruxc_http_delete(url, body, hdrs, respv)
43 44
 
44 45
         5. Installation
45 46
 
... ...
@@ -56,7 +57,8 @@ Daniel-Constantin Mierla
56 57
    1.9. Set http_debug parameter
57 58
    1.10. ruxc_http_get() usage
58 59
    1.11. ruxc_http_post() usage
59
-   1.12. Libruxc Usage
60
+   1.12. ruxc_http_delete() usage
61
+   1.13. Libruxc Usage
60 62
 
61 63
 Chapter 1. Admin Guide
62 64
 
... ...
@@ -84,6 +86,7 @@ Chapter 1. Admin Guide
84 86
 
85 87
         4.1. ruxc_http_get(url, hdrs, respv)
86 88
         4.2. ruxc_http_post(url, body, hdrs, respv)
89
+        4.3. ruxc_http_delete(url, body, hdrs, respv)
87 90
 
88 91
    5. Installation
89 92
 
... ...
@@ -256,6 +259,7 @@ modparam("ruxc", "http_debug", 1)
256 259
 
257 260
    4.1. ruxc_http_get(url, hdrs, respv)
258 261
    4.2. ruxc_http_post(url, body, hdrs, respv)
262
+   4.3. ruxc_http_delete(url, body, hdrs, respv)
259 263
 
260 264
 4.1.  ruxc_http_get(url, hdrs, respv)
261 265
 
... ...
@@ -302,6 +306,29 @@ switch ($rc) {
302 306
 }
303 307
 ...
304 308
 
309
+4.3.  ruxc_http_delete(url, body, hdrs, respv)
310
+
311
+   Perform a HTTP DELETE request to "url", storing the response body in
312
+   the "respv" variable. The "body" and "hdrs" can be empty strings to
313
+   skip setting them. The first three parameters can contain variables
314
+   that are evaluated at runtime. The "respv" has to be the name of a
315
+   writable variable.
316
+
317
+   The function returns response code of HTTP reply or negative value if
318
+   something went wrong.
319
+
320
+   This function can be used from ANY_ROUTE.
321
+
322
+   Example 1.12. ruxc_http_delete() usage
323
+...
324
+ruxc_http_delete("http://api.com/index.php?r_uri=$(ru{s.escape.param})&f_uri=$(f
325
+u{s.escape.param})",
326
+           "", "X-Token: abc", "$var(result)");
327
+switch ($rc) {
328
+    ...
329
+}
330
+...
331
+
305 332
 5. Installation
306 333
 
307 334
    The module needs "libruxc" library, which is provided by "ruxc" project
... ...
@@ -315,7 +342,7 @@ switch ($rc) {
315 342
    installed and its environment configured, then run the following
316 343
    commands:
317 344
 
318
-   Example 1.12. Libruxc Usage
345
+   Example 1.13. Libruxc Usage
319 346
 ...
320 347
 git clone https://github.com/miconda/ruxc
321 348
 cd ruxc
Browse code

modules: readme files regenerated - ruxc ... [skip ci]

Kamailio Dev authored on 24/08/2021 08:31:19
Showing 1 changed files
... ...
@@ -27,11 +27,14 @@ Daniel-Constantin Mierla
27 27
         3. Parameters
28 28
 
29 29
               3.1. http_timeout (int)
30
-              3.2. http_tlsmode (int)
31
-              3.3. http_reuse (int)
32
-              3.4. http_retry (int)
33
-              3.5. http_logtype (int)
34
-              3.6. http_debug (int)
30
+              3.2. http_timeout_connect (int)
31
+              3.3. http_timeout_read (int)
32
+              3.4. http_timeout_write (int)
33
+              3.5. http_tlsmode (int)
34
+              3.6. http_reuse (int)
35
+              3.7. http_retry (int)
36
+              3.8. http_logtype (int)
37
+              3.9. http_debug (int)
35 38
 
36 39
         4. Functions
37 40
 
... ...
@@ -43,14 +46,17 @@ Daniel-Constantin Mierla
43 46
    List of Examples
44 47
 
45 48
    1.1. Set http_timeout parameter
46
-   1.2. Set http_tlsmode parameter
47
-   1.3. Set http_reuse parameter
48
-   1.4. Set http_retry parameter
49
-   1.5. Set http_logtype parameter
50
-   1.6. Set http_debug parameter
51
-   1.7. ruxc_http_get() usage
52
-   1.8. ruxc_http_post() usage
53
-   1.9. Libruxc Usage
49
+   1.2. Set http_timeout_connect parameter
50
+   1.3. Set http_timeout_read parameter
51
+   1.4. Set http_timeout_write parameter
52
+   1.5. Set http_tlsmode parameter
53
+   1.6. Set http_reuse parameter
54
+   1.7. Set http_retry parameter
55
+   1.8. Set http_logtype parameter
56
+   1.9. Set http_debug parameter
57
+   1.10. ruxc_http_get() usage
58
+   1.11. ruxc_http_post() usage
59
+   1.12. Libruxc Usage
54 60
 
55 61
 Chapter 1. Admin Guide
56 62
 
... ...
@@ -65,11 +71,14 @@ Chapter 1. Admin Guide
65 71
    3. Parameters
66 72
 
67 73
         3.1. http_timeout (int)
68
-        3.2. http_tlsmode (int)
69
-        3.3. http_reuse (int)
70
-        3.4. http_retry (int)
71
-        3.5. http_logtype (int)
72
-        3.6. http_debug (int)
74
+        3.2. http_timeout_connect (int)
75
+        3.3. http_timeout_read (int)
76
+        3.4. http_timeout_write (int)
77
+        3.5. http_tlsmode (int)
78
+        3.6. http_reuse (int)
79
+        3.7. http_retry (int)
80
+        3.8. http_logtype (int)
81
+        3.9. http_debug (int)
73 82
 
74 83
    4. Functions
75 84
 
... ...
@@ -106,16 +115,27 @@ Chapter 1. Admin Guide
106 115
 3. Parameters
107 116
 
108 117
    3.1. http_timeout (int)
109
-   3.2. http_tlsmode (int)
110
-   3.3. http_reuse (int)
111
-   3.4. http_retry (int)
112
-   3.5. http_logtype (int)
113
-   3.6. http_debug (int)
118
+   3.2. http_timeout_connect (int)
119
+   3.3. http_timeout_read (int)
120
+   3.4. http_timeout_write (int)
121
+   3.5. http_tlsmode (int)
122
+   3.6. http_reuse (int)
123
+   3.7. http_retry (int)
124
+   3.8. http_logtype (int)
125
+   3.9. http_debug (int)
114 126
 
115 127
 3.1. http_timeout (int)
116 128
 
117 129
    The interval in miliseconds after which the HTTP GET or POST query
118
-   times out.
130
+   times out. It is the overall timeout, including DNS resolution,
131
+   connecting time, redirects, and reading the response body. Slow DNS
132
+   resolution may cause a request to exceed the timeout, because the DNS
133
+   request cannot be interrupted with the available APIs. It takes
134
+   precedence over http_timeout_read() and http_timeout_write(), but not
135
+   http_timeout_connect. See also the comments in
136
+   'https://github.com/algesten/ureq/blob/main/src/agent.rs'.
137
+
138
+   Use 0 to disable setting it in the library.
119 139
 
120 140
    Default value is 5000 (5 secs).
121 141
 
... ...
@@ -124,19 +144,62 @@ Chapter 1. Admin Guide
124 144
 modparam("ruxc", "http_timeout", 2000)
125 145
 ...
126 146
 
127
-3.2. http_tlsmode (int)
147
+3.2. http_timeout_connect (int)
148
+
149
+   The interval in miliseconds after which to give up on connecting to the
150
+   HTTP/S server. If http_timeout is set, this one takes precedence. The
151
+   library beneath has a default 30 seconds connect timeout.
152
+
153
+   Use 0 to disable setting it in the library.
154
+
155
+   Default value is 5000 (5 secs).
156
+
157
+   Example 1.2. Set http_timeout_connect parameter
158
+...
159
+modparam("ruxc", "http_timeout_connect", 2000)
160
+...
161
+
162
+3.3. http_timeout_read (int)
163
+
164
+   The interval in miliseconds after which the read on HTTP/S connection
165
+   socket timeouts. If http_timeout is set, it takes precedence.
166
+
167
+   Use 0 to disable setting it in the library.
168
+
169
+   Default value is 5000 (5 secs).
170
+
171
+   Example 1.3. Set http_timeout_read parameter
172
+...
173
+modparam("ruxc", "http_timeout_read", 2000)
174
+...
175
+
176
+3.4. http_timeout_write (int)
177
+
178
+   The interval in miliseconds after which the write on HTTP/S connection
179
+   socket timeouts. If http_timeout is set, it takes precedence.
180
+
181
+   Use 0 to disable setting it in the library.
182
+
183
+   Default value is 5000 (5 secs).
184
+
185
+   Example 1.4. Set http_timeout_write parameter
186
+...
187
+modparam("ruxc", "http_timeout_write", 2000)
188
+...
189
+
190
+3.5. http_tlsmode (int)
128 191
 
129 192
    The mode to connect over TLS to HTTPS sites: 0 accept all certificates;
130 193
    1 - accept trusted certificates.
131 194
 
132 195
    Default value is 0 (accept all certificates).
133 196
 
134
-   Example 1.2. Set http_tlsmode parameter
197
+   Example 1.5. Set http_tlsmode parameter
135 198
 ...
136 199
 modparam("ruxc", "http_tlsmode", 1)
137 200
 ...
138 201
 
139
-3.3. http_reuse (int)
202
+3.6. http_reuse (int)
140 203
 
141 204
    Set to 1 in order to reuse the connection for all requests (each
142 205
    Kamailio process has its own connection). Useful to avoid TCP connect
... ...
@@ -149,42 +212,42 @@ modparam("ruxc", "http_tlsmode", 1)
149 212
 
150 213
    Default value is 0 (new connection for each request).
151 214
 
152
-   Example 1.3. Set http_reuse parameter
215
+   Example 1.6. Set http_reuse parameter
153 216
 ...
154 217
 modparam("ruxc", "http_reuse", 1)
155 218
 ...
156 219
 
157
-3.4. http_retry (int)
220
+3.7. http_retry (int)
158 221
 
159 222
    How many times to retry if the HTTP request does not get a 200ok
160 223
    response.
161 224
 
162 225
    Default value is 0 (no retry).
163 226
 
164
-   Example 1.4. Set http_retry parameter
227
+   Example 1.7. Set http_retry parameter
165 228
 ...
166 229
 modparam("ruxc", "http_retry", 2)
167 230
 ...
168 231
 
169
-3.5. http_logtype (int)
232
+3.8. http_logtype (int)
170 233
 
171 234
    Set the log type for libruxc http functions: 0 - stdout; 1 - syslog.
172 235
 
173 236
    Default value is 0.
174 237
 
175
-   Example 1.5. Set http_logtype parameter
238
+   Example 1.8. Set http_logtype parameter
176 239
 ...
177 240
 modparam("ruxc", "http_logtype", 1)
178 241
 ...
179 242
 
180
-3.6. http_debug (int)
243
+3.9. http_debug (int)
181 244
 
182 245
    Set the debug mode for libruxc http functions: 0 - no debug; 1 -
183 246
    errors; 2 - debug.
184 247
 
185 248
    Default value is 0.
186 249
 
187
-   Example 1.6. Set http_debug parameter
250
+   Example 1.9. Set http_debug parameter
188 251
 ...
189 252
 modparam("ruxc", "http_debug", 1)
190 253
 ...
... ...
@@ -206,7 +269,7 @@ modparam("ruxc", "http_debug", 1)
206 269
 
207 270
    This function can be used from ANY_ROUTE.
208 271
 
209
-   Example 1.7. ruxc_http_get() usage
272
+   Example 1.10. ruxc_http_get() usage
210 273
 ...
211 274
 ruxc_http_get("http://api.com/index.php?r_uri=$(ru{s.escape.param})&f_uri=$(fu{s
212 275
 .escape.param})",
... ...
@@ -229,7 +292,7 @@ switch ($rc) {
229 292
 
230 293
    This function can be used from ANY_ROUTE.
231 294
 
232
-   Example 1.8. ruxc_http_post() usage
295
+   Example 1.11. ruxc_http_post() usage
233 296
 ...
234 297
 ruxc_http_post("http://api.com/index.php?r_uri=$(ru{s.escape.param})&f_uri=$(fu{
235 298
 s.escape.param})",
... ...
@@ -252,7 +315,7 @@ switch ($rc) {
252 315
    installed and its environment configured, then run the following
253 316
    commands:
254 317
 
255
-   Example 1.9. Libruxc Usage
318
+   Example 1.12. Libruxc Usage
256 319
 ...
257 320
 git clone https://github.com/miconda/ruxc
258 321
 cd ruxc
Browse code

modules: readme files regenerated - ruxc ... [skip ci]

Kamailio Dev authored on 20/08/2021 06:16:19
Showing 1 changed files
... ...
@@ -30,6 +30,8 @@ Daniel-Constantin Mierla
30 30
               3.2. http_tlsmode (int)
31 31
               3.3. http_reuse (int)
32 32
               3.4. http_retry (int)
33
+              3.5. http_logtype (int)
34
+              3.6. http_debug (int)
33 35
 
34 36
         4. Functions
35 37
 
... ...
@@ -44,9 +46,11 @@ Daniel-Constantin Mierla
44 46
    1.2. Set http_tlsmode parameter
45 47
    1.3. Set http_reuse parameter
46 48
    1.4. Set http_retry parameter
47
-   1.5. ruxc_http_get() usage
48
-   1.6. ruxc_http_post() usage
49
-   1.7. Libruxc Usage
49
+   1.5. Set http_logtype parameter
50
+   1.6. Set http_debug parameter
51
+   1.7. ruxc_http_get() usage
52
+   1.8. ruxc_http_post() usage
53
+   1.9. Libruxc Usage
50 54
 
51 55
 Chapter 1. Admin Guide
52 56
 
... ...
@@ -64,6 +68,8 @@ Chapter 1. Admin Guide
64 68
         3.2. http_tlsmode (int)
65 69
         3.3. http_reuse (int)
66 70
         3.4. http_retry (int)
71
+        3.5. http_logtype (int)
72
+        3.6. http_debug (int)
67 73
 
68 74
    4. Functions
69 75
 
... ...
@@ -103,6 +109,8 @@ Chapter 1. Admin Guide
103 109
    3.2. http_tlsmode (int)
104 110
    3.3. http_reuse (int)
105 111
    3.4. http_retry (int)
112
+   3.5. http_logtype (int)
113
+   3.6. http_debug (int)
106 114
 
107 115
 3.1. http_timeout (int)
108 116
 
... ...
@@ -158,6 +166,29 @@ modparam("ruxc", "http_reuse", 1)
158 166
 modparam("ruxc", "http_retry", 2)
159 167
 ...
160 168
 
169
+3.5. http_logtype (int)
170
+
171
+   Set the log type for libruxc http functions: 0 - stdout; 1 - syslog.
172
+
173
+   Default value is 0.
174
+
175
+   Example 1.5. Set http_logtype parameter
176
+...
177
+modparam("ruxc", "http_logtype", 1)
178
+...
179
+
180
+3.6. http_debug (int)
181
+
182
+   Set the debug mode for libruxc http functions: 0 - no debug; 1 -
183
+   errors; 2 - debug.
184
+
185
+   Default value is 0.
186
+
187
+   Example 1.6. Set http_debug parameter
188
+...
189
+modparam("ruxc", "http_debug", 1)
190
+...
191
+
161 192
 4. Functions
162 193
 
163 194
    4.1. ruxc_http_get(url, hdrs, respv)
... ...
@@ -175,7 +206,7 @@ modparam("ruxc", "http_retry", 2)
175 206
 
176 207
    This function can be used from ANY_ROUTE.
177 208
 
178
-   Example 1.5. ruxc_http_get() usage
209
+   Example 1.7. ruxc_http_get() usage
179 210
 ...
180 211
 ruxc_http_get("http://api.com/index.php?r_uri=$(ru{s.escape.param})&f_uri=$(fu{s
181 212
 .escape.param})",
... ...
@@ -198,7 +229,7 @@ switch ($rc) {
198 229
 
199 230
    This function can be used from ANY_ROUTE.
200 231
 
201
-   Example 1.6. ruxc_http_post() usage
232
+   Example 1.8. ruxc_http_post() usage
202 233
 ...
203 234
 ruxc_http_post("http://api.com/index.php?r_uri=$(ru{s.escape.param})&f_uri=$(fu{
204 235
 s.escape.param})",
... ...
@@ -221,7 +252,7 @@ switch ($rc) {
221 252
    installed and its environment configured, then run the following
222 253
    commands:
223 254
 
224
-   Example 1.7. Libruxc Usage
255
+   Example 1.9. Libruxc Usage
225 256
 ...
226 257
 git clone https://github.com/miconda/ruxc
227 258
 cd ruxc
Browse code

modules: readme files regenerated - ruxc ... [skip ci]

Kamailio Dev authored on 17/08/2021 19:31:16
Showing 1 changed files
... ...
@@ -29,6 +29,7 @@ Daniel-Constantin Mierla
29 29
               3.1. http_timeout (int)
30 30
               3.2. http_tlsmode (int)
31 31
               3.3. http_reuse (int)
32
+              3.4. http_retry (int)
32 33
 
33 34
         4. Functions
34 35
 
... ...
@@ -42,9 +43,10 @@ Daniel-Constantin Mierla
42 43
    1.1. Set http_timeout parameter
43 44
    1.2. Set http_tlsmode parameter
44 45
    1.3. Set http_reuse parameter
45
-   1.4. ruxc_http_get() usage
46
-   1.5. ruxc_http_post() usage
47
-   1.6. Libruxc Usage
46
+   1.4. Set http_retry parameter
47
+   1.5. ruxc_http_get() usage
48
+   1.6. ruxc_http_post() usage
49
+   1.7. Libruxc Usage
48 50
 
49 51
 Chapter 1. Admin Guide
50 52
 
... ...
@@ -61,6 +63,7 @@ Chapter 1. Admin Guide
61 63
         3.1. http_timeout (int)
62 64
         3.2. http_tlsmode (int)
63 65
         3.3. http_reuse (int)
66
+        3.4. http_retry (int)
64 67
 
65 68
    4. Functions
66 69
 
... ...
@@ -99,6 +102,7 @@ Chapter 1. Admin Guide
99 102
    3.1. http_timeout (int)
100 103
    3.2. http_tlsmode (int)
101 104
    3.3. http_reuse (int)
105
+   3.4. http_retry (int)
102 106
 
103 107
 3.1. http_timeout (int)
104 108
 
... ...
@@ -142,6 +146,18 @@ modparam("ruxc", "http_tlsmode", 1)
142 146
 modparam("ruxc", "http_reuse", 1)
143 147
 ...
144 148
 
149
+3.4. http_retry (int)
150
+
151
+   How many times to retry if the HTTP request does not get a 200ok
152
+   response.
153
+
154
+   Default value is 0 (no retry).
155
+
156
+   Example 1.4. Set http_retry parameter
157
+...
158
+modparam("ruxc", "http_retry", 2)
159
+...
160
+
145 161
 4. Functions
146 162
 
147 163
    4.1. ruxc_http_get(url, hdrs, respv)
... ...
@@ -159,7 +175,7 @@ modparam("ruxc", "http_reuse", 1)
159 175
 
160 176
    This function can be used from ANY_ROUTE.
161 177
 
162
-   Example 1.4. ruxc_http_get() usage
178
+   Example 1.5. ruxc_http_get() usage
163 179
 ...
164 180
 ruxc_http_get("http://api.com/index.php?r_uri=$(ru{s.escape.param})&f_uri=$(fu{s
165 181
 .escape.param})",
... ...
@@ -182,7 +198,7 @@ switch ($rc) {
182 198
 
183 199
    This function can be used from ANY_ROUTE.
184 200
 
185
-   Example 1.5. ruxc_http_post() usage
201
+   Example 1.6. ruxc_http_post() usage
186 202
 ...
187 203
 ruxc_http_post("http://api.com/index.php?r_uri=$(ru{s.escape.param})&f_uri=$(fu{
188 204
 s.escape.param})",
... ...
@@ -205,7 +221,7 @@ switch ($rc) {
205 221
    installed and its environment configured, then run the following
206 222
    commands:
207 223
 
208
-   Example 1.6. Libruxc Usage
224
+   Example 1.7. Libruxc Usage
209 225
 ...
210 226
 git clone https://github.com/miconda/ruxc
211 227
 cd ruxc
Browse code

modules: readme files regenerated - ruxc ... [skip ci]

Kamailio Dev authored on 06/08/2021 07:01:22
Showing 1 changed files
... ...
@@ -131,6 +131,10 @@ modparam("ruxc", "http_tlsmode", 1)
131 131
    (and TLS handshake) when all requests are performed against the same
132 132
    HTTP/S server.
133 133
 
134
+   Set to 2 in order to keep connections per base URL (scheme://host:port)
135
+   indexed in a hash map. Useful when doing HTTP/S requests to many
136
+   servers.
137
+
134 138
    Default value is 0 (new connection for each request).
135 139
 
136 140
    Example 1.3. Set http_reuse parameter
Browse code

modules: readme files regenerated - ruxc ... [skip ci]

Kamailio Dev authored on 24/07/2021 06:31:20
Showing 1 changed files
... ...
@@ -28,6 +28,7 @@ Daniel-Constantin Mierla
28 28
 
29 29
               3.1. http_timeout (int)
30 30
               3.2. http_tlsmode (int)
31
+              3.3. http_reuse (int)
31 32
 
32 33
         4. Functions
33 34
 
... ...
@@ -40,9 +41,10 @@ Daniel-Constantin Mierla
40 41
 
41 42
    1.1. Set http_timeout parameter
42 43
    1.2. Set http_tlsmode parameter
43
-   1.3. ruxc_http_get() usage
44
-   1.4. ruxc_http_post() usage
45
-   1.5. Libruxc Usage
44
+   1.3. Set http_reuse parameter
45
+   1.4. ruxc_http_get() usage
46
+   1.5. ruxc_http_post() usage
47
+   1.6. Libruxc Usage
46 48
 
47 49
 Chapter 1. Admin Guide
48 50
 
... ...
@@ -58,6 +60,7 @@ Chapter 1. Admin Guide
58 60
 
59 61
         3.1. http_timeout (int)
60 62
         3.2. http_tlsmode (int)
63
+        3.3. http_reuse (int)
61 64
 
62 65
    4. Functions
63 66
 
... ...
@@ -95,6 +98,7 @@ Chapter 1. Admin Guide
95 98
 
96 99
    3.1. http_timeout (int)
97 100
    3.2. http_tlsmode (int)
101
+   3.3. http_reuse (int)
98 102
 
99 103
 3.1. http_timeout (int)
100 104
 
... ...
@@ -120,6 +124,20 @@ modparam("ruxc", "http_timeout", 2000)
120 124
 modparam("ruxc", "http_tlsmode", 1)
121 125
 ...
122 126
 
127
+3.3. http_reuse (int)
128
+
129
+   Set to 1 in order to reuse the connection for all requests (each
130
+   Kamailio process has its own connection). Useful to avoid TCP connect
131
+   (and TLS handshake) when all requests are performed against the same
132
+   HTTP/S server.
133
+
134
+   Default value is 0 (new connection for each request).
135
+
136
+   Example 1.3. Set http_reuse parameter
137
+...
138
+modparam("ruxc", "http_reuse", 1)
139
+...
140
+
123 141
 4. Functions
124 142
 
125 143
    4.1. ruxc_http_get(url, hdrs, respv)
... ...
@@ -137,7 +155,7 @@ modparam("ruxc", "http_tlsmode", 1)
137 155
 
138 156
    This function can be used from ANY_ROUTE.
139 157
 
140
-   Example 1.3. ruxc_http_get() usage
158
+   Example 1.4. ruxc_http_get() usage
141 159
 ...
142 160
 ruxc_http_get("http://api.com/index.php?r_uri=$(ru{s.escape.param})&f_uri=$(fu{s
143 161
 .escape.param})",
... ...
@@ -160,7 +178,7 @@ switch ($rc) {
160 178
 
161 179
    This function can be used from ANY_ROUTE.
162 180
 
163
-   Example 1.4. ruxc_http_post() usage
181
+   Example 1.5. ruxc_http_post() usage
164 182
 ...
165 183
 ruxc_http_post("http://api.com/index.php?r_uri=$(ru{s.escape.param})&f_uri=$(fu{
166 184
 s.escape.param})",
... ...
@@ -183,7 +201,7 @@ switch ($rc) {
183 201
    installed and its environment configured, then run the following
184 202
    commands:
185 203
 
186
-   Example 1.5. Libruxc Usage
204
+   Example 1.6. Libruxc Usage
187 205
 ...
188 206
 git clone https://github.com/miconda/ruxc
189 207
 cd ruxc
Browse code

modules: readme files regenerated - ruxc ... [skip ci]

Kamailio Dev authored on 22/07/2021 08:01:23
Showing 1 changed files
... ...
@@ -27,6 +27,7 @@ Daniel-Constantin Mierla
27 27
         3. Parameters
28 28
 
29 29
               3.1. http_timeout (int)
30
+              3.2. http_tlsmode (int)
30 31
 
31 32
         4. Functions
32 33
 
... ...
@@ -38,9 +39,10 @@ Daniel-Constantin Mierla
38 39
    List of Examples
39 40
 
40 41
    1.1. Set http_timeout parameter
41
-   1.2. ruxc_http_get() usage
42
-   1.3. ruxc_http_post() usage
43
-   1.4. Libruxc Usage
42
+   1.2. Set http_tlsmode parameter
43
+   1.3. ruxc_http_get() usage
44
+   1.4. ruxc_http_post() usage
45
+   1.5. Libruxc Usage
44 46
 
45 47
 Chapter 1. Admin Guide
46 48
 
... ...
@@ -55,6 +57,7 @@ Chapter 1. Admin Guide
55 57
    3. Parameters
56 58
 
57 59
         3.1. http_timeout (int)
60
+        3.2. http_tlsmode (int)
58 61
 
59 62
    4. Functions
60 63
 
... ...
@@ -91,6 +94,7 @@ Chapter 1. Admin Guide
91 94
 3. Parameters
92 95
 
93 96
    3.1. http_timeout (int)
97
+   3.2. http_tlsmode (int)
94 98
 
95 99
 3.1. http_timeout (int)
96 100
 
... ...
@@ -104,6 +108,18 @@ Chapter 1. Admin Guide
104 108
 modparam("ruxc", "http_timeout", 2000)
105 109
 ...
106 110
 
111
+3.2. http_tlsmode (int)
112
+
113
+   The mode to connect over TLS to HTTPS sites: 0 accept all certificates;
114
+   1 - accept trusted certificates.
115
+
116
+   Default value is 0 (accept all certificates).
117
+
118
+   Example 1.2. Set http_tlsmode parameter
119
+...
120
+modparam("ruxc", "http_tlsmode", 1)
121
+...
122
+
107 123
 4. Functions
108 124
 
109 125
    4.1. ruxc_http_get(url, hdrs, respv)
... ...
@@ -121,7 +137,7 @@ modparam("ruxc", "http_timeout", 2000)
121 137
 
122 138
    This function can be used from ANY_ROUTE.
123 139
 
124
-   Example 1.2. ruxc_http_get() usage
140
+   Example 1.3. ruxc_http_get() usage
125 141
 ...
126 142
 ruxc_http_get("http://api.com/index.php?r_uri=$(ru{s.escape.param})&f_uri=$(fu{s
127 143
 .escape.param})",
... ...
@@ -144,7 +160,7 @@ switch ($rc) {
144 160
 
145 161
    This function can be used from ANY_ROUTE.
146 162
 
147
-   Example 1.3. ruxc_http_post() usage
163
+   Example 1.4. ruxc_http_post() usage
148 164
 ...
149 165
 ruxc_http_post("http://api.com/index.php?r_uri=$(ru{s.escape.param})&f_uri=$(fu{
150 166
 s.escape.param})",
... ...
@@ -167,7 +183,7 @@ switch ($rc) {
167 183
    installed and its environment configured, then run the following
168 184
    commands:
169 185
 
170
-   Example 1.4. Libruxc Usage
186
+   Example 1.5. Libruxc Usage
171 187
 ...
172 188
 git clone https://github.com/miconda/ruxc
173 189
 cd ruxc
Browse code

modules: readme files regenerated - ruxc ... [skip ci]

Kamailio Dev authored on 19/07/2021 15:31:13
Showing 1 changed files
... ...
@@ -11,7 +11,7 @@ Daniel-Constantin Mierla
11 11
 
12 12
    <miconda@gmail.com>
13 13
 
14
-   Copyright � 2021 http://www.asipto.com
14
+   Copyright © 2021 http://www.asipto.com
15 15
      __________________________________________________________________
16 16
 
17 17
    Table of Contents
... ...
@@ -109,7 +109,7 @@ modparam("ruxc", "http_timeout", 2000)
109 109
    4.1. ruxc_http_get(url, hdrs, respv)
110 110
    4.2. ruxc_http_post(url, body, hdrs, respv)
111 111
 
112
-4.1. ruxc_http_get(url, hdrs, respv)
112
+4.1.  ruxc_http_get(url, hdrs, respv)
113 113
 
114 114
    Perform a HTTP GET request to "url", storing the response body in the
115 115
    "respv" variable. The "hdrs" can be empty string to skip setting them.
... ...
@@ -123,15 +123,15 @@ modparam("ruxc", "http_timeout", 2000)
123 123
 
124 124
    Example 1.2. ruxc_http_get() usage
125 125
 ...
126
-http_client_get("http://api.com/index.php?r_uri=$(ru{s.escape.param})&f_uri=$(fu
127
-{s.escape.param})",
126
+ruxc_http_get("http://api.com/index.php?r_uri=$(ru{s.escape.param})&f_uri=$(fu{s
127
+.escape.param})",
128 128
            "", "X-Token: abc", "$var(result)");
129 129
 switch ($rc) {
130 130
     ...
131 131
 }
132 132
 ...
133 133
 
134
-4.2. ruxc_http_post(url, body, hdrs, respv)
134
+4.2.  ruxc_http_post(url, body, hdrs, respv)
135 135
 
136 136
    Perform a HTTP POST request to "url", storing the response body in the
137 137
    "respv" variable. The "body" and "hdrs" can be empty strings to skip
Browse code

ruxc: new module with utility functions from libruxc

- first target is to provide http get/post functions that do not depend
on libcurl+libssl

Daniel-Constantin Mierla authored on 19/07/2021 06:32:48
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,188 @@
1
+RUXC Module
2
+
3
+Daniel-Constantin Mierla
4
+
5
+   asipto.com
6
+   <miconda@gmail.com>
7
+
8
+Edited by
9
+
10
+Daniel-Constantin Mierla
11
+
12
+   <miconda@gmail.com>
13
+
14
+   Copyright � 2021 http://www.asipto.com
15
+     __________________________________________________________________
16
+
17
+   Table of Contents
18
+
19
+   1. Admin Guide
20
+
21
+        1. Overview
22
+        2. Dependencies
23
+
24
+              2.1. Kamailio Modules
25
+              2.2. External Libraries or Applications
26
+
27
+        3. Parameters
28
+
29
+              3.1. http_timeout (int)
30
+
31
+        4. Functions
32
+
33
+              4.1. ruxc_http_get(url, hdrs, respv)
34
+              4.2. ruxc_http_post(url, body, hdrs, respv)
35
+
36
+        5. Installation
37
+
38
+   List of Examples
39
+
40
+   1.1. Set http_timeout parameter
41
+   1.2. ruxc_http_get() usage
42
+   1.3. ruxc_http_post() usage
43
+   1.4. Libruxc Usage
44
+
45
+Chapter 1. Admin Guide
46
+
47
+   Table of Contents
48
+
49
+   1. Overview
50
+   2. Dependencies
51
+
52
+        2.1. Kamailio Modules
53
+        2.2. External Libraries or Applications
54
+
55
+   3. Parameters
56
+
57
+        3.1. http_timeout (int)
58
+
59
+   4. Functions
60
+
61
+        4.1. ruxc_http_get(url, hdrs, respv)
62
+        4.2. ruxc_http_post(url, body, hdrs, respv)
63
+
64
+   5. Installation
65
+
66
+1. Overview
67
+
68
+   The module exports utility functions based on libruxc.
69
+
70
+   Among them are function to perform HTTP GET and POST queries.
71
+
72
+   The ruxc project is available at: https://github.com/miconda/ruxc.
73
+
74
+2. Dependencies
75
+
76
+   2.1. Kamailio Modules
77
+   2.2. External Libraries or Applications
78
+
79
+2.1. Kamailio Modules
80
+
81
+   The following modules must be installed (but not loaded) to use this
82
+   module:
83
+     * none.
84
+
85
+2.2. External Libraries or Applications
86
+
87
+   The following libraries or applications must be installed before
88
+   running Kamailio with this module loaded:
89
+     * libruxc.
90
+
91
+3. Parameters
92
+
93
+   3.1. http_timeout (int)
94
+
95
+3.1. http_timeout (int)
96
+
97
+   The interval in miliseconds after which the HTTP GET or POST query
98
+   times out.
99
+
100
+   Default value is 5000 (5 secs).
101
+
102
+   Example 1.1. Set http_timeout parameter
103
+...
104
+modparam("ruxc", "http_timeout", 2000)
105
+...
106
+
107
+4. Functions
108
+
109
+   4.1. ruxc_http_get(url, hdrs, respv)
110
+   4.2. ruxc_http_post(url, body, hdrs, respv)
111
+
112
+4.1. ruxc_http_get(url, hdrs, respv)
113
+
114
+   Perform a HTTP GET request to "url", storing the response body in the
115
+   "respv" variable. The "hdrs" can be empty string to skip setting them.
116
+   The first two parameters can contain variables that are evaluated at
117
+   runtime. The "respv" has to be the name of a writable variable.
118
+
119
+   The function returns response code of HTTP reply or negative value if
120
+   something went wrong.
121
+
122
+   This function can be used from ANY_ROUTE.
123
+
124
+   Example 1.2. ruxc_http_get() usage
125
+...
126
+http_client_get("http://api.com/index.php?r_uri=$(ru{s.escape.param})&f_uri=$(fu
127
+{s.escape.param})",
128
+           "", "X-Token: abc", "$var(result)");
129
+switch ($rc) {
130
+    ...
131
+}
132
+...
133
+
134
+4.2. ruxc_http_post(url, body, hdrs, respv)
135
+
136
+   Perform a HTTP POST request to "url", storing the response body in the
137
+   "respv" variable. The "body" and "hdrs" can be empty strings to skip
138
+   setting them. The first three parameters can contain variables that are
139
+   evaluated at runtime. The "respv" has to be the name of a writable
140
+   variable.
141
+
142
+   The function returns response code of HTTP reply or negative value if
143
+   something went wrong.
144
+
145
+   This function can be used from ANY_ROUTE.
146
+
147
+   Example 1.3. ruxc_http_post() usage
148
+...
149
+ruxc_http_post("http://api.com/index.php?r_uri=$(ru{s.escape.param})&f_uri=$(fu{
150
+s.escape.param})",
151
+           "", "X-Token: abc", "$var(result)");
152
+switch ($rc) {
153
+    ...
154
+}
155
+...
156
+
157
+5. Installation
158
+
159
+   The module needs "libruxc" library, which is provided by "ruxc" project
160
+   from https://github.com/miconda/ruxc/. The library is implemented in
161
+   Rust language, with generated C API and library. Until the libruxc is
162
+   going to be packaged in OS distributions, the ruxc module can be
163
+   compiled by copying ruxc.h and libruxc.a files in the folder of the
164
+   module.
165
+
166
+   To generate the libruxc.a file, it requires to have Rust language
167
+   installed and its environment configured, then run the following
168
+   commands:
169
+
170
+   Example 1.4. Libruxc Usage
171
+...
172
+git clone https://github.com/miconda/ruxc
173
+cd ruxc
174
+cargo build --release
175
+cp include/ruxc.h target/release/libruxc.a \
176
+    /path/to/kamailio/src/modules/ruxc/
177
+
178
+cd /path/to/kamailio/
179
+make include_modules="ruxc ..." cfg
180
+make all
181
+make install
182
+
183
+## or compiling individual module for use inside source tree
184
+# make modules modules=src/modules/ruxc
185
+...
186
+
187
+   For more details about compilation and installation of libruxc, see:
188
+   https://github.com/miconda/ruxc.