|
@@ -33,7 +33,9 @@ Daniel-Constantin Mierla
|
|
4. Functions
|
|
4. Functions
|
|
|
|
|
|
4.1. lwsc_notify(wsurl, data)
|
|
4.1. lwsc_notify(wsurl, data)
|
|
- 4.2. lwsc_request(wsurl, data)
|
|
|
|
|
|
+ 4.2. lwsc_notify_proto(wsurl, wsproto, data)
|
|
|
|
+ 4.3. lwsc_request(wsurl, data)
|
|
|
|
+ 4.4. lwsc_request_proto(wsurl, wsproto, data)
|
|
|
|
|
|
5. Variables
|
|
5. Variables
|
|
|
|
|
|
@@ -46,8 +48,10 @@ Daniel-Constantin Mierla
|
|
1.3. Set timeout_read parameter
|
|
1.3. Set timeout_read parameter
|
|
1.4. Set verbosity parameter
|
|
1.4. Set verbosity parameter
|
|
1.5. lwsc_notify usage
|
|
1.5. lwsc_notify usage
|
|
- 1.6. lwsc_request usage
|
|
|
|
- 1.7. $lwsc(name) usage
|
|
|
|
|
|
+ 1.6. lwsc_notify_proto usage
|
|
|
|
+ 1.7. lwsc_request usage
|
|
|
|
+ 1.8. lwsc_request_proto usage
|
|
|
|
+ 1.9. $lwsc(name) usage
|
|
|
|
|
|
Chapter 1. Admin Guide
|
|
Chapter 1. Admin Guide
|
|
|
|
|
|
@@ -69,7 +73,9 @@ Chapter 1. Admin Guide
|
|
4. Functions
|
|
4. Functions
|
|
|
|
|
|
4.1. lwsc_notify(wsurl, data)
|
|
4.1. lwsc_notify(wsurl, data)
|
|
- 4.2. lwsc_request(wsurl, data)
|
|
|
|
|
|
+ 4.2. lwsc_notify_proto(wsurl, wsproto, data)
|
|
|
|
+ 4.3. lwsc_request(wsurl, data)
|
|
|
|
+ 4.4. lwsc_request_proto(wsurl, wsproto, data)
|
|
|
|
|
|
5. Variables
|
|
5. Variables
|
|
|
|
|
|
@@ -133,7 +139,7 @@ modparam("lwsc", "timeout_init", 4000000)
|
|
3.3. timeout_read (int)
|
|
3.3. timeout_read (int)
|
|
|
|
|
|
The interval in microseconds to wait for the response of the
|
|
The interval in microseconds to wait for the response of the
|
|
- lwsc_request() function.
|
|
|
|
|
|
+ lwsc_request() group of functions.
|
|
|
|
|
|
Default value is 2000000 (2 seconds).
|
|
Default value is 2000000 (2 seconds).
|
|
|
|
|
|
@@ -158,12 +164,15 @@ modparam("lwsc", "verbosity", 1)
|
|
4. Functions
|
|
4. Functions
|
|
|
|
|
|
4.1. lwsc_notify(wsurl, data)
|
|
4.1. lwsc_notify(wsurl, data)
|
|
- 4.2. lwsc_request(wsurl, data)
|
|
|
|
|
|
+ 4.2. lwsc_notify_proto(wsurl, wsproto, data)
|
|
|
|
+ 4.3. lwsc_request(wsurl, data)
|
|
|
|
+ 4.4. lwsc_request_proto(wsurl, wsproto, data)
|
|
|
|
|
|
4.1. lwsc_notify(wsurl, data)
|
|
4.1. lwsc_notify(wsurl, data)
|
|
|
|
|
|
- Send data via websockets to the address specified by wsurl, no response
|
|
|
|
- is expected.
|
|
|
|
|
|
+ Send data via websockets to the address specified by wsurl. No response
|
|
|
|
+ is expected. Transmission is not guaranteed (e.g., cannot connect to
|
|
|
|
+ target).
|
|
|
|
|
|
The parameters are:
|
|
The parameters are:
|
|
* wsurl - websocket url
|
|
* wsurl - websocket url
|
|
@@ -179,7 +188,28 @@ modparam("lwsc", "verbosity", 1)
|
|
"caller=$fU;callee=$tU;callid=$ci");
|
|
"caller=$fU;callee=$tU;callid=$ci");
|
|
...
|
|
...
|
|
|
|
|
|
-4.2. lwsc_request(wsurl, data)
|
|
|
|
|
|
+4.2. lwsc_notify_proto(wsurl, wsproto, data)
|
|
|
|
+
|
|
|
|
+ Send data via websockets to the address specified by wsurl, providing
|
|
|
|
+ websocket protocol. No response is expected. Transmission is not
|
|
|
|
+ guaranteed (e.g., cannot connect to target).
|
|
|
|
+
|
|
|
|
+ The parameters are:
|
|
|
|
+ * wsurl - websocket url
|
|
|
|
+ * wsproto - websocket protocol
|
|
|
|
+ * data - what to send
|
|
|
|
+
|
|
|
|
+ The parameters can contain pseudo-variables.
|
|
|
|
+
|
|
|
|
+ This function can be used from ANY_ROUTE.
|
|
|
|
+
|
|
|
|
+ Example 1.6. lwsc_notify_proto usage
|
|
|
|
+...
|
|
|
|
+ jwt_notify_proto("ws://10.1.1.10:8080/log", "kmsg"
|
|
|
|
+ "caller=$fU;callee=$tU;callid=$ci");
|
|
|
|
+...
|
|
|
|
+
|
|
|
|
+4.3. lwsc_request(wsurl, data)
|
|
|
|
|
|
Send data via websockets to the address specified by wsurl, a response
|
|
Send data via websockets to the address specified by wsurl, a response
|
|
is expected and made available in $lwsc(rdata).
|
|
is expected and made available in $lwsc(rdata).
|
|
@@ -192,12 +222,33 @@ modparam("lwsc", "verbosity", 1)
|
|
|
|
|
|
This function can be used from ANY_ROUTE.
|
|
This function can be used from ANY_ROUTE.
|
|
|
|
|
|
- Example 1.6. lwsc_request usage
|
|
|
|
|
|
+ Example 1.7. lwsc_request usage
|
|
...
|
|
...
|
|
jwt_request("ws://10.1.1.10:8080/log",
|
|
jwt_request("ws://10.1.1.10:8080/log",
|
|
"caller=$fU;callee=$tU;srcip=$si");
|
|
"caller=$fU;callee=$tU;srcip=$si");
|
|
...
|
|
...
|
|
|
|
|
|
|
|
+4.4. lwsc_request_proto(wsurl, wsproto, data)
|
|
|
|
+
|
|
|
|
+ Send data via websockets to the address specified by wsurl, providing
|
|
|
|
+ websocket protocol. A response is expected and made available in
|
|
|
|
+ $lwsc(rdata).
|
|
|
|
+
|
|
|
|
+ The parameters are:
|
|
|
|
+ * wsurl - websocket url
|
|
|
|
+ * wsproto - websocket protocol
|
|
|
|
+ * data - what to send
|
|
|
|
+
|
|
|
|
+ The parameters can contain pseudo-variables.
|
|
|
|
+
|
|
|
|
+ This function can be used from ANY_ROUTE.
|
|
|
|
+
|
|
|
|
+ Example 1.8. lwsc_request_proto usage
|
|
|
|
+...
|
|
|
|
+ jwt_request_proto("ws://10.1.1.10:8080/log", "kmsg",
|
|
|
|
+ "caller=$fU;callee=$tU;srcip=$si");
|
|
|
|
+...
|
|
|
|
+
|
|
5. Variables
|
|
5. Variables
|
|
|
|
|
|
5.1. $lwsc(key)
|
|
5.1. $lwsc(key)
|
|
@@ -210,7 +261,7 @@ modparam("lwsc", "verbosity", 1)
|
|
* rdata - the response retrieved after lwsc_request().
|
|
* rdata - the response retrieved after lwsc_request().
|
|
* status - the status of verification after a failed jwt_verify().
|
|
* status - the status of verification after a failed jwt_verify().
|
|
|
|
|
|
- Example 1.7. $lwsc(name) usage
|
|
|
|
|
|
+ Example 1.9. $lwsc(name) usage
|
|
...
|
|
...
|
|
jwt_request("ws://10.1.1.10:8080/log",
|
|
jwt_request("ws://10.1.1.10:8080/log",
|
|
"caller=$fU;callee=$tU;srcip=$si");
|
|
"caller=$fU;callee=$tU;srcip=$si");
|