Преглед на файлове

bits of docs for core functions

Daniel-Constantin Mierla преди 7 години
родител
ревизия
1f582c44f1
променени са 1 файла, в които са добавени 33 реда и са изтрити 2 реда
  1. 33 2
      kamailio-kemi-framework/docs/core.md

+ 33 - 2
kamailio-kemi-framework/docs/core.md

@@ -238,6 +238,12 @@ Write a log message specifying the level value. The level parameter can be:
 
 If level value is not matched, then "err" log level is used.
 
+Example:
+
+```
+KSR.log("dbg", "message from: " + KSR.pv.getw("$si") + "\r\n");
+```
+
 ### KSR.setflag(...) ###
 
 `bool KSR.setflag(int flag)`
@@ -321,26 +327,32 @@ KSR.setbiflag(10, 2);
 
 `bool KSR.resetbiflag(int flag, int branch)`
 
-Reset a branch flag.
+Reset a branch flag by position and branch index.
 
 ### KSR.isbiflagset(...) ###
 
 `bool KSR.isbiflagset(int flag, int branch)`
 
-Test if a branch flag is set.
+Test if a branch flag is set by position and branch index.
 
 ### KSR.setsflag(...) ###
 
 `bool KSR.setsflag(int flag)`
 
+Set a script flag.
+
 ### KSR.resetsflag(...) ###
 
 `bool KSR.resetsflag(int flag)`
 
+Reset a script flag.
+
 ### KSR.issflagset(...) ###
 
 `bool KSR.issflagset(int flag)`
 
+Test if a script flag is set.
+
 ### KSR.seturi(...) ###
 
 `bool KSR.seturi(str "uri")`
@@ -387,14 +399,27 @@ KSR.setdsturi("sip:voip.com:5061;transport=tls");
 
 `bool KSR.resetdsturi()`
 
+Reset the destination URI (aka: outbound proxy address, dst_uri, $du).
+
 ### KSR.isdsturiset(...) ###
 
 `bool KSR.isdsturiset()`
 
+Test if destination URI is set.
+
 ### KSR.force_rport(...) ###
 
 `bool KSR.force_rport()`
 
+Set the flag for "rport" handling (send the reply based on source address
+instead of Via header).
+
+Example:
+
+```
+KSR.force_rport();
+```
+
 ### KSR.set_drop(...) ###
 
 `void KSR.set_drop()`
@@ -403,6 +428,12 @@ Set the DROP flag, so at the end of KEMI script execution, the SIP request branc
 
 Note: it doesn't not stop the execution of KEMI script, see KSR.x.drop().
 
+Example:
+
+```
+KSR.set_drop();
+```
+
 ### KSR.set_advertised_address() ###
 
 `int set_advertised_address(str "addr")`