Kaynağa Gözat

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

Kamailio Dev 7 yıl önce
ebeveyn
işleme
a69aab1c65
2 değiştirilmiş dosya ile 105 ekleme ve 35 silme
  1. 48 22
      src/modules/msrp/README
  2. 57 13
      src/modules/sipcapture/README

+ 48 - 22
src/modules/msrp/README

@@ -37,6 +37,7 @@ Alex Balashov
               3.4. auth_min_expires (int)
               3.4. auth_min_expires (int)
               3.5. auth_max_expires (int)
               3.5. auth_max_expires (int)
               3.6. use_path_addr (str)
               3.6. use_path_addr (str)
+              3.7. event_callback (str)
 
 
         4. Functions
         4. Functions
 
 
@@ -66,17 +67,18 @@ Alex Balashov
    1.4. Set auth_min_expires parameter
    1.4. Set auth_min_expires parameter
    1.5. Set auth_max_expires parameter
    1.5. Set auth_max_expires parameter
    1.6. Set use_path_addr parameter
    1.6. Set use_path_addr parameter
-   1.7. msrp_relay usage
-   1.8. msrp_reply usage
-   1.9. msrp_is_request usage
-   1.10. msrp_is_reply usage
-   1.11. msrp_set_dst usage
-   1.12. msrp_relay_flags usage
-   1.13. msrp_reply_flags usage
-   1.14. msrp_cmap_save usage
-   1.15. msrp_cmap_lookup usage
-   1.16. Event Route (using htable for MSRP connection tracking)
-   1.17. Event Route (using msrp_cmap_ functions for connection tracking)
+   1.7. Set event_callback parameter
+   1.8. msrp_relay usage
+   1.9. msrp_reply usage
+   1.10. msrp_is_request usage
+   1.11. msrp_is_reply usage
+   1.12. msrp_set_dst usage
+   1.13. msrp_relay_flags usage
+   1.14. msrp_reply_flags usage
+   1.15. msrp_cmap_save usage
+   1.16. msrp_cmap_lookup usage
+   1.17. Event Route (using htable for MSRP connection tracking)
+   1.18. Event Route (using msrp_cmap_ functions for connection tracking)
 
 
 Chapter 1. Admin Guide
 Chapter 1. Admin Guide
 
 
@@ -96,6 +98,7 @@ Chapter 1. Admin Guide
         3.4. auth_min_expires (int)
         3.4. auth_min_expires (int)
         3.5. auth_max_expires (int)
         3.5. auth_max_expires (int)
         3.6. use_path_addr (str)
         3.6. use_path_addr (str)
+        3.7. event_callback (str)
 
 
    4. Functions
    4. Functions
 
 
@@ -175,6 +178,7 @@ Chapter 1. Admin Guide
    3.4. auth_min_expires (int)
    3.4. auth_min_expires (int)
    3.5. auth_max_expires (int)
    3.5. auth_max_expires (int)
    3.6. use_path_addr (str)
    3.6. use_path_addr (str)
+   3.7. event_callback (str)
 
 
 3.1. sipmsg (int)
 3.1. sipmsg (int)
 
 
@@ -247,6 +251,28 @@ modparam("msrp", "auth_max_expiresl", 1800)
 modparam("msrp", "use_path_addr", "msrp.kamailio.org:5061")
 modparam("msrp", "use_path_addr", "msrp.kamailio.org:5061")
 ...
 ...
 
 
+3.7. event_callback (str)
+
+   The name of the function in the kemi configuration file (embedded
+   scripting language such as Lua, Python, ...) to be executed instead of
+   event_route[...] blocks.
+
+   The function receives a string parameter with the name of the event,
+   the values can be: 'msrp:frame-in'.
+
+   Default value is 'empty' (no function is executed for events).
+
+   Example 1.7. Set event_callback parameter
+...
+modparam("htable", "event_callback", "ksr_msrp_event")
+...
+-- event callback function implemented in Lua
+function ksr_msrp_event(evname)
+        KSR.info("===== msrp module triggered event: " .. evname .. "\n");
+        return 1;
+end
+...
+
 4. Functions
 4. Functions
 
 
    4.1. msrp_relay()
    4.1. msrp_relay()
@@ -268,7 +294,7 @@ modparam("msrp", "use_path_addr", "msrp.kamailio.org:5061")
 
 
    This function can be used in ANY_ROUTE.
    This function can be used in ANY_ROUTE.
 
 
