瀏覽代碼

kamailio-kemi-framework: added more examples

Daniel-Constantin Mierla 3 年之前
父節點
當前提交
efdee5497a
共有 1 個文件被更改,包括 111 次插入0 次删除
  1. 111 0
      kamailio-kemi-framework/docs/core.md

+ 111 - 0
kamailio-kemi-framework/docs/core.md

@@ -301,36 +301,83 @@ end
 
 Return true if the method type of the SIP message is `MESSAGE`.
 
+Example:
+
+```Lua
+if KSR.is_MESSAGE() then
+  ...
+end
+```
+
 ### KSR.is_SUBSCRIBE() ###
 
 `bool is_SUBSCRIBE()`
 
 Return true if the method type of the SIP message is `SUBSCRIBE`.
 
+Example:
+
+```Lua
+if KSR.is_SUBSCRIBE() then
+  ...
+end
+```
+
 ### KSR.is_PUBLISH() ###
 
 `bool is_PUBLISH()`
 
 Return true if the method type of the SIP message is `PUBLISH`.
 
+Example:
+
+```Lua
+if KSR.is_PUBLISH() then
+  ...
+end
+```
+
 ### KSR.is_NOTIFY() ###
 
 `bool is_NOTIFY()`
 
 Return true if the method type of the SIP message is `NOTIFY`.
 
+Example:
+
+```Lua
+if KSR.is_NOTIFY() then
+  ...
+end
+```
+
 ### KSR.is_OPTIONS() ###
 
 `bool is_OPTIONS()`
 
 Return true if the method type of the SIP message is `OPTIONS`.
 
+Example:
+
+```Lua
+if KSR.is_OPTIONS() then
+  ...
+end
+```
+
 ### KSR.is_REFER() ###
 
 `bool is_REFER()`
 
 Return true if the method type of the SIP message is `REFER`.
 
+Example:
+
+```Lua
+if KSR.is_REFER() then
+  ...
+end
+```
 
 ### KSR.is_INFO() ###
 
@@ -338,48 +385,112 @@ Return true if the method type of the SIP message is `REFER`.
 
 Return true if the method type of the SIP message is `INFO`.
 
+Example:
+
+```Lua
+if KSR.is_INFO() then
+  ...
+end
+```
+
 ### KSR.is_UPDATE() ###
 
 `bool is_UPDATE()`
 
 Return true if the method type of the SIP message is `UPDATE`.
 
+Example:
+
+```Lua
+if KSR.is_UPDATE() then
+  ...
+end
+```
+
 ### KSR.is_PRACK() ###
 
 `bool is_PRACK()`
 
 Return true if the method type of the SIP message is `PRACK`.
 
+Example:
+
+```Lua
+if KSR.is_PRACK() then
+  ...
+end
+```
+
 ### KSR.is_KDMQ() ###
 
 `bool is_KDMQ()`
 
 Return true if the method type of the SIP message is `KDMQ`.
 
+Example:
+
+```Lua
+if KSR.is_KDMQ() then
+  ...
+end
+```
+
 ### KSR.is_GET() ###
 
 `bool is_GET()`
 
 Return true if the method type of the HTTP message is `GET`.
 
+Example:
+
+```Lua
+if KSR.is_GET() then
+  ...
+end
+```
+
 ### KSR.is_POST() ###
 
 `bool is_POST()`
 
 Return true if the method type of the HTTP message is `POST`.
 
+Example:
+
+```Lua
+if KSR.is_POST() then
+  ...
+end
+```
+
 ### KSR.is_PUT() ###
 
 `bool is_PUT()`
 
 Return true if the method type of the HTTP message is `PUT`.
 
+Example:
+
+```Lua
+if KSR.is_PUT() then
+  ...
+end
+```
+
 ### KSR.is_DELETE() ###
 
 `bool is_DELETE()`
 
 Return true if the method type of the HTTP message is `DELETE`.
 
+Example:
+
+```Lua
+if KSR.is_DELETE() then
+  ...
+end
+```
+
 ### KSR.is_myself(...) ###
 
 `bool KSR.is_myself(str "uri")`