Browse Source

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

Kamailio Dev 6 months ago
parent
commit
f07bc9ef61
2 changed files with 32 additions and 5 deletions
  1. 20 2
      src/modules/app_python3s/README
  2. 12 3
      src/modules/auth/README

+ 20 - 2
src/modules/app_python3s/README

@@ -28,6 +28,7 @@ Daniel-Constantin Mierla
               3.1. load (string)
               3.1. load (string)
               3.2. script_init (string)
               3.2. script_init (string)
               3.3. script_child_init (string)
               3.3. script_child_init (string)
+              3.4. threads_mode (int)
 
 
         4. Functions
         4. Functions
 
 
@@ -45,7 +46,8 @@ Daniel-Constantin Mierla
    1.1. Set load parameter
    1.1. Set load parameter
    1.2. Set script_init parameter
    1.2. Set script_init parameter
    1.3. Set script_child_init parameter
    1.3. Set script_child_init parameter
-   1.4. app_python3s_exec usage
+   1.4. Set threads_mode parameter
+   1.5. app_python3s_exec usage
 
 
 Chapter 1. Admin Guide
 Chapter 1. Admin Guide
 
 
@@ -62,6 +64,7 @@ Chapter 1. Admin Guide
         3.1. load (string)
         3.1. load (string)
         3.2. script_init (string)
         3.2. script_init (string)
         3.3. script_child_init (string)
         3.3. script_child_init (string)
+        3.4. threads_mode (int)
 
 
    4. Functions
    4. Functions
 
 
@@ -118,6 +121,7 @@ Chapter 1. Admin Guide
    3.1. load (string)
    3.1. load (string)
    3.2. script_init (string)
    3.2. script_init (string)
    3.3. script_child_init (string)
    3.3. script_child_init (string)
+   3.4. threads_mode (int)
 
 
 3.1. load (string)
 3.1. load (string)
 
 
@@ -163,6 +167,20 @@ def ksr_script_child_init():
     return 1
     return 1
 ...
 ...
 
 
+3.4. threads_mode (int)
+
+   Control how locking for Python interpreter threads in done. If set to
+   1, use Py_BLOCK_THREADS/Py_UNBLOCK_THREADS (new mode added for v6.0.x).
+   If set to 0, use PyGILState_Ensure()/PyGILState_Release() (the mode
+   implemented initially).
+
+   Default value is “0”.
+
+   Example 1.4. Set threads_mode parameter
+...
+modparam("app_python3s", "threads_mode", 1)
+...
+
 4. Functions
 4. Functions
 
 
    4.1. app_python3s_exec(method [, param])
    4.1. app_python3s_exec(method [, param])
@@ -175,7 +193,7 @@ def ksr_script_child_init():
 
 
    Both parameters can contain pseudo-variables.
    Both parameters can contain pseudo-variables.
 
 
-   Example 1.4. app_python3s_exec usage
+   Example 1.5. app_python3s_exec usage
 ...
 ...
 app_python3s_exec("my_python_function");
 app_python3s_exec("my_python_function");
 app_python3s_exec("my_python_function", "my_params");
 app_python3s_exec("my_python_function", "my_params");

+ 12 - 3
src/modules/auth/README

@@ -86,7 +86,7 @@ Daniel-Constantin Mierla
    1.23. pv_www_authenticate usage
    1.23. pv_www_authenticate usage
    1.24. pv_proxy_authenticate usage
    1.24. pv_proxy_authenticate usage
    1.25. pv_auth_check usage
    1.25. pv_auth_check usage
-   1.26. auth_get_www_authenticate
+   1.26. auth_get_www_authenticate usage
    1.27. auth_algorithm example
    1.27. auth_algorithm example
 
 
 Chapter 1. Admin Guide
 Chapter 1. Admin Guide
@@ -924,7 +924,7 @@ if (!pv_auth_check("$fd", "$avp(password)", "0", "1")) {
 
 
    This function can be used from ANY_ROUTE.
    This function can be used from ANY_ROUTE.
 
 
-   Example 1.26. auth_get_www_authenticate
+   Example 1.26. auth_get_www_authenticate usage
 ...
 ...
 if (auth_get_www_authenticate("$fd", "0", "$var(wauth)")) {
 if (auth_get_www_authenticate("$fd", "0", "$var(wauth)")) {
         xlog("www authenticate header is [$var(wauth)]\n");
         xlog("www authenticate header is [$var(wauth)]\n");
@@ -939,5 +939,14 @@ if (auth_get_www_authenticate("$fd", "0", "$var(wauth)")) {
 
 
    Example 1.27. auth_algorithm example
    Example 1.27. auth_algorithm example
 ...
 ...
-auth_algorithm("$alg");
+if($fU == "alice") {
+    $var(alg) = "SHA-256";
+} else {
+    $var(alg) = "MD5";
+}
+auth_algorithm("$var(alg)");
+if (!auth_check("$fd", "subscriber", "1")) {
+    auth_challenge("$fd", "1");
+    exit;
+}
 ...
 ...