Browse Source

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

Kamailio Dev 6 years ago
parent
commit
3cdd55926d

+ 106 - 33
src/modules/dialog/README

@@ -28,6 +28,12 @@ Olle E. Johansson
 
 
    <[email protected]>
    <[email protected]>
 
 
+Edited by
+
+Surendra Tiwari
+
+   <[email protected]>
+
    Copyright © 2006 Voice Sistem SRL
    Copyright © 2006 Voice Sistem SRL
 
 
    Copyright © 2011 Carsten Bock, http://www.ng-voice.com
    Copyright © 2011 Carsten Bock, http://www.ng-voice.com
@@ -145,14 +151,17 @@ Olle E. Johansson
 
 
               9.1. dlg.list
               9.1. dlg.list
               9.2. dlg.list_ctx
               9.2. dlg.list_ctx
-              9.3. dlg.dlg_list
-              9.4. dlg.dlg_list_ctx
-              9.5. dlg.terminate_dlg
-              9.6. dlg.end_dlg
-              9.7. dlg.profile_get_size
-              9.8. dlg.profile_list
-              9.9. dlg.bridge_dlg
-              9.10. dlg.stats_active
+              9.3. dlg.list_match
+              9.4. dlg.list_match_ctx
+              9.5. dlg.dlg_list
+              9.6. dlg.dlg_list_ctx
+              9.7. dlg.terminate_dlg
+              9.8. dlg.end_dlg
+              9.9. dlg.profile_get_size
+              9.10. dlg.profile_list
+              9.11. dlg.bridge_dlg
+              9.12. dlg.stats_active
+              9.13. dlg.is_alive
 
 
         10. Exported Variables
         10. Exported Variables
 
 
@@ -375,14 +384,17 @@ Chapter 1. Admin Guide
 
 
         9.1. dlg.list
         9.1. dlg.list
         9.2. dlg.list_ctx
         9.2. dlg.list_ctx
-        9.3. dlg.dlg_list
-        9.4. dlg.dlg_list_ctx
-        9.5. dlg.terminate_dlg
-        9.6. dlg.end_dlg
-        9.7. dlg.profile_get_size
-        9.8. dlg.profile_list
-        9.9. dlg.bridge_dlg
-        9.10. dlg.stats_active
+        9.3. dlg.list_match
+        9.4. dlg.list_match_ctx
+        9.5. dlg.dlg_list
+        9.6. dlg.dlg_list_ctx
+        9.7. dlg.terminate_dlg
+        9.8. dlg.end_dlg
+        9.9. dlg.profile_get_size
+        9.10. dlg.profile_list
+        9.11. dlg.bridge_dlg
+        9.12. dlg.stats_active
+        9.13. dlg.is_alive
 
 
    10. Exported Variables
    10. Exported Variables
 
 
