Explorar o código

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

Kamailio Dev %!s(int64=6) %!d(string=hai) anos
pai
achega
bfe9110343
Modificáronse 2 ficheiros con 54 adicións e 4 borrados
  1. 14 0
      src/modules/textops/README
  2. 40 4
      src/modules/xmlrpc/README

+ 14 - 0
src/modules/textops/README

@@ -1160,6 +1160,7 @@ if (starts_with("$rU", "+358"))
 set_body_multipart("test", "text/plain", "delimiter");
 msg_apply_changes();
 append_body_part(...);
+msg_apply_changes();
 
 ...
 
@@ -1195,11 +1196,15 @@ text
    The core will take care of the last boundary ending "--". Detecting
    wich one is the last and fixing the others if needed.
 
+   Note: it may be required that msg_apply_changes() from textopsx module
+   has to be executed if there are other operations over the new body.
+
    Example 1.44. append_body_part usage
 ...
 $var(b) = "7e Od 04 55 75 69 20 4d 61 6b 65 43 61 6c 6c";
 append_body_part("$var(b)", "application/vnd.cirpack.isdn-ext", "signal;handling
 =required");
+msg_apply_changes();
 ...
 
 # Will append this to the body:
@@ -1221,6 +1226,7 @@ Content-Disposition: signal;handling=required
 ...
 $var(b) = "";
 append_body_part("$var(b)", "application/xml\r\nX-Header: xyz");
+msg_apply_changes();
 ...
 
 # Will append this to the body:
@@ -1255,10 +1261,14 @@ Content-Disposition: signal;handling=required
    The core will take care of the last boundary ending "--". Detecting
    wich one is the last and fixing the others if needed.
 
+   Note: it may be required that msg_apply_changes() from textopsx module
+   has to be executed if there are other operations over the new body.
+
    Example 1.46. append_body_part_hex usage
 ...
 $var(b) = "6b 61 6d 61 69 6c 69 6f";
 append_body_part_hex("$var(b)", "application/my-custom-ext");
+msg_apply_changes();
 ...
 
 # Will append this to the body:
@@ -1326,9 +1336,13 @@ get_body_part("application/vnd.cirpack.isdn-ext", "$var(hbody)");
    The core will take care of the last boundary ending "--". Detecting
    wich one is the last and fixing the others if needed.
 
+   Note: it may be required that msg_apply_changes() from textopsx module
+   has to be executed if there are other operations over the new body.
+
    Example 1.49. remove_body_part usage
 ...
 remove_body_part("application/vnd.cirpack.isdn-ext");
+msg_apply_changes();
 ...
 
 Chapter 2. Developer Guide

+ 40 - 4
src/modules/xmlrpc/README

@@ -24,6 +24,7 @@ Jan Janak
               2.5. mode (integer)
               2.6. url_skip (str)
               2.7. url_match (str)
+              2.8. event_callback (string)
 
         3. Functions
 
@@ -44,8 +45,9 @@ Jan Janak
    1.5. Set the mode parameter
    1.6. Set url_skip parameter
    1.7. Set url_match parameter
-   1.8. dispatch_rpc usage
-   1.9. xmlrpc_reply usage
+   1.8. Set event_callback parameter
+   1.9. dispatch_rpc usage
+   1.10. xmlrpc_reply usage
 
 1. Design Goals
 
@@ -536,6 +538,7 @@ Chapter 1. Admin Guide
         2.5. mode (integer)
         2.6. url_skip (str)
         2.7. url_match (str)
+        2.8. event_callback (string)
 
    3. Functions
 
@@ -560,6 +563,7 @@ Chapter 1. Admin Guide
    2.5. mode (integer)
    2.6. url_skip (str)
    2.7. url_match (str)
+   2.8. event_callback (string)
 
 2.1. route (string)
 
@@ -665,6 +669,38 @@ modparam("xmlrpc", "url_skip", "^/sip")
 modparam("xmlrpc", "url_match", "^/RPC2")
 ...
 
+2.8. event_callback (string)
+
+   The name of the function in the kemi configuration file (embedded
+   scripting language such as Lua, Python, ...) to be executed instead of
+   route blocks defined by route parameter for xmlrpc request.
+
+   This route will be called only for HTTP messages whose method is either
+   GET or POST. The message visible inside the route will be a HTTP
+   request converted to SIP (the uri will be fixed and a fake via will be
+   added).
+
+   The route should perform additional security checks to ensure the
+   client is authorized to execute management/RPC functions and then it
+   should call the dispatch_rpc().
+
+   Example 1.8. Set event_callback parameter
+...
+modparam("xmlrpc", "event_callback", "ksr_xmlrpc_event")
+...
+-- event callback function implemented in Lua
+function ksr_xmlrpc_event(evname)
+        KSR.info("===== xmlrpc triggered event: " .. evname .. "\n");
+        local rpc_method = KSR.pv.get("$rm") or ""
+        if ((rpc_method == "POST" or rpc_method == "GET")) then
+                if (KSR.xmlrpc.dispatch_rpc() < 0) then
+                        KSR.err("error while executing xmlrpc event")
+                end
+        end
+        return 1;
+end
+...
+
 3. Functions
 
    3.1. dispatch_rpc()
@@ -686,7 +722,7 @@ modparam("xmlrpc", "url_match", "^/RPC2")
    function with matching name. If such a function is found then
    dispatch_rpc() will pass control to the function to handle the request.
 
-   Example 1.8. dispatch_rpc usage
+   Example 1.9. dispatch_rpc usage
 #...
 modparam("xmlrpc", "route", "XMLRPC");
 #...
@@ -702,7 +738,7 @@ route[XMLRPC]{
    This function can be called from the config script to directly generate
    an XML-RPC reply.
 
-   Example 1.9. xmlrpc_reply usage
+   Example 1.10. xmlrpc_reply usage
 #...
 modparam("xmlrpc", "route", "XMLRPC");
 #...