-   Example 1.7. msrp_relay usage
+   Example 1.8. msrp_relay usage
 ...
 ...
 event_route[msrp:frame-in] {
 event_route[msrp:frame-in] {
     msrp_relay();
     msrp_relay();
@@ -283,7 +309,7 @@ event_route[msrp:frame-in] {
 
 
    This function can be used in ANY_ROUTE.
    This function can be used in ANY_ROUTE.
 
 
-   Example 1.8. msrp_reply usage
+   Example 1.9. msrp_reply usage
 ...
 ...
 event_route[msrp:frame-in] {
 event_route[msrp:frame-in] {
     msrp_reply("403", "Not allowed");
     msrp_reply("403", "Not allowed");
@@ -296,7 +322,7 @@ event_route[msrp:frame-in] {
 
 
    This function can be used in ANY_ROUTE.
    This function can be used in ANY_ROUTE.
 
 
-   Example 1.9. msrp_is_request usage
+   Example 1.10. msrp_is_request usage
 ...
 ...
 event_route[msrp:frame-in] {
 event_route[msrp:frame-in] {
     if(msrp_is_request())
     if(msrp_is_request())
@@ -313,7 +339,7 @@ event_route[msrp:frame-in] {
 
 
    This function can be used in ANY_ROUTE.
    This function can be used in ANY_ROUTE.
 
 
-   Example 1.10. msrp_is_reply usage
+   Example 1.11. msrp_is_reply usage
 ...
 ...
 event_route[msrp:frame-in] {
 event_route[msrp:frame-in] {
     if(msrp_is_reply())
     if(msrp_is_reply())
@@ -333,7 +359,7 @@ event_route[msrp:frame-in] {
 
 
    This function can be used in ANY_ROUTE.
    This function can be used in ANY_ROUTE.
 
 
-   Example 1.11. msrp_set_dst usage
+   Example 1.12. msrp_set_dst usage
 ...
 ...
 event_route[msrp:frame-in] {
 event_route[msrp:frame-in] {
     ...
     ...
@@ -352,7 +378,7 @@ event_route[msrp:frame-in] {
 
 
    This function can be used in ANY_ROUTE.
    This function can be used in ANY_ROUTE.
 
 
-   Example 1.12. msrp_relay_flags usage
+   Example 1.13. msrp_relay_flags usage
 ...
 ...
 event_route[msrp:frame-in] {
 event_route[msrp:frame-in] {
     ...
     ...
@@ -371,7 +397,7 @@ event_route[msrp:frame-in] {
 
 
    This function can be used in ANY_ROUTE.
    This function can be used in ANY_ROUTE.
 
 
-   Example 1.13. msrp_reply_flags usage
+   Example 1.14. msrp_reply_flags usage
 ...
 ...
 event_route[msrp:frame-in] {
 event_route[msrp:frame-in] {
     ...
     ...
@@ -387,7 +413,7 @@ event_route[msrp:frame-in] {
 
 
    This function can be used in ANY_ROUTE.
    This function can be used in ANY_ROUTE.
 
 
-   Example 1.14. msrp_cmap_save usage
+   Example 1.15. msrp_cmap_save usage
 ...
 ...
 event_route[msrp:frame-in] {
 event_route[msrp:frame-in] {
     ...
     ...
@@ -402,7 +428,7 @@ event_route[msrp:frame-in] {
 
 
    This function can be used in ANY_ROUTE.
    This function can be used in ANY_ROUTE.
 
 
-   Example 1.15. msrp_cmap_lookup usage
+   Example 1.16. msrp_cmap_lookup usage
 ...
 ...
 event_route[msrp:frame-in] {
 event_route[msrp:frame-in] {
     ...
     ...
@@ -510,7 +536,7 @@ Content-Type: text/plain
    Next is an example of configuration file with the routing block for
    Next is an example of configuration file with the routing block for
    MSRP frames. In this config, the SIP traffic is rejected.
    MSRP frames. In this config, the SIP traffic is rejected.
 
 
-   Example 1.16. Event Route (using htable for MSRP connection tracking)
+   Example 1.17. Event Route (using htable for MSRP connection tracking)
 ...
 ...
 
 
 #!KAMAILIO
 #!KAMAILIO
@@ -669,7 +695,7 @@ event_route[msrp:frame-in] {
 
 
 ...
 ...
 
 
-   Example 1.17. Event Route (using msrp_cmap_ functions for connection
+   Example 1.18. Event Route (using msrp_cmap_ functions for connection
    tracking)
    tracking)
 ...
 ...
 
 

+ 57 - 13
src/modules/sipcapture/README

@@ -57,12 +57,16 @@ Alexandr Dubovikov
               4.2. report_capture([table], [cid], [data])
               4.2. report_capture([table], [cid], [data])
               4.3. float2int(fval, ival)
               4.3. float2int(fval, ival)
 
 
-        5. RPC Commands
+        5. Event Routes
 
 
-              5.1. sipcapture.status param
+              5.1. event_route[sipcapture:request]
 
 
-        6. Database setup
-        7. Limitations
+        6. RPC Commands
+
+              6.1. sipcapture.status param
+
+        7. Database setup
+        8. Limitations
 
 
    List of Examples
    List of Examples
 
 
@@ -90,6 +94,7 @@ Alexandr Dubovikov
    1.22. sip_capture() usage
    1.22. sip_capture() usage
    1.23. report_capture() usage
    1.23. report_capture() usage
    1.24. report_capture() usage
    1.24. report_capture() usage
+   1.25. event_route[sipcapture:request] usage
 
 
 Chapter 1. Admin Guide
 Chapter 1. Admin Guide
 
 
@@ -131,12 +136,16 @@ Chapter 1. Admin Guide
         4.2. report_capture([table], [cid], [data])
         4.2. report_capture([table], [cid], [data])
         4.3. float2int(fval, ival)
         4.3. float2int(fval, ival)
 
 
-   5. RPC Commands
+   5. Event Routes
+
+        5.1. event_route[sipcapture:request]
 
 
-        5.1. sipcapture.status param
+   6. RPC Commands
 
 
-   6. Database setup
-   7. Limitations
+        6.1. sipcapture.status param
+
+   7. Database setup
+   8. Limitations
 
 
 1. Overview
 1. Overview
 
 
@@ -539,11 +548,46 @@ report_capture("report_data", "$ci", "{\"MOS\":4.1,\"PACKET_LOST\":100"});
 $var(res) = float2int("10.5", "1");
 $var(res) = float2int("10.5", "1");
 ...
 ...
 
 
-5. RPC Commands
+5. Event Routes
+
+   5.1. event_route[sipcapture:request]
+
+5.1. event_route[sipcapture:request]
+
+   Event route block to be executed when HEP packet is received. It
+   requires module parameter 'nonsip_hook' to be set to 1.
+
+   Example 1.25. event_route[sipcapture:request] usage
+...
+# new event sipcapture socket
+modparam("sipcapture", "nonsip_hook", 1)
+...
+
+event_route[sipcapture:request] {
+
+        xlog("HEP Request!\n");
+        xlog("received sipcapture request from $si:$sp\n");
+        xlog("HEP VERSION $hep(version) request from $si:$sp\n");
+        xlog("HEP CHUNK Source IP $hep(0x002) request from $si:$sp\n");
+
+        # is it SIP ?
+        if($hep(0x00b) == 1) {
+
+                # do parsing internal
+                return 1;
+        } else {
+                # if report lets proceed here with payload
+                xlog("HEP CHUNK PAYLOAD $hep(0x00f) request from $si:$sp\n");
+                return 0;
+        }
+}
+...
+
+6. RPC Commands
 
 
-   5.1. sipcapture.status param
+   6.1. sipcapture.status param
 
 
-5.1.  sipcapture.status param
+6.1.  sipcapture.status param
 
 
    Name: sipcapture.status
    Name: sipcapture.status
 
 
@@ -561,7 +605,7 @@ kamcmd sipcapture.status off
 kamcmd sipcapture.status check
 kamcmd sipcapture.status check
 ...
 ...
 
 
-6. Database setup
+7. Database setup
 
 
    Before running Kamailio with the sipcapture module, you have to setup
    Before running Kamailio with the sipcapture module, you have to setup
    the database tables where the module will store the data. For that, if
    the database tables where the module will store the data. For that, if
@@ -571,7 +615,7 @@ kamcmd sipcapture.status check
    find the complete database documentation on the project webpage,
    find the complete database documentation on the project webpage,
    https://www.kamailio.org/docs/db-tables/kamailio-db-devel.html.
    https://www.kamailio.org/docs/db-tables/kamailio-db-devel.html.
 
 
-7. Limitations
+8. Limitations
 
 
      * 1. Only one capturing mode on RAW socket is supported: IPIP or
      * 1. Only one capturing mode on RAW socket is supported: IPIP or
        monitoring/mirroring port. Don't activate both at the same time.
        monitoring/mirroring port. Don't activate both at the same time.