@@ -1866,14 +1878,17 @@ if(has_totag()) {
 
 
    9.1. dlg.list
    9.1. dlg.list
    9.2. dlg.list_ctx
    9.2. dlg.list_ctx
-   9.3. dlg.dlg_list
-   9.4. dlg.dlg_list_ctx
-   9.5. dlg.terminate_dlg
-   9.6. dlg.end_dlg
-   9.7. dlg.profile_get_size
-   9.8. dlg.profile_list
-   9.9. dlg.bridge_dlg
-   9.10. dlg.stats_active
+   9.3. dlg.list_match
+   9.4. dlg.list_match_ctx
+   9.5. dlg.dlg_list
+   9.6. dlg.dlg_list_ctx
+   9.7. dlg.terminate_dlg
+   9.8. dlg.end_dlg
+   9.9. dlg.profile_get_size
+   9.10. dlg.profile_list
+   9.11. dlg.bridge_dlg
+   9.12. dlg.stats_active
+   9.13. dlg.is_alive
 
 
 9.1. dlg.list
 9.1. dlg.list
 
 
@@ -1898,7 +1913,45 @@ kamcmd dlg.list
 kamcmd dlg.list_ctx
 kamcmd dlg.list_ctx
 ...
 ...
 
 
-9.3. dlg.dlg_list
+9.3. dlg.list_match
+
+   Lists the details of matching dialogs. The paramters specify the
+   matching key, operator, value and optionally a limit of matched
+   dialogs.
+
+   Name: dlg.list_match
+
+   Parameters:
+     * mkey - matching key. It can be: 'ruri' - match against R-URI of the
+       dialog; 'furi' - match against From header URI of the dialog;
+       'turi' - match against the To header URI of the dialog; 'callid' -
+       match against Call-Id value.
+     * mop - matching operator. It can be: 'eq' - match using string
+       comparison; 're' - match using regular expression; 'sw' - match
+       using starts-with (prefix) comparison.
+     * mval - matching value.
+
+   RPC Command Format:
+...
+kamcmd dlg.list_match furi eq sip:[email protected] 2
+...
+kamcmd dlg.list_match furi sw sip:alice@
+...
+
+9.4. dlg.list_match_ctx
+
+   Similar to “dlg.list_match”, but including in the attributes associated
+   with the dialog context from modules sitting on top of the dialog
+   module.
+
+   Name: dlg.list_match_ctx
+
+   RPC Command Format:
+...
+kamcmd dlg.list_match_ctx furi sw sip:alice@
+...
+
+9.5. dlg.dlg_list
 
 
    Lists the description of one dialog. The dialog identifiers are to be
    Lists the description of one dialog. The dialog identifiers are to be
    passed as parameter (callid and optionally fromtag).
    passed as parameter (callid and optionally fromtag).
@@ -1917,9 +1970,9 @@ kamcmd dlg.list [email protected] AAdfeEFF33
 kamcmd dlg.list [email protected]
 kamcmd dlg.list [email protected]
 ...
 ...
 
 
-9.4. dlg.dlg_list_ctx
+9.6. dlg.dlg_list_ctx
 
 
-   The same as the “dlg.list_ctx” but including in the dialog description
+   The same as the “dlg.list_list” but including in the dialog description
    the associated context from modules sitting on top of the dialog
    the associated context from modules sitting on top of the dialog
    module.
    module.
 
 
@@ -1934,7 +1987,7 @@ kamcmd dlg.list_ctx [email protected] AAdfeEFF33
 kamcmd dlg.list_ctx [email protected]
 kamcmd dlg.list_ctx [email protected]
 ...
 ...
 
 
-9.5. dlg.terminate_dlg
+9.7. dlg.terminate_dlg
 
 
    Terminates an ongoing dialog by sending BYE in both directions,
    Terminates an ongoing dialog by sending BYE in both directions,
    matching the dialog on call-id, from tag and to tag.
    matching the dialog on call-id, from tag and to tag.
@@ -1951,7 +2004,7 @@ kamcmd dlg.list_ctx [email protected]
    RPC Command Format:
    RPC Command Format:
                 kamcmd dlg.terminate_dlg callid12345 fromtag123 totag123
                 kamcmd dlg.terminate_dlg callid12345 fromtag123 totag123
 
 
-9.6. dlg.end_dlg
+9.8. dlg.end_dlg
 
 
    Terminates an ongoing dialog by sending BYE in both directions.
    Terminates an ongoing dialog by sending BYE in both directions.
 
 
@@ -1971,7 +2024,7 @@ kamcmd dlg.list_ctx [email protected]
 kamcmd dlg.end_dlg 342 56
 kamcmd dlg.end_dlg 342 56
 ...
 ...
 
 
-9.7. dlg.profile_get_size
+9.9. dlg.profile_get_size
 
 
    Returns the number of dialogs belonging to a profile. If the profile
    Returns the number of dialogs belonging to a profile. If the profile
    supports values, the check can be reinforced to take into account a
    supports values, the check can be reinforced to take into account a
@@ -1991,7 +2044,7 @@ kamcmd dlg.end_dlg 342 56
 kamcmd dlg.dlg.profile_get_size inbound_calls
 kamcmd dlg.dlg.profile_get_size inbound_calls
 ...
 ...
 
 
-9.8. dlg.profile_list
+9.10. dlg.profile_list
 
 
    Lists all the dialogs belonging to a profile. If the profile supports
    Lists all the dialogs belonging to a profile. If the profile supports
    values, the check can be reinforced to take into account a specific
    values, the check can be reinforced to take into account a specific
@@ -2011,7 +2064,7 @@ kamcmd dlg.dlg.profile_get_size inbound_calls
 kamcmd dlg.profile_list inbound_calls
 kamcmd dlg.profile_list inbound_calls
 ...
 ...
 
 
-9.9. dlg.bridge_dlg
+9.11. dlg.bridge_dlg
 
 
    Bridge two SIP addresses into a call using INVITE(hold)-REFER-BYE
    Bridge two SIP addresses into a call using INVITE(hold)-REFER-BYE
    mechanism.
    mechanism.
@@ -2036,7 +2089,7 @@ kamcmd dlg.profile_list inbound_calls
 kamcmd dlg.bridge_dlg _from_ _to_ _op_
 kamcmd dlg.bridge_dlg _from_ _to_ _op_
 ...
 ...
 
 
-9.10. dlg.stats_active
+9.12. dlg.stats_active
 
 
    Get stats about active dialogs by scanning internal list of dialogs
    Get stats about active dialogs by scanning internal list of dialogs
    (not relying on core stats framework).
    (not relying on core stats framework).
@@ -2060,6 +2113,26 @@ kamcmd dlg.bridge_dlg _from_ _to_ _op_
 kamcmd dlg.stats_active
 kamcmd dlg.stats_active
 ...
 ...
 
 
+9.13. dlg.is_alive
+
+   Check whether a dialog matching the parameter is in confirmed state
+   (answered and alive).
+
+   Name: dlg.is_alive
+
+   Parameters:
+     * callid - callid of dialog
+     * from_tag - from tag of the dialog
+     * to_tag - to tag of the dialog
+
+   This command will return error if dialog is not found or not confirmed
+   state (answered).
+
+   RPC Command Format:
+...
+kamcmd dlg.is_alive callid123 fromtag123 totag123
+...
+
 10. Exported Variables
 10. Exported Variables
 
 
    10.1. $DLG_count
    10.1. $DLG_count

+ 15 - 6
src/modules/dispatcher/README

@@ -1439,12 +1439,21 @@ kamcmd dispatcher.ping_active 0
    destination address (string value in full SIP URI format).
    destination address (string value in full SIP URI format).
 
 
    Optionally, these fields can be followed by:
    Optionally, these fields can be followed by:
-     * flags (listed by index - can be bitwise mask of values): 0 (value
-       1) - inactive destination; 1 (value 2) - temporary trying
-       destination (in the way to become inactive if it does not reply to
-       keepalives - there is a module parameter to set the threshold of
-       failures); 2 (value 4) - admin disabled destination; 3 (value 8) -
-       probing destination (sending keep alives);
+     * flags - control the mode of using the destination address and
+       sending keepalives. It is a bitwise value that can be built using
+       the folowing flags:
+          + 1 (bit at index 0 - 1 <<0) - inactive destination
+          + 2 (bit at index 1 - 1 <<1) - temporary trying destination (in
+            the way to become inactive if it does not reply to keepalives
+            - there is a module parameter to set the threshold of
+            failures)
+          + 4 (bit at index 2 - 1 <<2) - admin disabled destination
+          + 8 (bit at index 3 - 1 <<3) - probing destination (sending keep
+            alives);
+          + 16 (bit at index 4 - 1 <<4) - skip DNS A/AAAA resolve at
+            startup, useful when the hostname of the destination address
+            is a NAPTR or SRV record only. Such addresses cannot be
+            matched anymore with ds_is_from_list(...).
      * priority: sets the priority in destination list (based on it is
      * priority: sets the priority in destination list (based on it is
        done the initial ordering inside the set)
        done the initial ordering inside the set)
      * attributes: extra fields in form of name1=value1;...;nameN=valueN.
      * attributes: extra fields in form of name1=value1;...;nameN=valueN.

+ 7 - 8
src/modules/ims_charging/README

@@ -66,7 +66,7 @@ Carlos Ruiz Diaz
         5. Functions
         5. Functions
 
 
               5.1. Ro_CCR(route_name, direction, reservation_units,
               5.1. Ro_CCR(route_name, direction, reservation_units,
-                      domain, incoming_trunk_id, outgoing_trunk_id
+                      incoming_trunk_id, outgoing_trunk_id)
 
 
               5.2. Ro_set_session_id_avp()
               5.2. Ro_set_session_id_avp()
 
 
@@ -163,8 +163,8 @@ Chapter 1. Admin Guide
 
 
    5. Functions
    5. Functions
 
 
-        5.1. Ro_CCR(route_name, direction, reservation_units, domain,
-                incoming_trunk_id, outgoing_trunk_id
+        5.1. Ro_CCR(route_name, direction, reservation_units,
+                incoming_trunk_id, outgoing_trunk_id)
 
 
         5.2. Ro_set_session_id_avp()
         5.2. Ro_set_session_id_avp()
 
 
@@ -689,13 +689,13 @@ modparam("ims_charging", "custom_user_avp", "$avp(from_user)")
 
 
 5. Functions
 5. Functions
 
 
-   5.1. Ro_CCR(route_name, direction, reservation_units, domain,
-          incoming_trunk_id, outgoing_trunk_id
+   5.1. Ro_CCR(route_name, direction, reservation_units,
+          incoming_trunk_id, outgoing_trunk_id)
 
 
    5.2. Ro_set_session_id_avp()
    5.2. Ro_set_session_id_avp()
 
 
-5.1. Ro_CCR(route_name, direction, reservation_units, domain,
-incoming_trunk_id, outgoing_trunk_id
+5.1. Ro_CCR(route_name, direction, reservation_units, incoming_trunk_id,
+outgoing_trunk_id)
 
 
    Perform a CCR on Diameter Ro interface for Charging
    Perform a CCR on Diameter Ro interface for Charging
 
 
@@ -704,7 +704,6 @@ incoming_trunk_id, outgoing_trunk_id
      * direction "orig"inating or "term"inating
      * direction "orig"inating or "term"inating
      * reservation_units how many units (at the moment seconds) should be
      * reservation_units how many units (at the moment seconds) should be
        reserved at the moment.
        reserved at the moment.
-     * domain Logical domain within registrar.
      * incoming_trunk_id Identifies the trunk group from which this
      * incoming_trunk_id Identifies the trunk group from which this
        originates.
        originates.
      * outgoing_trunk_id Identifies the trunk group where this will be
      * outgoing_trunk_id Identifies the trunk group where this will be

+ 25 - 4
src/modules/rtpengine/README

@@ -652,11 +652,11 @@ modparam("rtpengine", "rtpengine_retr", 2)
 
 
 4.8. extra_id_pv (string)
 4.8. extra_id_pv (string)
 
 
-   The parameter sets the PV definition to use when the “b” parameter is
-   used on rtpengine_delete(), rtpengine_offer(), rtpengine_answer() or
-   rtpengine_manage() command.
+   The parameter sets the PV definition to use when the “via-branch”
+   parameter is used on rtpengine_delete(), rtpengine_offer(),
+   rtpengine_answer() or rtpengine_manage() command.
 
 
-   Default is empty, the “b” parameter may not be used then.
+   Default is empty, the “via-branch” parameter may not be used then.
 
 
    Example 1.8. Set extra_id_pv parameter
    Example 1.8. Set extra_id_pv parameter
 ...
 ...
@@ -2028,6 +2028,19 @@ rtpengine_offer();
             used when recording calls to provide custom additional
             used when recording calls to provide custom additional
             information. More details about this are found in the
             information. More details about this are found in the
             rtpengine README.
             rtpengine README.
+          + codec-transcode=... - allows codecs to be added to the list of
+            offered codecs even if they were not present in the original
+            list of codecs. In this case, the transcoding engine will be
+            engaged. Only codecs that are supported for both decoding and
+            encoding can be added in this manner. More details about this
+            are found in the rtpengine README.
+          + codec-strip=... - strips given codec from sdp
+          + codec-offer=... - offer given codec from sdp.More details
+            about this are found in the rtpengine README.
+          + codec-mask=... - Similar to strip except that codecs listed
+            here will still be accepted and used for transcoding on the
+            offering side.Useful only in combination with codec-transcode.
+            all keyword can be used to mask all offered codecs
        Check also the documentation of RTPEngine, these flags are
        Check also the documentation of RTPEngine, these flags are
        documented there as well: https://github.com/sipwise/rtpengine.
        documented there as well: https://github.com/sipwise/rtpengine.
 
 
@@ -2064,6 +2077,14 @@ onreply_route[2]
         rtpengine_offer();
         rtpengine_offer();
 ...
 ...
 }
 }
+...
+if (has_body("application/sdp")) {
+                if (rtpengine_offer("codec-mask=all codec-transcode=PCMU codec-t
+ranscode=PCMA"))
+                                t_on_reply("1");
+}
+
+...
 
 
 5.3.  rtpengine_answer([flags])
 5.3.  rtpengine_answer([flags])
 
 

+ 31 - 14
src/modules/sqlops/README

@@ -29,6 +29,7 @@ Daniel-Constantin Mierla
               3.1. sqlcon (str)
               3.1. sqlcon (str)
               3.2. sqlres (str)
               3.2. sqlres (str)
               3.3. tr_buf_size (int)
               3.3. tr_buf_size (int)
+              3.4. connect_mode (int)
 
 
         4. Functions
         4. Functions
 
 
@@ -48,13 +49,14 @@ Daniel-Constantin Mierla
    1.1. Set sqlcon parameter
    1.1. Set sqlcon parameter
    1.2. Set sqlres parameter
    1.2. Set sqlres parameter
    1.3. Set tr_buf_size parameter
    1.3. Set tr_buf_size parameter
-   1.4. sql_query() usage
-   1.5. sql_xquery() usage
-   1.6. sql_pvquery() usage
-   1.7. sql_result_free() usage
-   1.8. sql_query_async() usage
-   1.9. $dbr(result=>key) usage
-   1.10. $sqlrows(con) usage
+   1.4. Set connect_mode parameter
+   1.5. sql_query() usage
+   1.6. sql_xquery() usage
+   1.7. sql_pvquery() usage
+   1.8. sql_result_free() usage
+   1.9. sql_query_async() usage
+   1.10. $dbr(result=>key) usage
+   1.11. $sqlrows(con) usage
 
 
 Chapter 1. Admin Guide
 Chapter 1. Admin Guide
 
 
@@ -71,6 +73,7 @@ Chapter 1. Admin Guide
         3.1. sqlcon (str)
         3.1. sqlcon (str)
         3.2. sqlres (str)
         3.2. sqlres (str)
         3.3. tr_buf_size (int)
         3.3. tr_buf_size (int)
+        3.4. connect_mode (int)
 
 
    4. Functions
    4. Functions
 
 
@@ -132,6 +135,7 @@ Chapter 1. Admin Guide
    3.1. sqlcon (str)
    3.1. sqlcon (str)
    3.2. sqlres (str)
    3.2. sqlres (str)
    3.3. tr_buf_size (int)
    3.3. tr_buf_size (int)
+   3.4. connect_mode (int)
 
 
 3.1. sqlcon (str)
 3.1. sqlcon (str)
 
 
@@ -181,6 +185,19 @@ modparam("sqlops", "sqlres", "ra")
 modparam("sqlops", "tr_buf_size", 4096)
 modparam("sqlops", "tr_buf_size", 4096)
 ...
 ...
 
 
+3.4. connect_mode (int)
+
+   Control if the module must stop loading when connecting to database
+   server fails during start up. Values: 0 - stop loading; 1 - continue
+   even if connecting to database server fails.
+
+   Default value is 0.
+
+   Example 1.4. Set connect_mode parameter
+...
+modparam("sqlops", "connect_mode", 1)
+...
+
 4. Functions
 4. Functions
 
 
    4.1. sql_query(connection, query[, result])
    4.1. sql_query(connection, query[, result])
@@ -209,7 +226,7 @@ modparam("sqlops", "tr_buf_size", 4096)
 
 
    This function can be used from ANY_ROUTE.
    This function can be used from ANY_ROUTE.
 
 
-   Example 1.4. sql_query() usage
+   Example 1.5. sql_query() usage
 ...
 ...
 modparam("sqlops","sqlcon","ca=>dbdriver://username:password@dbhost/dbname")
 modparam("sqlops","sqlcon","ca=>dbdriver://username:password@dbhost/dbname")
 ...
 ...
@@ -229,7 +246,7 @@ sql_result_free("ra");
 
 
    This function can be used from ANY_ROUTE.
    This function can be used from ANY_ROUTE.
 
 
-   Example 1.5. sql_xquery() usage
+   Example 1.6. sql_xquery() usage
 ...
 ...
 modparam("sqlops","sqlcon","ca=>dbdriver://username:password@dbhost/dbname")
 modparam("sqlops","sqlcon","ca=>dbdriver://username:password@dbhost/dbname")
 ...
 ...
@@ -267,7 +284,7 @@ if (sql_xquery("ca", "select * from domain", "ra") == 1) {
    successful query, 2 if query provided no result set, 3 if result is
    successful query, 2 if query provided no result set, 3 if result is
    ignored (no result parameter given)
    ignored (no result parameter given)
 
 
-   Example 1.6. sql_pvquery() usage
+   Example 1.7. sql_pvquery() usage
 ...
 ...
 modparam("sqlops","sqlcon","ca=>dbdriver://username:password@dbhost/dbname")
 modparam("sqlops","sqlcon","ca=>dbdriver://username:password@dbhost/dbname")
 ...
 ...
@@ -281,7 +298,7 @@ sql_pvquery("ca", "select 'col1', 2, NULL, 'sip:[email protected]'",
 
 
    This function can be used from ANY_ROUTE.
    This function can be used from ANY_ROUTE.
 
 
-   Example 1.7. sql_result_free() usage
+   Example 1.8. sql_result_free() usage
 ...
 ...
 modparam("sqlops","sqlcon","ca=>dbdriver://username:password@dbhost/dbname")
 modparam("sqlops","sqlcon","ca=>dbdriver://username:password@dbhost/dbname")
 ...
 ...
@@ -305,7 +322,7 @@ sql_result_free("ra");
 
 
    This function can be used from ANY_ROUTE.
    This function can be used from ANY_ROUTE.
 
 
-   Example 1.8. sql_query_async() usage
+   Example 1.9. sql_query_async() usage
 ...
 ...
 modparam("sqlops","sqlcon","ca=>dbdriver://username:password@dbhost/dbname")
 modparam("sqlops","sqlcon","ca=>dbdriver://username:password@dbhost/dbname")
 ...
 ...
@@ -332,7 +349,7 @@ sql_query_async("ca", "delete from domain");
        integer.
        integer.
      * colname[N] - return the name of the N-th column in the result set.
      * colname[N] - return the name of the N-th column in the result set.
 
 
-   Example 1.9. $dbr(result=>key) usage
+   Example 1.10. $dbr(result=>key) usage
 ...
 ...
 modparam("sqlops","sqlcon","ca=>dbdriver://username:password@dbhost/dbname")
 modparam("sqlops","sqlcon","ca=>dbdriver://username:password@dbhost/dbname")
 ...
 ...
@@ -391,7 +408,7 @@ if (sql_xquery("ca", "select * from domain", "ra") == 1)
 
 
    “con” must be the name identifying a DB connection.
    “con” must be the name identifying a DB connection.
 
 
-   Example 1.10. $sqlrows(con) usage
+   Example 1.11. $sqlrows(con) usage
 ...
 ...
 modparam("sqlops","sqlcon","ca=>dbdriver://username:password@dbhost/dbname")
 modparam("sqlops","sqlcon","ca=>dbdriver://username:password@dbhost/dbname")
 ...
 ...

+ 50 - 0
src/modules/textops/README

@@ -97,6 +97,7 @@ Ovidiu Sas
               4.46. get_body_part(content_type, opv)
               4.46. get_body_part(content_type, opv)
               4.47. get_body_part_raw(content_type, opv)
               4.47. get_body_part_raw(content_type, opv)
               4.48. remove_body_part(content_type)
               4.48. remove_body_part(content_type)
+              4.49. regex_substring(itext, regexp, mindex, mcount, dpv)
 
 
    2. Developer Guide
    2. Developer Guide
 
 
@@ -155,6 +156,7 @@ Ovidiu Sas
    1.47. get_body_part usage
    1.47. get_body_part usage
    1.48. get_body_part_raw usage
    1.48. get_body_part_raw usage
    1.49. remove_body_part usage
    1.49. remove_body_part usage
+   1.50. _regex_substring usage
 
 
 Chapter 1. Admin Guide
 Chapter 1. Admin Guide
 
 
@@ -219,6 +221,7 @@ Chapter 1. Admin Guide
         4.46. get_body_part(content_type, opv)
         4.46. get_body_part(content_type, opv)
         4.47. get_body_part_raw(content_type, opv)
         4.47. get_body_part_raw(content_type, opv)
         4.48. remove_body_part(content_type)
         4.48. remove_body_part(content_type)
+        4.49. regex_substring(itext, regexp, mindex, mcount, dpv)
 
 
 1. Overview
 1. Overview
 
 
@@ -305,6 +308,7 @@ From: medabeda
    4.46. get_body_part(content_type, opv)
    4.46. get_body_part(content_type, opv)
    4.47. get_body_part_raw(content_type, opv)
    4.47. get_body_part_raw(content_type, opv)
    4.48. remove_body_part(content_type)
    4.48. remove_body_part(content_type)
+   4.49. regex_substring(itext, regexp, mindex, mcount, dpv)
 
 
 4.1.  search(re)
 4.1.  search(re)
 
 
@@ -1160,6 +1164,7 @@ if (starts_with("$rU", "+358"))
 set_body_multipart("test", "text/plain", "delimiter");
 set_body_multipart("test", "text/plain", "delimiter");
 msg_apply_changes();
 msg_apply_changes();
 append_body_part(...);
 append_body_part(...);
+msg_apply_changes();
 
 
 ...
 ...
 
 
@@ -1195,11 +1200,15 @@ text
    The core will take care of the last boundary ending "--". Detecting
    The core will take care of the last boundary ending "--". Detecting
    wich one is the last and fixing the others if needed.
    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
    Example 1.44. append_body_part usage
 ...
 ...
 $var(b) = "7e Od 04 55 75 69 20 4d 61 6b 65 43 61 6c 6c";
 $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
 append_body_part("$var(b)", "application/vnd.cirpack.isdn-ext", "signal;handling
 =required");
 =required");
+msg_apply_changes();
 ...
 ...
 
 
 # Will append this to the body:
 # Will append this to the body:
@@ -1221,6 +1230,7 @@ Content-Disposition: signal;handling=required
 ...
 ...
 $var(b) = "";
 $var(b) = "";
 append_body_part("$var(b)", "application/xml\r\nX-Header: xyz");
 append_body_part("$var(b)", "application/xml\r\nX-Header: xyz");
+msg_apply_changes();
 ...
 ...
 
 
 # Will append this to the body:
 # Will append this to the body:
@@ -1255,10 +1265,14 @@ Content-Disposition: signal;handling=required
    The core will take care of the last boundary ending "--". Detecting
    The core will take care of the last boundary ending "--". Detecting
    wich one is the last and fixing the others if needed.
    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
    Example 1.46. append_body_part_hex usage
 ...
 ...
 $var(b) = "6b 61 6d 61 69 6c 69 6f";
 $var(b) = "6b 61 6d 61 69 6c 69 6f";
 append_body_part_hex("$var(b)", "application/my-custom-ext");
 append_body_part_hex("$var(b)", "application/my-custom-ext");
+msg_apply_changes();
 ...
 ...
 
 
 # Will append this to the body:
 # Will append this to the body:
@@ -1326,11 +1340,47 @@ get_body_part("application/vnd.cirpack.isdn-ext", "$var(hbody)");
    The core will take care of the last boundary ending "--". Detecting
    The core will take care of the last boundary ending "--". Detecting
    wich one is the last and fixing the others if needed.
    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
    Example 1.49. remove_body_part usage
 ...
 ...
 remove_body_part("application/vnd.cirpack.isdn-ext");
 remove_body_part("application/vnd.cirpack.isdn-ext");
+msg_apply_changes();
 ...
 ...
 
 
+4.49.  regex_substring(itext, regexp, mindex, mcount, dpv)
+
+   Search in text with given regular expression then sets dpv
+   pseudo-variable with the matched token at provided index.
+
+   Meaning of the parameters is as follows:
+     * itext - text to be searched (dynamic string)
+     * regexp - regular expression (dynamic string)
+     * mindex - index of the matched token (int or variable holding int)
+     * mcount - the number of maximum expected matches (int or variable
+       holding int)
+     * dpv - variable to be set with matched token (static string with a
+       name of a variable)
+
+   This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
+   BRANCH_ROUTE.
+
+   Note that the regular expression extended is used. More info at:
+   https://www.regular-expressions.info/posix.html.
+
+   Example 1.50. _regex_substring usage
+        ...
+        regex_substring("___ abc123def ___ ghi456 ___", "([a-z]*)([0-9]+)([a-z]*
+)",
+                        1, 3, "$var(asd)");
+        xlog("L_WARN","RESULT: $var(asd)\r\n");
+        ------
+        result:
+        abc
+        ----
+        ...
+
 Chapter 2. Developer Guide
 Chapter 2. Developer Guide
 
 
    Table of Contents
    Table of Contents

+ 56 - 12
src/modules/tmx/README

@@ -52,8 +52,9 @@ Juha Heinanen
               4.9. t_is_request_route()
               4.9. t_is_request_route()
               4.10. t_suspend()
               4.10. t_suspend()
               4.11. t_continue(tindex, tlabel, rtname)
               4.11. t_continue(tindex, tlabel, rtname)
-              4.12. t_reuse_branch()
-              4.13. t_precheck_trans()
+              4.12. t_drop([rcode])
+              4.13. t_reuse_branch()
+              4.14. t_precheck_trans()
 
 
         5. Exported Variables
         5. Exported Variables
         6. Statistics
         6. Statistics
@@ -87,8 +88,9 @@ Juha Heinanen
    1.10. t_is_request_route usage
    1.10. t_is_request_route usage
    1.11. t_suspend usage
    1.11. t_suspend usage
    1.12. t_continue usage
    1.12. t_continue usage
-   1.13. t_reuse_branch usage
-   1.14. t_precheck_trans usage
+   1.13. t_drop usage
+   1.14. t_reuse_branch usage
+   1.15. t_precheck_trans usage
 
 
 Chapter 1. Admin Guide
 Chapter 1. Admin Guide
 
 
@@ -117,8 +119,9 @@ Chapter 1. Admin Guide
         4.9. t_is_request_route()
         4.9. t_is_request_route()
         4.10. t_suspend()
         4.10. t_suspend()
         4.11. t_continue(tindex, tlabel, rtname)
         4.11. t_continue(tindex, tlabel, rtname)
-        4.12. t_reuse_branch()
-        4.13. t_precheck_trans()
+        4.12. t_drop([rcode])
+        4.13. t_reuse_branch()
+        4.14. t_precheck_trans()
 
 
    5. Exported Variables
    5. Exported Variables
    6. Statistics
    6. Statistics
@@ -191,8 +194,9 @@ modparam("tmx", "precheck_trans", 0)
    4.9. t_is_request_route()
    4.9. t_is_request_route()
    4.10. t_suspend()
    4.10. t_suspend()
    4.11. t_continue(tindex, tlabel, rtname)
    4.11. t_continue(tindex, tlabel, rtname)
-   4.12. t_reuse_branch()
-   4.13. t_precheck_trans()
+   4.12. t_drop([rcode])
+   4.13. t_reuse_branch()
+   4.14. t_precheck_trans()
 
 
 4.1.  t_cancel_branches(which)
 4.1.  t_cancel_branches(which)
 
 
@@ -407,7 +411,47 @@ route[MYROUTE] {
 }
 }
 ...
 ...
 
 
-4.12.  t_reuse_branch()
+4.12.  t_drop([rcode])
+
+   Drops the transaction with response code (500 default).
+
+   Parameters:.
+     * rcode - response code to set in uas status.
+
+   This function can be used in ANY_ROUTE.
+
+   Example 1.13. t_drop usage
+...
+route[MYREQ]
+{
+...
+    if (!t_newtran()) {
+        xlog("L_ERROR", "$ci|log|failed to create transaction\n");
+        drop;
+    }
+
+    t_on_failure("TR_ERROR");
+    t_on_reply("TR_OK");
+    t_relay();
+}
+
+failure_route[TR_ERROR]
+{
+    xlog("L_INFO", "$ci|log|failed $T_reply_code $T_reply_reason\n");
+    t_drop();
+}
+
+onreply_route[TR_OK]
+{
+   xlog("L_INFO", "$ci|log|checking transaction result\n");
+   if(status=~"60[0-9]") {
+      t_drop();
+   }
+...
+}
+...
+
+4.13.  t_reuse_branch()
 
 
    Creates new "main" branch by making copy of branch-failure branch.
    Creates new "main" branch by making copy of branch-failure branch.
    Currently the following branch attributes are copied from
    Currently the following branch attributes are copied from
@@ -416,7 +460,7 @@ route[MYROUTE] {
 
 
    This function can be used from tm:branch-failure event_route.
    This function can be used from tm:branch-failure event_route.
 
 
-   Example 1.13. t_reuse_branch usage
+   Example 1.14. t_reuse_branch usage
 ...
 ...
 event_route [tm:branch-failure:contact] {
 event_route [tm:branch-failure:contact] {
     t_reuse_branch();
     t_reuse_branch();
@@ -426,7 +470,7 @@ event_route [tm:branch-failure:contact] {
 }
 }
 ...
 ...
 
 
-4.13.  t_precheck_trans()
+4.14.  t_precheck_trans()
 
 
    Check if current processed message is handled by other process. This
    Check if current processed message is handled by other process. This
    function is useful to catch retransmissions before transaction is
    function is useful to catch retransmissions before transaction is
@@ -438,7 +482,7 @@ event_route [tm:branch-failure:contact] {
 
 
    This function can be used from REQUEST_ROUTE .
    This function can be used from REQUEST_ROUTE .
 
 
-   Example 1.14. t_precheck_trans usage
+   Example 1.15. t_precheck_trans usage
 ...
 ...
     # handle retransmissions
     # handle retransmissions
     if(t_precheck_trans()) {
     if(t_precheck_trans()) {

+ 3 - 2
src/modules/websocket/README

@@ -203,7 +203,7 @@ event_route[xhttp:request] {
                 # Optional... perform HTTP authentication
                 # Optional... perform HTTP authentication
 
 
                 # ws_handle_handshake() exits (no further configuration file
                 # ws_handle_handshake() exits (no further configuration file
-                # processing of the request) when complete.
+                # processing of the request) when complete in case of failure.
                 if (ws_handle_handshake())
                 if (ws_handle_handshake())
                 {
                 {
                         # Optional... cache some information about the
                         # Optional... cache some information about the
@@ -500,7 +500,8 @@ end
 Note
 Note
 
 
    This function returns 0, stopping all further processing of the
    This function returns 0, stopping all further processing of the
-   request, when there is a problem.
+   request, when there is a problem. Otherwise, it returns 1 (or positive
+   number) in case of success.
 
 
    Example 1.12. ws_handle_handshake usage
    Example 1.12. ws_handle_handshake usage
 ...
 ...

+ 40 - 4
src/modules/xmlrpc/README

@@ -24,6 +24,7 @@ Jan Janak
               2.5. mode (integer)
               2.5. mode (integer)
               2.6. url_skip (str)
               2.6. url_skip (str)
               2.7. url_match (str)
               2.7. url_match (str)
+              2.8. event_callback (string)
 
 
         3. Functions
         3. Functions
 
 
@@ -44,8 +45,9 @@ Jan Janak
    1.5. Set the mode parameter
    1.5. Set the mode parameter
    1.6. Set url_skip parameter
    1.6. Set url_skip parameter
    1.7. Set url_match 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
 1. Design Goals
 
 
@@ -536,6 +538,7 @@ Chapter 1. Admin Guide
         2.5. mode (integer)
         2.5. mode (integer)
         2.6. url_skip (str)
         2.6. url_skip (str)
         2.7. url_match (str)
         2.7. url_match (str)
+        2.8. event_callback (string)
 
 
    3. Functions
    3. Functions
 
 
@@ -560,6 +563,7 @@ Chapter 1. Admin Guide
    2.5. mode (integer)
    2.5. mode (integer)
    2.6. url_skip (str)
    2.6. url_skip (str)
    2.7. url_match (str)
    2.7. url_match (str)
+   2.8. event_callback (string)
 
 
 2.1. route (string)
 2.1. route (string)
 
 
@@ -665,6 +669,38 @@ modparam("xmlrpc", "url_skip", "^/sip")
 modparam("xmlrpc", "url_match", "^/RPC2")
 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. Functions
 
 
    3.1. dispatch_rpc()
    3.1. dispatch_rpc()
@@ -686,7 +722,7 @@ modparam("xmlrpc", "url_match", "^/RPC2")
    function with matching name. If such a function is found then
    function with matching name. If such a function is found then
    dispatch_rpc() will pass control to the function to handle the request.
    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");
 modparam("xmlrpc", "route", "XMLRPC");
 #...
 #...
@@ -702,7 +738,7 @@ route[XMLRPC]{
    This function can be called from the config script to directly generate
    This function can be called from the config script to directly generate
    an XML-RPC reply.
    an XML-RPC reply.
 
 
-   Example 1.9. xmlrpc_reply usage
+   Example 1.10. xmlrpc_reply usage
 #...
 #...
 modparam("xmlrpc", "route", "XMLRPC");
 modparam("xmlrpc", "route", "XMLRPC");
 #...
 #...